fix every place to make new custody column function work
This commit is contained in:
parent
7d04142e4a
commit
4a006b5584
|
@ -12,7 +12,7 @@ import
|
||||||
stew/results,
|
stew/results,
|
||||||
chronicles, chronos, metrics, taskpools,
|
chronicles, chronos, metrics, taskpools,
|
||||||
../networking/eth2_network,
|
../networking/eth2_network,
|
||||||
../spec/[helpers, forks, eip7594_helpers],
|
../spec/[helpers, forks],
|
||||||
../spec/datatypes/[altair, phase0, deneb, eip7594],
|
../spec/datatypes/[altair, phase0, deneb, eip7594],
|
||||||
../consensus_object_pools/[
|
../consensus_object_pools/[
|
||||||
blob_quarantine, block_clearance, block_quarantine, blockchain_dag,
|
blob_quarantine, block_clearance, block_quarantine, blockchain_dag,
|
||||||
|
|
|
@ -1151,7 +1151,7 @@ proc addDenebMessageHandlers(
|
||||||
node.addCapellaMessageHandlers(forkDigest, slot)
|
node.addCapellaMessageHandlers(forkDigest, slot)
|
||||||
let
|
let
|
||||||
targetSubnets = node.fetchCustodySubnetCount()
|
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 "Target Subnets"
|
||||||
debugEcho targetSubnets
|
debugEcho targetSubnets
|
||||||
|
@ -1167,13 +1167,13 @@ proc addDenebMessageHandlers(
|
||||||
node.network.subscribe(topic, basicParams)
|
node.network.subscribe(topic, basicParams)
|
||||||
|
|
||||||
if node.config.subscribeAllSubnets:
|
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:
|
elif not node.config.subscribeAllSubnets:
|
||||||
let csc = node.config.custodySubnetCount
|
let csc = node.config.custodySubnetCount
|
||||||
if csc.isSome and csc.get < DATA_COLUMN_SIDECAR_SUBNET_COUNT:
|
if csc.isSome and csc.get < DATA_COLUMN_SIDECAR_SUBNET_COUNT:
|
||||||
node.network.loadCscnetsMetadata(csc.get.uint8)
|
node.network.loadCscnetsMetadata(csc.get)
|
||||||
else:
|
else:
|
||||||
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT.uint8)
|
node.network.loadCscnetsMetadata(CUSTODY_REQUIREMENT)
|
||||||
|
|
||||||
proc addElectraMessageHandlers(
|
proc addElectraMessageHandlers(
|
||||||
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
|
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
|
||||||
|
@ -1521,7 +1521,7 @@ proc tryReconstructingDataColumns* (self: BeaconNode,
|
||||||
storedColumns: seq[ColumnIndex]
|
storedColumns: seq[ColumnIndex]
|
||||||
|
|
||||||
# Loading the data columns from the database
|
# Loading the data columns from the database
|
||||||
for custody_column in custodiedColumnIndices.get:
|
for custody_column in custodiedColumnIndices:
|
||||||
let data_column = DataColumnSidecar.new()
|
let data_column = DataColumnSidecar.new()
|
||||||
if not db.getDataColumnSidecar(root, custody_column, data_column[]):
|
if not db.getDataColumnSidecar(root, custody_column, data_column[]):
|
||||||
columnsOk = false
|
columnsOk = false
|
||||||
|
@ -1542,7 +1542,7 @@ proc tryReconstructingDataColumns* (self: BeaconNode,
|
||||||
let reconstructedDataColumns = get_data_column_sidecars(signed_block, recovered_cps.get)
|
let reconstructedDataColumns = get_data_column_sidecars(signed_block, recovered_cps.get)
|
||||||
|
|
||||||
for data_column in reconstructedDataColumns.get:
|
for data_column in reconstructedDataColumns.get:
|
||||||
if data_column.index notin custodiedColumnIndices.get:
|
if data_column.index notin custodiedColumnIndices:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
finalisedDataColumns.add(data_column)
|
finalisedDataColumns.add(data_column)
|
||||||
|
|
|
@ -77,7 +77,7 @@ type
|
||||||
row_index*: RowIndex
|
row_index*: RowIndex
|
||||||
|
|
||||||
CscBits* = BitArray[DATA_COLUMN_SIDECAR_SUBNET_COUNT]
|
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
|
# https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/_features/eip7594/p2p-interface.md#metadata
|
||||||
MetaData* = object
|
MetaData* = object
|
||||||
|
|
|
@ -286,7 +286,7 @@ proc getDataColumnSidecars[A, B](man: SyncManager[A, B], peer: A,
|
||||||
let
|
let
|
||||||
remoteNodeId = getNodeIdFromPeer(peer)
|
remoteNodeId = getNodeIdFromPeer(peer)
|
||||||
remoteCustodyColumns =
|
remoteCustodyColumns =
|
||||||
remoteNodeId.get_custody_column_list(remoteCustodySubnetCount).get
|
remoteNodeId.get_custody_column_list(remoteCustodySubnetCount)
|
||||||
|
|
||||||
doAssert(not(req.isEmpty()), "Request must not be empty!")
|
doAssert(not(req.isEmpty()), "Request must not be empty!")
|
||||||
debug "Requesting data column sidecars from peer", request = req
|
debug "Requesting data column sidecars from peer", request = req
|
||||||
|
|
Loading…
Reference in New Issue