adds peerdas-supernode flag (#6764)

* adds peerdas-supernode flag instead of launching a peerdas supernode in subscribeAllSubnets

* make the flag default and _hidden_

* fix indentation
This commit is contained in:
Agnish Ghosh 2024-12-17 05:44:39 +05:30 committed by GitHub
parent ed6669bae4
commit eb1e809a54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 9 deletions

View File

@ -253,6 +253,12 @@ type
desc: "Subscribe to all subnet topics when gossiping" desc: "Subscribe to all subnet topics when gossiping"
name: "subscribe-all-subnets" .}: bool name: "subscribe-all-subnets" .}: bool
peerdasSupernode* {.
hidden
defaultValue: false,
desc: "Subscribe to all column subnets, thereby becoming a peerdas supernode"
name: "debug-peerdas-supernode" .}: bool
slashingDbKind* {. slashingDbKind* {.
hidden hidden
defaultValue: SlashingDbKind.v2 defaultValue: SlashingDbKind.v2

View File

@ -416,7 +416,7 @@ proc initFullNode(
onElectraAttesterSlashingAdded)) onElectraAttesterSlashingAdded))
blobQuarantine = newClone(BlobQuarantine.init(onBlobSidecarAdded)) blobQuarantine = newClone(BlobQuarantine.init(onBlobSidecarAdded))
dataColumnQuarantine = newClone(DataColumnQuarantine.init()) dataColumnQuarantine = newClone(DataColumnQuarantine.init())
supernode = node.config.subscribeAllSubnets supernode = node.config.peerdasSupernode
localCustodySubnets = localCustodySubnets =
if supernode: if supernode:
DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint64 DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint64
@ -564,7 +564,7 @@ proc initFullNode(
node.network.nodeId.get_custody_columns(max(SAMPLES_PER_SLOT.uint64, node.network.nodeId.get_custody_columns(max(SAMPLES_PER_SLOT.uint64,
localCustodySubnets)) localCustodySubnets))
if node.config.subscribeAllSubnets: if node.config.peerdasSupernode:
node.network.loadCscnetMetadataAndEnr(DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint8) node.network.loadCscnetMetadataAndEnr(DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint8)
else: else:
node.network.loadCscnetMetadataAndEnr(CUSTODY_REQUIREMENT.uint8) node.network.loadCscnetMetadataAndEnr(CUSTODY_REQUIREMENT.uint8)

View File

@ -24,7 +24,7 @@ type
CellBytes = array[fulu.CELLS_PER_EXT_BLOB, Cell] CellBytes = array[fulu.CELLS_PER_EXT_BLOB, Cell]
ProofBytes = array[fulu.CELLS_PER_EXT_BLOB, KzgProof] ProofBytes = array[fulu.CELLS_PER_EXT_BLOB, KzgProof]
func sortedColumnIndices*(columnsPerSubnet: ColumnIndex, func sortedColumnIndices(columnsPerSubnet: ColumnIndex,
subnetIds: HashSet[uint64]): subnetIds: HashSet[uint64]):
seq[ColumnIndex] = seq[ColumnIndex] =
var res: seq[ColumnIndex] = @[] var res: seq[ColumnIndex] = @[]
@ -35,7 +35,7 @@ func sortedColumnIndices*(columnsPerSubnet: ColumnIndex,
res.sort res.sort
res res
func sortedColumnIndexList*(columnsPerSubnet: ColumnIndex, func sortedColumnIndexList(columnsPerSubnet: ColumnIndex,
subnetIds: HashSet[uint64]): subnetIds: HashSet[uint64]):
List[ColumnIndex, NUMBER_OF_COLUMNS] = List[ColumnIndex, NUMBER_OF_COLUMNS] =
var var

View File

@ -10,7 +10,6 @@
# Uncategorized helper functions from the spec # Uncategorized helper functions from the spec
import import
std/sequtils,
# Status libraries # Status libraries
stew/[byteutils, endians2, objects], stew/[byteutils, endians2, objects],
nimcrypto/sha2, nimcrypto/sha2,
@ -543,6 +542,7 @@ proc compute_execution_block_hash*(blck: ForkyBeaconBlock): Eth2Digest =
rlpHash(blockToBlockHeader(blck)).to(Eth2Digest) rlpHash(blockToBlockHeader(blck)).to(Eth2Digest)
from std/math import exp, ln from std/math import exp, ln
from std/sequtils import foldl
func ln_binomial(n, k: int): float64 = func ln_binomial(n, k: int): float64 =
if k > n: if k > n: