Expand description
EVM-compatible uint256 bitmap operations and deterministic selection-group derivation.
Pure, anchor-free. Moved verbatim from the Molpha program’s utils/bitmap.rs
(MolphaError → DataUpdateError).
Functions§
- bitmap_
bit_ set - Solidity
uint256layout: bitposhas weight1 << pos,pos == 0is the integer LSB. - bitmap_
clear_ bit - bitmap_
is_ subset - bitmap_
is_ subset_ u256 sub ⊆ supwhen both are already loaded asU256.- bitmap_
load - EVM
uint256bitmap loaded from Soliditybytes32(big-endian). - bitmap_
popcount_ evm - bitmap_
set_ bit - bitmap_
store - Serialize an EVM
uint256bitmap tobytes32for storage / hashing. - derive_
group_ bitmap - Port of
NodeGroupBitmapLib.derivefrom the EVM reference. - effective_
selection_ size - Selection slot count:
min(node_count, signatures_required + redundancy_buffer). - for_
each_ set_ bit - Iterate set bit positions in ascending order (EVM signer order).
- for_
each_ set_ bit_ u256 - Visit set bits in ascending order; returns the peeled bitmap (zero when fully consumed).
- get_
index - Bitmap bit index of the signer at 0-based rank
poswhen signers are ordered by ascending bit index (same order as EVMValidator.verifycombines pubkeys). - validate_
bitmap_ upper_ bits_ clear - validate_
bitmap_ upper_ bits_ clear_ u256 - Reject signers with bits outside
[0, node_count).