Skip to content

Commit

Permalink
fill blindedblockbody KZG commitments from deneb blinded header (#5550)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Nov 1, 2023
1 parent ed446b1 commit 657de27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beacon_chain/spec/datatypes/deneb.nim
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ type
executionPayload*: ExecutionPayload
blockValue*: Wei
kzgs*: KzgCommitments
proofs*:seq[KZGProof]
proofs*: seq[KZGProof]
blobs*: Blobs

# https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.3/specs/deneb/beacon-chain.md#executionpayloadheader
Expand Down
7 changes: 6 additions & 1 deletion beacon_chain/validators/beacon_validators.nim
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ from ./message_router_mev import
func constructSignableBlindedBlock[T: capella_mev.SignedBlindedBeaconBlock](
blck: capella.BeaconBlock,
executionPayloadHeader: capella.ExecutionPayloadHeader): T =
# Leaves signature field default, to be filled in by caller
const
blckFields = getFieldNames(typeof(blck))
blckBodyFields = getFieldNames(typeof(blck.body))
Expand Down Expand Up @@ -659,12 +660,16 @@ proc constructSignableBlindedBlock[T: deneb_mev.SignedBlindedBeaconBlockContents
doAssert bbb.proofs.len == bbb.blob_roots.len
doAssert bbb.proofs.len == bbb.commitments.len

assign(blindedBlock.message.body.blob_kzg_commitments, bbb.commitments)

let blockRoot = hash_tree_root(blindedBlock.message)

if blindedBlockContents.signed_blinded_blob_sidecars.setLen(bbb.proofs.len):
for i in 0 ..< blindedBlockContents.signed_blinded_blob_sidecars.lenu64:
assign(
blindedBlockContents.signed_blinded_blob_sidecars[i],
deneb_mev.SignedBlindedBlobSidecar(message: deneb_mev.BlindedBlobSidecar(
block_root: hash_tree_root(blck),
block_root: blockRoot,
index: i,
slot: distinctBase(blck.slot),
block_parent_root: blck.parent_root,
Expand Down

0 comments on commit 657de27

Please sign in to comment.