feat: ssz, eth2api add bitfield accessors, synthetic graffiti#469
feat: ssz, eth2api add bitfield accessors, synthetic graffiti#469mskrzypkows wants to merge 3 commits into
Conversation
is_synthetic - Add bit_at, set_bit_at, bit_indices, contains, and or combinators to BitList and BitVector, along with a BitfieldError type for length mismatches; export BitfieldError from the ssz crate - Replace the synthetic_graffiti() runtime function with a compile-time SYNTHETIC_GRAFFITI constant using a const block - Add SignedProposalBlock::graffiti() accessor and VersionedSignedProposal::is_synthetic() using the new constant
|
@claude review |
|
Claude finished @mskrzypkows's task in 3m 27s —— View job Review: PR #469 — bitfield accessors, synthetic graffiti const,
|
| /// Unifies Go's separate blinded/full checks: the payload enum already | ||
| /// carries both blinded and full variants, so a single graffiti comparison | ||
| /// covers every case. | ||
| pub fn is_synthetic(&self) -> bool { |
There was a problem hiding this comment.
Need to check version first:
https://github.com/ObolNetwork/charon/blob/v1.7.1/app/eth2wrap/synthproposer.go#L262
| /// Returns the bit at index `i`, or `false` if `i` is out of range. | ||
| pub fn bit_at(&self, i: usize) -> bool { | ||
| if i >= self.len { | ||
| return false; |
There was a problem hiding this comment.
is this better return Result / Option for this function?
| /// Sets the bit at index `i` to `value`; out-of-range indices are ignored. | ||
| pub fn set_bit_at(&mut self, i: usize, value: bool) { | ||
| if i >= self.len { | ||
| return; |
is_synthetic