fix every place to make new custody column function work

This commit is contained in:
Agnish Ghosh 2024-09-09 02:09:24 +05:30
parent 7d04142e4a
commit 4a006b5584
4 changed files with 9 additions and 9 deletions
beacon_chain

View File

@ -12,7 +12,7 @@ import
stew/results,
chronicles, chronos, metrics, taskpools,
../networking/eth2_network,
../spec/[helpers, forks, eip7594_helpers],
../spec/[helpers, forks],
../spec/datatypes/[altair, phase0, deneb, eip7594],
../consensus_object_pools/[
blob_quarantine, block_clearance, block_quarantine, blockchain_dag,

View File

@ -1151,7 +1151,7 @@ proc addDenebMessageHandlers(
node.addCapellaMessageHandlers(forkDigest, slot)
let
targetSubnets = node.fetchCustodySubnetCount()
custody_subnets = node.network.nodeId.get_custody_column_subnet(targetSubnets)
custody_subnets = node.network.nodeId.get_custody_column_subnets(targetSubnets)
debugEcho "Target Subnets"
debugEcho targetSubnets
@ -1167,13 +1167,13 @@ proc addDenebMessageHandlers(
node.network.subscribe(topic, basicParams)
if node.config.subscribeAllSubnets:
node.network.loadCscnetsMetadata(DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint8)
node.network.loadCscnetsMetadata(DATA_COLUMN_SIDECAR_SUBNET_COUNT)
elif not node.config.subscribeAllSubnets:
let csc = node.config.custodySubnetCount
if csc.isSome and csc.get < DATA_COLUMN_SIDECAR_SUBNET_COUNT:
node.network.loadCscnetsMetadata(csc.get.uint8)
node.network.loadCscnetsMetadata(csc.get)
else:
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT.uint8)
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT)
proc addElectraMessageHandlers(
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
@ -1521,7 +1521,7 @@ proc tryReconstructingDataColumns* (self: BeaconNode,
storedColumns: seq[ColumnIndex]
# Loading the data columns from the database
for custody_column in custodiedColumnIndices.get:
for custody_column in custodiedColumnIndices:
let data_column = DataColumnSidecar.new()
if not db.getDataColumnSidecar(root, custody_column, data_column[]):
columnsOk = false
@ -1542,7 +1542,7 @@ proc tryReconstructingDataColumns* (self: BeaconNode,
let reconstructedDataColumns = get_data_column_sidecars(signed_block, recovered_cps.get)
for data_column in reconstructedDataColumns.get:
if data_column.index notin custodiedColumnIndices.get:
if data_column.index notin custodiedColumnIndices:
continue
finalisedDataColumns.add(data_column)

View File

@ -77,7 +77,7 @@ type
row_index*: RowIndex
CscBits* = BitArray[DATA_COLUMN_SIDECAR_SUBNET_COUNT]
CscCount* = uint8
CscCount* = uint64
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/_features/eip7594/p2p-interface.md#metadata
MetaData* = object

View File

@ -286,7 +286,7 @@ proc getDataColumnSidecars[A, B](man: SyncManager[A, B], peer: A,
let
remoteNodeId = getNodeIdFromPeer(peer)
remoteCustodyColumns =
remoteNodeId.get_custody_column_list(remoteCustodySubnetCount).get
remoteNodeId.get_custody_column_list(remoteCustodySubnetCount)
doAssert(not(req.isEmpty()), "Request must not be empty!")
debug "Requesting data column sidecars from peer", request = req