fix: get data column fixes

This commit is contained in:
Agnish Ghosh 2024-07-04 16:49:55 +05:30
parent 13029d952e
commit 41b35b9799
No known key found for this signature in database
GPG Key ID: 7BDDA05D1B25E9F8
2 changed files with 24 additions and 4 deletions

View File

@ -194,12 +194,32 @@ proc recover_blobs*(
ok(recovered_blobs) ok(recovered_blobs)
proc compute_signed_block_header(signed_block: deneb.SignedBeaconBlock |
electra.SignedBeaconBlock):
SignedBeaconBlockHeader =
let blck = signed_block.message
let block_header = BeaconBlockHeader(
slot: blck.slot,
proposer_index: blck.proposer_index,
parent_root: blck.parent_root,
state_root: blck.state_root,
body_root: hash_tree_root(blck.body)
)
result = SignedBeaconBlockHeader(
message: block_header,
signature: signed_block.signature
)
# https://github.com/ethereum/consensus-specs/blob/5f48840f4d768bf0e0a8156a3ed06ec333589007/specs/_features/eip7594/das-core.md#get_data_column_sidecars # https://github.com/ethereum/consensus-specs/blob/5f48840f4d768bf0e0a8156a3ed06ec333589007/specs/_features/eip7594/das-core.md#get_data_column_sidecars
proc get_data_column_sidecars*(signed_block: deneb.SignedBeaconBlock | electra.SignedBeaconBlock, blobs: seq[KzgBlob]): Result[seq[DataColumnSidecar], cstring] = proc get_data_column_sidecars*(signed_block: deneb.SignedBeaconBlock |
electra.SignedBeaconBlock,
blobs: seq[KzgBlob]):
Result[seq[DataColumnSidecar], cstring] =
var var
sidecar: DataColumnSidecar sidecar: DataColumnSidecar
signed_block_header: SignedBeaconBlockHeader
blck = signed_block.message blck = signed_block.message
signed_beacon_block_header = compute_signed_block_header(signed_block)
cellsAndProofs: seq[KzgCellsAndKzgProofs] cellsAndProofs: seq[KzgCellsAndKzgProofs]
kzg_incl_proof: array[4, Eth2Digest] kzg_incl_proof: array[4, Eth2Digest]
@ -245,7 +265,7 @@ proc get_data_column_sidecars*(signed_block: deneb.SignedBeaconBlock | electra.S
column: column, column: column,
kzgCommitments: blck.body.blob_kzg_commitments, kzgCommitments: blck.body.blob_kzg_commitments,
kzgProofs: kzgProofOfColumn, kzgProofs: kzgProofOfColumn,
signed_block_header: signed_block_header, signed_block_header: signed_beacon_block_header,
kzg_commitments_inclusion_proof: kzg_incl_proof kzg_commitments_inclusion_proof: kzg_incl_proof
) )
sidecars.add(sidecar) sidecars.add(sidecar)

View File

@ -25,7 +25,7 @@ logScope:
topics = "syncman" topics = "syncman"
const const
SyncWorkersCount* = 10 SyncWorkersCount* = 20
## Number of sync workers to spawn ## Number of sync workers to spawn
StatusUpdateInterval* = chronos.minutes(1) StatusUpdateInterval* = chronos.minutes(1)