Skip to content

engine: specify bit ordering for the 16-byte custody and cell bitarrays - #856

Open
edg-l wants to merge 1 commit into
ethereum:mainfrom
edg-l:clarify-custody-bitarray-encoding
Open

engine: specify bit ordering for the 16-byte custody and cell bitarrays#856
edg-l wants to merge 1 commit into
ethereum:mainfrom
edg-l:clarify-custody-bitarray-encoding

Conversation

@edg-l

@edg-l edg-l commented Jul 31, 2026

Copy link
Copy Markdown

engine_forkchoiceUpdatedV4's custodyColumns and engine_getBlobsV4's indices_bitarray are both 16-byte bitarrays with no stated bit-to-byte mapping. The failure is silent: a reversed order still decodes to a well-formed 128-bit set, so the EL adopts the wrong custody set, or returns cells the CL did not ask for, instead of returning an error.

The ordering specified is the SSZ serialization of BitVector[CELLS_PER_EXT_BLOB] (consensus specs), array[i // 8] |= value[i] << (i % 8). The custody set is SSZ-native, so this introduces no new convention. It matches go-ethereum, where core/types/custody_bitmap.go sets result[i/8] |= 1 << (i % 8) and marshals the 16 bytes as plain hex. ethrex implements the same ordering.

Documentation only: the fields stay DATA, 16 bytes, nothing on the wire changes, and no OpenRPC change is needed since both are already typed bytes16. Confirmation from other client teams would be welcome, and if any client packs the bits the other way round that is worth surfacing before this merges.

EIP-8070 carries the same definitions and has the same gap: ethereum/EIPs#12054, wording kept identical so the documents cannot drift.

custodyColumns and indices_bitarray are both 16-byte bitarrays with no
stated bit-to-byte mapping. Reference the SSZ BitVector serialization,
which is what go-ethereum already implements.

@mkalinin mkalinin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I’d wait with the merge till the EIP PR gets merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants