Skip to content

Commit b118196

Browse files
tersecsiddarthkay
authored andcommitted
schedule Fulu on Sepolia, Holesky, and Hoodi (#7529)
1 parent 6dad700 commit b118196

File tree

6 files changed

+37
-10
lines changed

6 files changed

+37
-10
lines changed

beacon_chain/networking/network_metadata.nim

Lines changed: 8 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,16 @@ 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+
doAssert mainnetMetadata.cfg.BLOB_SCHEDULE.len == 0
335+
336+
for network in [sepoliaMetadata, holeskyMetadata, hoodiMetadata]:
337+
doAssert network.cfg.FULU_FORK_EPOCH < FAR_FUTURE_EPOCH
338+
doAssert network.cfg.BLOB_SCHEDULE.len == 2
339+
335340
proc getMetadataForNetwork*(networkName: string): Eth2NetworkMetadata =
336341
template loadRuntimeMetadata(): auto =
337342
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: 25 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,17 @@ 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/validator.md#time-parameters
44+
ATTESTATION_DUE_BPS: uint64 = 3333
45+
AGGREGATE_DUE_BPS: uint64 = 6667
46+
47+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/altair/validator.md#time-parameters
48+
SYNC_MESSAGE_DUE_BPS: uint64 = 3333
49+
CONTRIBUTION_DUE_BPS: uint64 = 6667
50+
51+
# https://github.com/ethereum/consensus-specs/blob/v1.6.0-beta.0/specs/phase0/fork-choice.md#time-parameters
52+
PROPOSER_REORG_CUTOFF_BPS: uint64 = 1667
53+
4354
type
4455
TimeConfig* = object
4556
SECONDS_PER_SLOT*: uint64
@@ -164,11 +175,13 @@ type
164175
const
165176
const_preset* {.strdefine.} = "mainnet"
166177

167-
# No-longer used values from legacy config files
178+
# No-longer used values from legacy config files, or quirks of BPO parsing
168179
ignoredValues = [
169180
"TRANSITION_TOTAL_DIFFICULTY", # Name that appears in some altair alphas, obsolete, remove when no more testnets
170181
"MIN_ANCHOR_POW_BLOCK_DIFFICULTY", # Name that appears in some altair alphas, obsolete, remove when no more testnets
171182
"RANDOM_SUBNETS_PER_VALIDATOR", # Removed in consensus-specs v1.4.0
183+
" MAX_BLOBS_PER_BLOCK", # parsed separately
184+
" - EPOCH", # parsed separately
172185
]
173186

174187
when const_preset == "mainnet":
@@ -719,6 +732,7 @@ else:
719732
const
720733
MIN_SECONDS_PER_SLOT* = 1'u64
721734
MAX_SECONDS_PER_SLOT* = int64.high.uint64 div 1_000_000_000'u64
735+
SLOT_DURATION_MS = SECONDS_PER_SLOT * 1000
722736

723737
const SLOTS_PER_SYNC_COMMITTEE_PERIOD* =
724738
SLOTS_PER_EPOCH * EPOCHS_PER_SYNC_COMMITTEE_PERIOD
@@ -809,6 +823,7 @@ proc readRuntimeConfig*(
809823
if lineParts[0] in ignoredValues: continue
810824

811825
values[lineParts[0]] = lineParts[1].strip
826+
812827
# Accumulate BLOB_SCHEDULE entries
813828
var
814829
blobScheduleEntries: seq[BlobParameters]
@@ -992,6 +1007,13 @@ proc readRuntimeConfig*(
9921007
checkCompatibility REORG_PARENT_WEIGHT_THRESHOLD
9931008
checkCompatibility REORG_MAX_EPOCHS_SINCE_FINALIZATION
9941009

1010+
checkCompatibility SLOT_DURATION_MS
1011+
checkCompatibility ATTESTATION_DUE_BPS
1012+
checkCompatibility AGGREGATE_DUE_BPS
1013+
checkCompatibility SYNC_MESSAGE_DUE_BPS
1014+
checkCompatibility CONTRIBUTION_DUE_BPS
1015+
checkCompatibility PROPOSER_REORG_CUTOFF_BPS
1016+
9951017
template assignValue(name: static string, field: untyped): untyped =
9961018
if values.hasKey(name):
9971019
when field is seq[BlobParameters]:

0 commit comments

Comments
 (0)