Skip to content

Commit eb1e809

Browse files
authored
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
1 parent ed6669b commit eb1e809

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

beacon_chain/conf.nim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,12 @@ type
253253
desc: "Subscribe to all subnet topics when gossiping"
254254
name: "subscribe-all-subnets" .}: bool
255255

256+
peerdasSupernode* {.
257+
hidden
258+
defaultValue: false,
259+
desc: "Subscribe to all column subnets, thereby becoming a peerdas supernode"
260+
name: "debug-peerdas-supernode" .}: bool
261+
256262
slashingDbKind* {.
257263
hidden
258264
defaultValue: SlashingDbKind.v2

beacon_chain/nimbus_beacon_node.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ proc initFullNode(
416416
onElectraAttesterSlashingAdded))
417417
blobQuarantine = newClone(BlobQuarantine.init(onBlobSidecarAdded))
418418
dataColumnQuarantine = newClone(DataColumnQuarantine.init())
419-
supernode = node.config.subscribeAllSubnets
419+
supernode = node.config.peerdasSupernode
420420
localCustodySubnets =
421421
if supernode:
422422
DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint64
@@ -564,7 +564,7 @@ proc initFullNode(
564564
node.network.nodeId.get_custody_columns(max(SAMPLES_PER_SLOT.uint64,
565565
localCustodySubnets))
566566

567-
if node.config.subscribeAllSubnets:
567+
if node.config.peerdasSupernode:
568568
node.network.loadCscnetMetadataAndEnr(DATA_COLUMN_SIDECAR_SUBNET_COUNT.uint8)
569569
else:
570570
node.network.loadCscnetMetadataAndEnr(CUSTODY_REQUIREMENT.uint8)

beacon_chain/spec/eip7594_helpers.nim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ type
2424
CellBytes = array[fulu.CELLS_PER_EXT_BLOB, Cell]
2525
ProofBytes = array[fulu.CELLS_PER_EXT_BLOB, KzgProof]
2626

27-
func sortedColumnIndices*(columnsPerSubnet: ColumnIndex,
28-
subnetIds: HashSet[uint64]):
29-
seq[ColumnIndex] =
27+
func sortedColumnIndices(columnsPerSubnet: ColumnIndex,
28+
subnetIds: HashSet[uint64]):
29+
seq[ColumnIndex] =
3030
var res: seq[ColumnIndex] = @[]
3131
for i in 0'u64 ..< columnsPerSubnet:
3232
for subnetId in subnetIds:
@@ -35,9 +35,9 @@ func sortedColumnIndices*(columnsPerSubnet: ColumnIndex,
3535
res.sort
3636
res
3737

38-
func sortedColumnIndexList*(columnsPerSubnet: ColumnIndex,
39-
subnetIds: HashSet[uint64]):
40-
List[ColumnIndex, NUMBER_OF_COLUMNS] =
38+
func sortedColumnIndexList(columnsPerSubnet: ColumnIndex,
39+
subnetIds: HashSet[uint64]):
40+
List[ColumnIndex, NUMBER_OF_COLUMNS] =
4141
var
4242
res: seq[ColumnIndex]
4343
for i in 0'u64 ..< columnsPerSubnet:

beacon_chain/spec/helpers.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
# Uncategorized helper functions from the spec
1111

1212
import
13-
std/sequtils,
1413
# Status libraries
1514
stew/[byteutils, endians2, objects],
1615
nimcrypto/sha2,
@@ -543,6 +542,7 @@ proc compute_execution_block_hash*(blck: ForkyBeaconBlock): Eth2Digest =
543542
rlpHash(blockToBlockHeader(blck)).to(Eth2Digest)
544543

545544
from std/math import exp, ln
545+
from std/sequtils import foldl
546546

547547
func ln_binomial(n, k: int): float64 =
548548
if k > n:

0 commit comments

Comments
 (0)