Skip to content

Commit 370f3e0

Browse files
committed
schedule Fulu on Sepolia, Holesky, and Hoodi
1 parent db0b950 commit 370f3e0

File tree

6 files changed

+37
-10
lines changed

6 files changed

+37
-10
lines changed

beacon_chain/networking/network_metadata.nim

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
66
# at your option. This file may not be copied, modified, or distributed except according to those terms.
77

8-
{.push raises: [].}
8+
{.push raises: [], gcsafe.}
99

1010
import
1111
std/os,
@@ -327,11 +327,14 @@ elif const_preset == "mainnet":
327327
for network in [
328328
mainnetMetadata, sepoliaMetadata, holeskyMetadata, hoodiMetadata]:
329329
checkForkConsistency(network.cfg)
330-
doAssert network.cfg.ELECTRA_FORK_EPOCH < FAR_FUTURE_EPOCH
331-
doAssert network.cfg.FULU_FORK_EPOCH == FAR_FUTURE_EPOCH
332330
doAssert network.cfg.GLOAS_FORK_EPOCH == FAR_FUTURE_EPOCH
333331
doAssert ConsensusFork.high == ConsensusFork.Gloas
334332

333+
doAssert mainnetMetadata.cfg.FULU_FORK_EPOCH == FAR_FUTURE_EPOCH
334+
for network in [sepoliaMetadata, holeskyMetadata, hoodiMetadata]:
335+
doAssert network.cfg.FULU_FORK_EPOCH < FAR_FUTURE_EPOCH
336+
doAssert network.cfg.BLOB_SCHEDULE.len == 2
337+
335338
proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
336339
template loadRuntimeMetadata(): auto =
337340
if fileExists(networkName / "config.yaml"):

beacon_chain/spec/peerdas_helpers.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import
2222

2323
from std/algorithm import sort
2424
from std/sequtils import toSeq
25-
from stew/staticfor import staticfor
25+
from stew/staticfor import staticFor
2626

2727
type
2828
CellBytes = array[fulu.CELLS_PER_EXT_BLOB, Cell]

beacon_chain/spec/presets.nim

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
{.push raises: [], gcsafe.}
99

1010
import
11-
std/[strutils, parseutils, tables, typetraits],
11+
std/[parseutils, tables, typetraits],
1212
chronos/timer,
1313
stew/[byteutils], stint, eth/common/addresses as eth,
1414
./datatypes/constants
1515

1616
from std/algorithm import sort
17+
from std/strutils import split, splitLines, startsWith, strip, `%`
1718

1819
export constants
19-
2020
export stint, eth
2121

2222
const
@@ -40,6 +40,20 @@ const
4040
MAX_SUPPORTED_BLOBS_PER_BLOCK*: uint64 = 9 # revisit getShortMap(Blobs) if >9
4141
MAX_SUPPORTED_REQUEST_BLOB_SIDECARS*: uint64 = 1152
4242

43+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/phase0/beacon-chain.md#time-parameters-1
44+
SLOT_DURATION_MS: uint64 = 12000
45+
46+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/phase0/validator.md#time-parameters
47+
ATTESTATION_DUE_BPS: uint64 = 3333
48+
AGGREGATE_DUE_BPS: uint64 = 6667
49+
50+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/altair/validator.md#time-parameters
51+
SYNC_MESSAGE_DUE_BPS: uint64 = 3333
52+
CONTRIBUTION_DUE_BPS: uint64 = 6667
53+
54+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/phase0/fork-choice.md#time-parameters
55+
PROPOSER_REORG_CUTOFF_BPS: uint64 = 1667
56+
4357
type
4458
TimeConfig* = object
4559
SECONDS_PER_SLOT*: uint64
@@ -164,11 +178,13 @@ type
164178
const
165179
const_preset* {.strdefine.} = "mainnet"
166180

167-
# No-longer used values from legacy config files
181+
# No-longer used values from legacy config files, or quirks of BPO parsing
168182
ignoredValues = [
169183
"TRANSITION_TOTAL_DIFFICULTY", # Name that appears in some altair alphas, obsolete, remove when no more testnets
170184
"MIN_ANCHOR_POW_BLOCK_DIFFICULTY", # Name that appears in some altair alphas, obsolete, remove when no more testnets
171185
"RANDOM_SUBNETS_PER_VALIDATOR", # Removed in consensus-specs v1.4.0
186+
" MAX_BLOBS_PER_BLOCK", # parsed separately
187+
" - EPOCH", # parsed separately
172188
]
173189

174190
when const_preset == "mainnet":
@@ -809,6 +825,7 @@ proc readRuntimeConfig*(
809825
if lineParts[0] in ignoredValues: continue
810826

811827
values[lineParts[0]] = lineParts[1].strip
828+
812829
# Accumulate BLOB_SCHEDULE entries
813830
var
814831
blobScheduleEntries: seq[BlobParameters]
@@ -992,6 +1009,13 @@ proc readRuntimeConfig*(
9921009
checkCompatibility REORG_PARENT_WEIGHT_THRESHOLD
9931010
checkCompatibility REORG_MAX_EPOCHS_SINCE_FINALIZATION
9941011

1012+
checkCompatibility SLOT_DURATION_MS
1013+
checkCompatibility ATTESTATION_DUE_BPS
1014+
checkCompatibility AGGREGATE_DUE_BPS
1015+
checkCompatibility SYNC_MESSAGE_DUE_BPS
1016+
checkCompatibility CONTRIBUTION_DUE_BPS
1017+
checkCompatibility PROPOSER_REORG_CUTOFF_BPS
1018+
9951019
template assignValue(name: static string, field: untyped): untyped =
9961020
if values.hasKey(name):
9971021
when field is seq[BlobParameters]:

0 commit comments

Comments
 (0)