Workers Auto Approve
BooleanBitfield needs to be made sane
There is an implementation of a Boolean Bitfield here:
It (kinda) does the job for now, but it really needs some work done. If you spend some time looking at it I think you'll soon find out what I mean. As an example;
- There is a possibility of overflows: we return the number of bits as a `usize`, however there can theoretically be `usize` number of bytes meaning we can have `8 * usize` bits.
- It keeps track of the number of true bits as you flip bits on and off. I don't think this is ideal as most cases where we want to know the number of true bits, we'll be receiving some serialized bytes from somewhere else (e.g., p2p nodes) and will need to calculate it manually.
On top of these two points, there's likely many chances for optimization.
# Required Functionality
get(n: usize) -> Result
Get value at index `n`.
Error if bit out-of-bounds (OOB) of underlying bytes.
set(n: usize, val: bool) -> Result
Set bit at index `n`. Returns the previous value if successful.
Error if bit is OOB of underlying bytes.
## Highest Set Bit
highest_set_bit() -> Option
Returns the index of the highest set bit. `Some(n)` if a bit set set, `None` otherwise.
_Note: this is useful because we need to reject messages if an unnecessary bit is set (e.g. if there are 10 voters and the 11th bit is set_
## Number of Underlying Bytes
num_bytes() -> usize
Returns the length of the underlying bytes.
_Note: useful to reject bitfields that are larger than required (e.g., if there are eight voters and two bytes -- only one byte is necessary). _
## Number of Set Bits
num_set_bits() -> usize
Returns the total number of set bits (i.e., how many peeps voted).
_Note: I'm not 100% sure we'll use this but I suspect we will._
Setup your profile
Tell us a little about you:
No results found for
Type to search skills..
Required [[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email: