Capella metadata for Sepolia (#4615)

Other changes:

Renamed the `EIP_4844_FORK_*` config constants to `DENEB_FORK_*` as
this matches the latest spec and it's already used in the official
Sepolia config.
This commit is contained in:
zah 2023-02-15 16:44:09 +02:00 committed by GitHub
parent b7c3037f01
commit 067ba13c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 109 additions and 94 deletions

View File

@ -527,7 +527,8 @@ proc new*(T: type BeaconChainDB,
else: else:
"", "",
eip4844Headers: eip4844Headers:
if cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH: if cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
# TODO: We should probably rename this to match the official fork name
"lc_eip4844_headers" "lc_eip4844_headers"
else: else:
"", "",
@ -539,7 +540,7 @@ proc new*(T: type BeaconChainDB,
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844 static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
var blobs : KvStoreRef var blobs : KvStoreRef
if cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH: if cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
blobs = kvStore db.openKvStore("eip4844_blobs").expectDb() blobs = kvStore db.openKvStore("eip4844_blobs").expectDb()
# Versions prior to 1.4.0 (altair) stored validators in `immutable_validators` # Versions prior to 1.4.0 (altair) stored validators in `immutable_validators`

View File

@ -1067,7 +1067,7 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
of ConsensusFork.Altair: altairFork(cfg) of ConsensusFork.Altair: altairFork(cfg)
of ConsensusFork.Bellatrix: bellatrixFork(cfg) of ConsensusFork.Bellatrix: bellatrixFork(cfg)
of ConsensusFork.Capella: capellaFork(cfg) of ConsensusFork.Capella: capellaFork(cfg)
of ConsensusFork.EIP4844: eip4844Fork(cfg) of ConsensusFork.EIP4844: denebFork(cfg)
stateFork = getStateField(dag.headState, fork) stateFork = getStateField(dag.headState, fork)
if stateFork != configFork: if stateFork != configFork:

View File

@ -380,7 +380,7 @@ proc updateGossipStatus*(
currentEpochTargetGossipState = getTargetGossipState( currentEpochTargetGossipState = getTargetGossipState(
epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH, epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH,
cfg.CAPELLA_FORK_EPOCH, cfg.EIP4844_FORK_EPOCH, isBehind) cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, isBehind)
targetGossipState = targetGossipState =
if lcBehind or epoch < 1: if lcBehind or epoch < 1:
currentEpochTargetGossipState currentEpochTargetGossipState
@ -390,7 +390,7 @@ proc updateGossipStatus*(
# Therefore, LC topic subscriptions are kept for 1 extra epoch. # Therefore, LC topic subscriptions are kept for 1 extra epoch.
let previousEpochTargetGossipState = getTargetGossipState( let previousEpochTargetGossipState = getTargetGossipState(
epoch - 1, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH, epoch - 1, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH,
cfg.CAPELLA_FORK_EPOCH, cfg.EIP4844_FORK_EPOCH, isBehind) cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, isBehind)
currentEpochTargetGossipState + previousEpochTargetGossipState currentEpochTargetGossipState + previousEpochTargetGossipState
template currentGossipState(): auto = lightClient.gossipState template currentGossipState(): auto = lightClient.gossipState

View File

@ -217,7 +217,7 @@ when const_preset == "gnosis":
static: static:
checkForkConsistency(gnosisMetadata.cfg) checkForkConsistency(gnosisMetadata.cfg)
doAssert gnosisMetadata.cfg.CAPELLA_FORK_EPOCH == FAR_FUTURE_EPOCH doAssert gnosisMetadata.cfg.CAPELLA_FORK_EPOCH == FAR_FUTURE_EPOCH
doAssert gnosisMetadata.cfg.EIP4844_FORK_EPOCH == FAR_FUTURE_EPOCH doAssert gnosisMetadata.cfg.DENEB_FORK_EPOCH == FAR_FUTURE_EPOCH
elif const_preset == "mainnet": elif const_preset == "mainnet":
const const
@ -225,11 +225,12 @@ elif const_preset == "mainnet":
praterMetadata* = eth2Network("shared/prater", goerli) praterMetadata* = eth2Network("shared/prater", goerli)
sepoliaMetadata* = mergeTestnet("sepolia", sepolia) sepoliaMetadata* = mergeTestnet("sepolia", sepolia)
static: static:
for network in [ for network in [mainnetMetadata, praterMetadata, sepoliaMetadata]:
mainnetMetadata, praterMetadata, sepoliaMetadata]:
checkForkConsistency(network.cfg) checkForkConsistency(network.cfg)
for network in [mainnetMetadata, praterMetadata]:
doAssert network.cfg.CAPELLA_FORK_EPOCH == FAR_FUTURE_EPOCH doAssert network.cfg.CAPELLA_FORK_EPOCH == FAR_FUTURE_EPOCH
doAssert network.cfg.EIP4844_FORK_EPOCH == FAR_FUTURE_EPOCH doAssert network.cfg.DENEB_FORK_EPOCH == FAR_FUTURE_EPOCH
proc getMetadataForNetwork*( proc getMetadataForNetwork*(
networkName: string): Eth2NetworkMetadata {.raises: [Defect, IOError].} = networkName: string): Eth2NetworkMetadata {.raises: [Defect, IOError].} =

View File

@ -350,11 +350,11 @@ proc initFullNode(
validatorChangePool, node.attachedValidators, syncCommitteeMsgPool, validatorChangePool, node.attachedValidators, syncCommitteeMsgPool,
lightClientPool, quarantine, rng, getBeaconTime, taskpool) lightClientPool, quarantine, rng, getBeaconTime, taskpool)
syncManager = newSyncManager[Peer, PeerId]( syncManager = newSyncManager[Peer, PeerId](
node.network.peerPool, dag.cfg.EIP4844_FORK_EPOCH, SyncQueueKind.Forward, getLocalHeadSlot, node.network.peerPool, dag.cfg.DENEB_FORK_EPOCH, SyncQueueKind.Forward, getLocalHeadSlot,
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot, getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
getFrontfillSlot, dag.tail.slot, blockVerifier, blockBlobsVerifier) getFrontfillSlot, dag.tail.slot, blockVerifier, blockBlobsVerifier)
backfiller = newSyncManager[Peer, PeerId]( backfiller = newSyncManager[Peer, PeerId](
node.network.peerPool, dag.cfg.EIP4844_FORK_EPOCH, SyncQueueKind.Backward, getLocalHeadSlot, node.network.peerPool, dag.cfg.DENEB_FORK_EPOCH, SyncQueueKind.Backward, getLocalHeadSlot,
getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot, getLocalWallSlot, getFirstSlotAtFinalizedEpoch, getBackfillSlot,
getFrontfillSlot, dag.backfill.slot, blockVerifier, blockBlobsVerifier, getFrontfillSlot, dag.backfill.slot, blockVerifier, blockBlobsVerifier,
maxHeadAge = 0) maxHeadAge = 0)
@ -392,7 +392,7 @@ proc initFullNode(
node.blockProcessor = blockProcessor node.blockProcessor = blockProcessor
node.consensusManager = consensusManager node.consensusManager = consensusManager
node.requestManager = RequestManager.init(node.network, node.requestManager = RequestManager.init(node.network,
dag.cfg.EIP4844_FORK_EPOCH, dag.cfg.DENEB_FORK_EPOCH,
getBeaconTime, getBeaconTime,
blockVerifier, blockBlobsVerifier) blockVerifier, blockBlobsVerifier)
node.syncManager = syncManager node.syncManager = syncManager
@ -787,7 +787,7 @@ proc updateBlocksGossipStatus*(
targetGossipState = getTargetGossipState( targetGossipState = getTargetGossipState(
slot.epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH, slot.epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH,
cfg.CAPELLA_FORK_EPOCH, cfg.EIP4844_FORK_EPOCH, isBehind) cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, isBehind)
template currentGossipState(): auto = node.blocksGossipState template currentGossipState(): auto = node.blocksGossipState
if currentGossipState == targetGossipState: if currentGossipState == targetGossipState:
@ -1019,7 +1019,7 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} =
node.dag.cfg.ALTAIR_FORK_EPOCH, node.dag.cfg.ALTAIR_FORK_EPOCH,
node.dag.cfg.BELLATRIX_FORK_EPOCH, node.dag.cfg.BELLATRIX_FORK_EPOCH,
node.dag.cfg.CAPELLA_FORK_EPOCH, node.dag.cfg.CAPELLA_FORK_EPOCH,
node.dag.cfg.EIP4844_FORK_EPOCH, node.dag.cfg.DENEB_FORK_EPOCH,
isBehind) isBehind)
doAssert targetGossipState.card <= 2 doAssert targetGossipState.card <= 2
@ -1444,7 +1444,7 @@ proc installMessageValidators(node: BeaconNode) =
installPhase0Validators(forkDigests.altair) installPhase0Validators(forkDigests.altair)
installPhase0Validators(forkDigests.bellatrix) installPhase0Validators(forkDigests.bellatrix)
installPhase0Validators(forkDigests.capella) installPhase0Validators(forkDigests.capella)
if node.dag.cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH: if node.dag.cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
installPhase0Validators(forkDigests.eip4844) installPhase0Validators(forkDigests.eip4844)
node.network.addValidator( node.network.addValidator(
@ -1477,7 +1477,7 @@ proc installMessageValidators(node: BeaconNode) =
toValidationResult(node.processor[].processSignedBeaconBlock( toValidationResult(node.processor[].processSignedBeaconBlock(
MsgSource.gossip, signedBlock))) MsgSource.gossip, signedBlock)))
if node.dag.cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH: if node.dag.cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
node.network.addValidator( node.network.addValidator(
getBeaconBlockAndBlobsSidecarTopic(forkDigests.eip4844), getBeaconBlockAndBlobsSidecarTopic(forkDigests.eip4844),
proc ( proc (
@ -1537,7 +1537,7 @@ proc installMessageValidators(node: BeaconNode) =
installSyncCommitteeeValidators(forkDigests.altair) installSyncCommitteeeValidators(forkDigests.altair)
installSyncCommitteeeValidators(forkDigests.bellatrix) installSyncCommitteeeValidators(forkDigests.bellatrix)
installSyncCommitteeeValidators(forkDigests.capella) installSyncCommitteeeValidators(forkDigests.capella)
if node.dag.cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH: if node.dag.cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
installSyncCommitteeeValidators(forkDigests.eip4844) installSyncCommitteeeValidators(forkDigests.eip4844)
template installBlsToExecutionChangeValidators(digest: auto) = template installBlsToExecutionChangeValidators(digest: auto) =
@ -1548,7 +1548,7 @@ proc installMessageValidators(node: BeaconNode) =
node.processor[].processBlsToExecutionChange(MsgSource.gossip, msg))) node.processor[].processBlsToExecutionChange(MsgSource.gossip, msg)))
installBlsToExecutionChangeValidators(forkDigests.capella) installBlsToExecutionChangeValidators(forkDigests.capella)
if node.dag.cfg.EIP4844_FORK_EPOCH != FAR_FUTURE_EPOCH: if node.dag.cfg.DENEB_FORK_EPOCH != FAR_FUTURE_EPOCH:
installBlsToExecutionChangeValidators(forkDigests.eip4844) installBlsToExecutionChangeValidators(forkDigests.eip4844)
node.installLightClientMessageValidators() node.installLightClientMessageValidators()

View File

@ -239,7 +239,7 @@ programMain:
targetGossipState = getTargetGossipState( targetGossipState = getTargetGossipState(
slot.epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH, slot.epoch, cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH,
cfg.CAPELLA_FORK_EPOCH, cfg.EIP4844_FORK_EPOCH, isBehind) cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH, isBehind)
template currentGossipState(): auto = blocksGossipState template currentGossipState(): auto = blocksGossipState
if currentGossipState == targetGossipState: if currentGossipState == targetGossipState:

View File

@ -153,6 +153,10 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
"0x" & $cfg.CAPELLA_FORK_VERSION, "0x" & $cfg.CAPELLA_FORK_VERSION,
CAPELLA_FORK_EPOCH: CAPELLA_FORK_EPOCH:
Base10.toString(uint64(cfg.CAPELLA_FORK_EPOCH)), Base10.toString(uint64(cfg.CAPELLA_FORK_EPOCH)),
DENEB_FORK_VERSION:
"0x" & $cfg.DENEB_FORK_VERSION,
DENEB_FORK_EPOCH:
Base10.toString(uint64(cfg.DENEB_FORK_EPOCH)),
SECONDS_PER_SLOT: SECONDS_PER_SLOT:
Base10.toString(SECONDS_PER_SLOT), Base10.toString(SECONDS_PER_SLOT),
SECONDS_PER_ETH1_BLOCK: SECONDS_PER_ETH1_BLOCK:
@ -272,8 +276,6 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
"/eth/v1/config/spec") do () -> RestApiResponse: "/eth/v1/config/spec") do () -> RestApiResponse:
return RestApiResponse.response(cachedConfigSpec, Http200, return RestApiResponse.response(cachedConfigSpec, Http200,
"application/json") "application/json")
# EIP4844_FORK_EPOCH and EIP4844_FORK_VERSION not yet in config
discard $eip4844ImplementationMissing
# https://ethereum.github.io/beacon-APIs/#/Config/getDepositContract # https://ethereum.github.io/beacon-APIs/#/Config/getDepositContract
router.api(MethodGet, router.api(MethodGet,

View File

@ -1145,7 +1145,7 @@ func upgrade_to_eip4844*(cfg: RuntimeConfig, pre: capella.BeaconState):
slot: pre.slot, slot: pre.slot,
fork: Fork( fork: Fork(
previous_version: pre.fork.current_version, previous_version: pre.fork.current_version,
current_version: cfg.EIP4844_FORK_VERSION, # [Modified in EIP4844] current_version: cfg.DENEB_FORK_VERSION, # [Modified in EIP4844]
epoch: epoch epoch: epoch
), ),

View File

@ -985,12 +985,10 @@ const eth1BlockHash* = block:
x x
func checkForkConsistency*(cfg: RuntimeConfig) = func checkForkConsistency*(cfg: RuntimeConfig) =
doAssert cfg.SHARDING_FORK_EPOCH == FAR_FUTURE_EPOCH
let forkVersions = let forkVersions =
[cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_FORK_VERSION, [cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_FORK_VERSION,
cfg.BELLATRIX_FORK_VERSION, cfg.CAPELLA_FORK_VERSION, cfg.BELLATRIX_FORK_VERSION, cfg.CAPELLA_FORK_VERSION,
cfg.EIP4844_FORK_VERSION] cfg.DENEB_FORK_VERSION]
for i in 0 ..< forkVersions.len: for i in 0 ..< forkVersions.len:
for j in i+1 ..< forkVersions.len: for j in i+1 ..< forkVersions.len:
@ -1007,7 +1005,7 @@ func checkForkConsistency*(cfg: RuntimeConfig) =
assertForkEpochOrder(cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH) assertForkEpochOrder(cfg.ALTAIR_FORK_EPOCH, cfg.BELLATRIX_FORK_EPOCH)
assertForkEpochOrder(cfg.BELLATRIX_FORK_EPOCH, cfg.CAPELLA_FORK_EPOCH) assertForkEpochOrder(cfg.BELLATRIX_FORK_EPOCH, cfg.CAPELLA_FORK_EPOCH)
assertForkEpochOrder(cfg.CAPELLA_FORK_EPOCH, cfg.EIP4844_FORK_EPOCH) assertForkEpochOrder(cfg.CAPELLA_FORK_EPOCH, cfg.DENEB_FORK_EPOCH)
# This is a readily/uniquely searchable token of where a false assertion is # This is a readily/uniquely searchable token of where a false assertion is
# due to a Deneb implementation missing. checkForkConsistency() checks that # due to a Deneb implementation missing. checkForkConsistency() checks that

View File

@ -523,7 +523,7 @@ func get_lc_execution_root*(
header: LightClientHeader, cfg: RuntimeConfig): Eth2Digest = header: LightClientHeader, cfg: RuntimeConfig): Eth2Digest =
let epoch = header.beacon.slot.epoch let epoch = header.beacon.slot.epoch
if epoch >= cfg.EIP4844_FORK_EPOCH: if epoch >= cfg.DENEB_FORK_EPOCH:
return hash_tree_root(header.execution) return hash_tree_root(header.execution)
if epoch >= cfg.CAPELLA_FORK_EPOCH: if epoch >= cfg.CAPELLA_FORK_EPOCH:
@ -552,7 +552,7 @@ func is_valid_light_client_header*(
header: LightClientHeader, cfg: RuntimeConfig): bool = header: LightClientHeader, cfg: RuntimeConfig): bool =
let epoch = header.beacon.slot.epoch let epoch = header.beacon.slot.epoch
if epoch < cfg.EIP4844_FORK_EPOCH: if epoch < cfg.DENEB_FORK_EPOCH:
if header.execution.excess_data_gas != 0.u256: if header.execution.excess_data_gas != 0.u256:
return false return false

View File

@ -383,8 +383,8 @@ type
BELLATRIX_FORK_EPOCH*: uint64 BELLATRIX_FORK_EPOCH*: uint64
CAPELLA_FORK_VERSION*: Version CAPELLA_FORK_VERSION*: Version
CAPELLA_FORK_EPOCH*: uint64 CAPELLA_FORK_EPOCH*: uint64
EIP4844_FORK_VERSION*: Version DENEB_FORK_VERSION*: Version
EIP4844_FORK_EPOCH*: uint64 DENEB_FORK_EPOCH*: uint64
SECONDS_PER_SLOT*: uint64 SECONDS_PER_SLOT*: uint64
SECONDS_PER_ETH1_BLOCK*: uint64 SECONDS_PER_ETH1_BLOCK*: uint64
MIN_VALIDATOR_WITHDRAWABILITY_DELAY*: uint64 MIN_VALIDATOR_WITHDRAWABILITY_DELAY*: uint64

View File

@ -648,7 +648,7 @@ func stateForkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): ConsensusFork =
doAssert ConsensusFork.Altair > ConsensusFork.Phase0 doAssert ConsensusFork.Altair > ConsensusFork.Phase0
doAssert GENESIS_EPOCH == 0 doAssert GENESIS_EPOCH == 0
if epoch >= cfg.EIP4844_FORK_EPOCH: ConsensusFork.EIP4844 if epoch >= cfg.DENEB_FORK_EPOCH: ConsensusFork.EIP4844
elif epoch >= cfg.CAPELLA_FORK_EPOCH: ConsensusFork.Capella elif epoch >= cfg.CAPELLA_FORK_EPOCH: ConsensusFork.Capella
elif epoch >= cfg.BELLATRIX_FORK_EPOCH: ConsensusFork.Bellatrix elif epoch >= cfg.BELLATRIX_FORK_EPOCH: ConsensusFork.Bellatrix
elif epoch >= cfg.ALTAIR_FORK_EPOCH: ConsensusFork.Altair elif epoch >= cfg.ALTAIR_FORK_EPOCH: ConsensusFork.Altair
@ -657,7 +657,7 @@ func stateForkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): ConsensusFork =
func blockForkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): ConsensusFork = func blockForkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): ConsensusFork =
## Return the current fork for the given epoch. ## Return the current fork for the given epoch.
static: doAssert high(ConsensusFork) == ConsensusFork.EIP4844 static: doAssert high(ConsensusFork) == ConsensusFork.EIP4844
if epoch >= cfg.EIP4844_FORK_EPOCH: ConsensusFork.EIP4844 if epoch >= cfg.DENEB_FORK_EPOCH: ConsensusFork.EIP4844
elif epoch >= cfg.CAPELLA_FORK_EPOCH: ConsensusFork.Capella elif epoch >= cfg.CAPELLA_FORK_EPOCH: ConsensusFork.Capella
elif epoch >= cfg.BELLATRIX_FORK_EPOCH: ConsensusFork.Bellatrix elif epoch >= cfg.BELLATRIX_FORK_EPOCH: ConsensusFork.Bellatrix
elif epoch >= cfg.ALTAIR_FORK_EPOCH: ConsensusFork.Altair elif epoch >= cfg.ALTAIR_FORK_EPOCH: ConsensusFork.Altair
@ -891,15 +891,15 @@ func capellaFork*(cfg: RuntimeConfig): Fork =
current_version: cfg.CAPELLA_FORK_VERSION, current_version: cfg.CAPELLA_FORK_VERSION,
epoch: cfg.CAPELLA_FORK_EPOCH) epoch: cfg.CAPELLA_FORK_EPOCH)
func eip4844Fork*(cfg: RuntimeConfig): Fork = func denebFork*(cfg: RuntimeConfig): Fork =
Fork( Fork(
previous_version: cfg.CAPELLA_FORK_VERSION, previous_version: cfg.CAPELLA_FORK_VERSION,
current_version: cfg.EIP4844_FORK_VERSION, current_version: cfg.DENEB_FORK_VERSION,
epoch: cfg.EIP4844_FORK_EPOCH) epoch: cfg.DENEB_FORK_EPOCH)
func forkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Fork = func forkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Fork =
case cfg.stateForkAtEpoch(epoch) case cfg.stateForkAtEpoch(epoch)
of ConsensusFork.EIP4844: cfg.eip4844Fork of ConsensusFork.EIP4844: cfg.denebFork
of ConsensusFork.Capella: cfg.capellaFork of ConsensusFork.Capella: cfg.capellaFork
of ConsensusFork.Bellatrix: cfg.bellatrixFork of ConsensusFork.Bellatrix: cfg.bellatrixFork
of ConsensusFork.Altair: cfg.altairFork of ConsensusFork.Altair: cfg.altairFork
@ -907,7 +907,7 @@ func forkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Fork =
func forkVersionAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Version = func forkVersionAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Version =
case cfg.stateForkAtEpoch(epoch) case cfg.stateForkAtEpoch(epoch)
of ConsensusFork.EIP4844: cfg.EIP4844_FORK_VERSION of ConsensusFork.EIP4844: cfg.DENEB_FORK_VERSION
of ConsensusFork.Capella: cfg.CAPELLA_FORK_VERSION of ConsensusFork.Capella: cfg.CAPELLA_FORK_VERSION
of ConsensusFork.Bellatrix: cfg.BELLATRIX_FORK_VERSION of ConsensusFork.Bellatrix: cfg.BELLATRIX_FORK_VERSION
of ConsensusFork.Altair: cfg.ALTAIR_FORK_VERSION of ConsensusFork.Altair: cfg.ALTAIR_FORK_VERSION
@ -916,7 +916,7 @@ func forkVersionAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Version =
func nextForkEpochAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Epoch = func nextForkEpochAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Epoch =
case cfg.stateForkAtEpoch(epoch) case cfg.stateForkAtEpoch(epoch)
of ConsensusFork.EIP4844: FAR_FUTURE_EPOCH of ConsensusFork.EIP4844: FAR_FUTURE_EPOCH
of ConsensusFork.Capella: cfg.EIP4844_FORK_EPOCH of ConsensusFork.Capella: cfg.DENEB_FORK_EPOCH
of ConsensusFork.Bellatrix: cfg.CAPELLA_FORK_EPOCH of ConsensusFork.Bellatrix: cfg.CAPELLA_FORK_EPOCH
of ConsensusFork.Altair: cfg.BELLATRIX_FORK_EPOCH of ConsensusFork.Altair: cfg.BELLATRIX_FORK_EPOCH
of ConsensusFork.Phase0: cfg.ALTAIR_FORK_EPOCH of ConsensusFork.Phase0: cfg.ALTAIR_FORK_EPOCH
@ -927,7 +927,7 @@ func forkVersion*(cfg: RuntimeConfig, consensusFork: ConsensusFork): Version =
of ConsensusFork.Altair: cfg.ALTAIR_FORK_VERSION of ConsensusFork.Altair: cfg.ALTAIR_FORK_VERSION
of ConsensusFork.Bellatrix: cfg.BELLATRIX_FORK_VERSION of ConsensusFork.Bellatrix: cfg.BELLATRIX_FORK_VERSION
of ConsensusFork.Capella: cfg.CAPELLA_FORK_VERSION of ConsensusFork.Capella: cfg.CAPELLA_FORK_VERSION
of ConsensusFork.EIP4844: cfg.EIP4844_FORK_VERSION of ConsensusFork.EIP4844: cfg.DENEB_FORK_VERSION
func lcDataForkAtStateFork*(stateFork: ConsensusFork): LightClientDataFork = func lcDataForkAtStateFork*(stateFork: ConsensusFork): LightClientDataFork =
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844 static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
@ -947,7 +947,7 @@ func getForkSchedule*(cfg: RuntimeConfig): array[5, Fork] =
## ##
## NOTE: Update this procedure when new fork will be scheduled. ## NOTE: Update this procedure when new fork will be scheduled.
[cfg.genesisFork(), cfg.altairFork(), cfg.bellatrixFork(), cfg.capellaFork(), [cfg.genesisFork(), cfg.altairFork(), cfg.bellatrixFork(), cfg.capellaFork(),
cfg.eip4844Fork()] cfg.denebFork()]
type type
# The first few fields of a state, shared across all forks # The first few fields of a state, shared across all forks
@ -1041,7 +1041,7 @@ func init*(T: type ForkDigests,
capella: capella:
compute_fork_digest(cfg.CAPELLA_FORK_VERSION, genesis_validators_root), compute_fork_digest(cfg.CAPELLA_FORK_VERSION, genesis_validators_root),
eip4844: eip4844:
compute_fork_digest(cfg.EIP4844_FORK_VERSION, genesis_validators_root) compute_fork_digest(cfg.DENEB_FORK_VERSION, genesis_validators_root)
) )
func toBlockId*(header: BeaconBlockHeader): BlockId = func toBlockId*(header: BeaconBlockHeader): BlockId =

View File

@ -149,7 +149,7 @@ type
func lcDataForkAtEpoch*( func lcDataForkAtEpoch*(
cfg: RuntimeConfig, epoch: Epoch): LightClientDataFork = cfg: RuntimeConfig, epoch: Epoch): LightClientDataFork =
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844 static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
if epoch >= cfg.EIP4844_FORK_EPOCH: if epoch >= cfg.DENEB_FORK_EPOCH:
LightClientDataFork.EIP4844 LightClientDataFork.EIP4844
elif epoch >= cfg.CAPELLA_FORK_EPOCH: elif epoch >= cfg.CAPELLA_FORK_EPOCH:
LightClientDataFork.Capella LightClientDataFork.Capella

View File

@ -148,13 +148,13 @@ func getDiscoveryForkID*(cfg: RuntimeConfig,
type GossipState* = set[ConsensusFork] type GossipState* = set[ConsensusFork]
func getTargetGossipState*( func getTargetGossipState*(
epoch, ALTAIR_FORK_EPOCH, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH, epoch, ALTAIR_FORK_EPOCH, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH,
EIP4844_FORK_EPOCH: Epoch, isBehind: bool): GossipState = DENEB_FORK_EPOCH: Epoch, isBehind: bool): GossipState =
if isBehind: if isBehind:
return {} return {}
doAssert BELLATRIX_FORK_EPOCH >= ALTAIR_FORK_EPOCH doAssert BELLATRIX_FORK_EPOCH >= ALTAIR_FORK_EPOCH
doAssert CAPELLA_FORK_EPOCH >= BELLATRIX_FORK_EPOCH doAssert CAPELLA_FORK_EPOCH >= BELLATRIX_FORK_EPOCH
doAssert EIP4844_FORK_EPOCH >= CAPELLA_FORK_EPOCH doAssert DENEB_FORK_EPOCH >= CAPELLA_FORK_EPOCH
# https://github.com/ethereum/consensus-specs/issues/2902 # https://github.com/ethereum/consensus-specs/issues/2902
# Don't care whether ALTAIR_FORK_EPOCH == BELLATRIX_FORK_EPOCH or # Don't care whether ALTAIR_FORK_EPOCH == BELLATRIX_FORK_EPOCH or
@ -178,9 +178,9 @@ func getTargetGossipState*(
maybeIncludeFork( maybeIncludeFork(
ConsensusFork.Bellatrix, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH) ConsensusFork.Bellatrix, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH)
maybeIncludeFork( maybeIncludeFork(
ConsensusFork.Capella, CAPELLA_FORK_EPOCH, EIP4844_FORK_EPOCH) ConsensusFork.Capella, CAPELLA_FORK_EPOCH, DENEB_FORK_EPOCH)
maybeIncludeFork( maybeIncludeFork(
ConsensusFork.EIP4844, EIP4844_FORK_EPOCH, FAR_FUTURE_EPOCH) ConsensusFork.EIP4844, DENEB_FORK_EPOCH, FAR_FUTURE_EPOCH)
doAssert len(targetForks) <= 2 doAssert len(targetForks) <= 2
targetForks targetForks

View File

@ -52,10 +52,8 @@ type
BELLATRIX_FORK_EPOCH*: Epoch BELLATRIX_FORK_EPOCH*: Epoch
CAPELLA_FORK_VERSION*: Version CAPELLA_FORK_VERSION*: Version
CAPELLA_FORK_EPOCH*: Epoch CAPELLA_FORK_EPOCH*: Epoch
EIP4844_FORK_VERSION*: Version DENEB_FORK_VERSION*: Version
EIP4844_FORK_EPOCH*: Epoch DENEB_FORK_EPOCH*: Epoch
SHARDING_FORK_VERSION*: Version
SHARDING_FORK_EPOCH*: Epoch
# Time parameters # Time parameters
# TODO SECONDS_PER_SLOT*: uint64 # TODO SECONDS_PER_SLOT*: uint64
@ -159,12 +157,9 @@ when const_preset == "mainnet":
# Capella # Capella
CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x00], CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x00],
CAPELLA_FORK_EPOCH: FAR_FUTURE_EPOCH, CAPELLA_FORK_EPOCH: FAR_FUTURE_EPOCH,
# eip4844 # Deneb
EIP4844_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x00], DENEB_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x00],
EIP4844_FORK_EPOCH: FAR_FUTURE_EPOCH, DENEB_FORK_EPOCH: FAR_FUTURE_EPOCH,
# Sharding
SHARDING_FORK_VERSION: Version [byte 0x05, 0x00, 0x00, 0x00],
SHARDING_FORK_EPOCH: FAR_FUTURE_EPOCH,
# Time parameters # Time parameters
# --------------------------------------------------------------- # ---------------------------------------------------------------
@ -266,12 +261,10 @@ elif const_preset == "gnosis":
# Capella # Capella
CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x64], CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x64],
CAPELLA_FORK_EPOCH: FAR_FUTURE_EPOCH, CAPELLA_FORK_EPOCH: FAR_FUTURE_EPOCH,
# eip4844 # Deneb
EIP4844_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x64], DENEB_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x64],
EIP4844_FORK_EPOCH: FAR_FUTURE_EPOCH, DENEB_FORK_EPOCH: FAR_FUTURE_EPOCH,
# Sharding
SHARDING_FORK_VERSION: Version [byte 0x05, 0x00, 0x00, 0x64],
SHARDING_FORK_EPOCH: FAR_FUTURE_EPOCH,
# Time parameters # Time parameters
# --------------------------------------------------------------- # ---------------------------------------------------------------
@ -369,12 +362,9 @@ elif const_preset == "minimal":
# Capella # Capella
CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x01], CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x01],
CAPELLA_FORK_EPOCH: Epoch(uint64.high), CAPELLA_FORK_EPOCH: Epoch(uint64.high),
# eip4844 # Deneb
EIP4844_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x01], DENEB_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x01],
EIP4844_FORK_EPOCH: Epoch(uint64.high), DENEB_FORK_EPOCH: Epoch(uint64.high),
# Sharding
SHARDING_FORK_VERSION: Version [byte 0x05, 0x00, 0x00, 0x00],
SHARDING_FORK_EPOCH: Epoch(uint64.high),
# Time parameters # Time parameters
@ -598,6 +588,20 @@ proc readRuntimeConfig*(
# Isn't being used as a preset in the usual way: at any time, there's one correct value # Isn't being used as a preset in the usual way: at any time, there's one correct value
checkCompatibility PROPOSER_SCORE_BOOST checkCompatibility PROPOSER_SCORE_BOOST
# BEGIN TODO
# It should be possible to remove these once we migrate to the next
# release of the consensus test suite:
template readAliasedField(currentName: untyped, oldName: static string) =
if oldName in values:
cfg.currentName = try:
parse(typeof(cfg.currentName), values[oldName])
except ValueError as err:
raise (ref PresetFileError)(msg: "Unable to parse " & oldName)
readAliasedField DENEB_FORK_EPOCH, "EIP4844_FORK_EPOCH"
readAliasedField DENEB_FORK_VERSION, "EIP4844_FORK_VERSION"
# END TODO
for name, field in cfg.fieldPairs(): for name, field in cfg.fieldPairs():
if name in values: if name in values:
try: try:

View File

@ -207,7 +207,7 @@ func maybeUpgradeStateToEIP4844(
cfg: RuntimeConfig, state: var ForkedHashedBeaconState) = cfg: RuntimeConfig, state: var ForkedHashedBeaconState) =
# Both process_slots() and state_transition_block() call this, so only run it # Both process_slots() and state_transition_block() call this, so only run it
# once by checking for existing fork. # once by checking for existing fork.
if getStateField(state, slot).epoch == cfg.EIP4844_FORK_EPOCH and if getStateField(state, slot).epoch == cfg.DENEB_FORK_EPOCH and
state.kind == ConsensusFork.Capella: state.kind == ConsensusFork.Capella:
let newState = upgrade_to_eip4844(cfg, state.capellaData.data) let newState = upgrade_to_eip4844(cfg, state.capellaData.data)
state = (ref ForkedHashedBeaconState)( state = (ref ForkedHashedBeaconState)(

View File

@ -40,7 +40,7 @@ type
RequestManager* = object RequestManager* = object
network*: Eth2Node network*: Eth2Node
inpQueue*: AsyncQueue[FetchRecord] inpQueue*: AsyncQueue[FetchRecord]
EIP4844_FORK_EPOCH: Epoch DENEB_FORK_EPOCH: Epoch
getBeaconTime: GetBeaconTimeFn getBeaconTime: GetBeaconTimeFn
blockVerifier: BlockVerifier blockVerifier: BlockVerifier
blockBlobsVerifier: BlockBlobsVerifier blockBlobsVerifier: BlockBlobsVerifier
@ -60,7 +60,7 @@ proc init*(T: type RequestManager, network: Eth2Node,
RequestManager( RequestManager(
network: network, network: network,
inpQueue: newAsyncQueue[FetchRecord](), inpQueue: newAsyncQueue[FetchRecord](),
EIP4844_FORK_EPOCH: eip4844Epoch, DENEB_FORK_EPOCH: eip4844Epoch,
getBeaconTime: getBeaconTime, getBeaconTime: getBeaconTime,
blockVerifier: blockVerifier, blockVerifier: blockVerifier,
blockBlobsVerifier: blockBlobsVerifier, blockBlobsVerifier: blockBlobsVerifier,
@ -253,7 +253,7 @@ proc fetchAncestorBlocksAndBlobsFromNetwork(rman: RequestManager,
proc isBlobsTime(rman: RequestManager): bool = proc isBlobsTime(rman: RequestManager): bool =
rman.getBeaconTime().slotOrZero.epoch >= rman.EIP4844_FORK_EPOCH rman.getBeaconTime().slotOrZero.epoch >= rman.DENEB_FORK_EPOCH
proc requestManagerLoop(rman: RequestManager) {.async.} = proc requestManagerLoop(rman: RequestManager) {.async.} =
var rootList = newSeq[Eth2Digest]() var rootList = newSeq[Eth2Digest]()
@ -271,7 +271,7 @@ proc requestManagerLoop(rman: RequestManager) {.async.} =
let start = SyncMoment.now(0) let start = SyncMoment.now(0)
# As soon as EIP4844_FORK_EPOCH comes around in wall time, we # As soon as DENEB_FORK_EPOCH comes around in wall time, we
# switch to requesting blocks and blobs. In the vicinity of the # switch to requesting blocks and blobs. In the vicinity of the
# transition, that means that we *may* request blobs for a # transition, that means that we *may* request blobs for a
# pre-eip4844. In that case, we get ResourceUnavailable from the # pre-eip4844. In that case, we get ResourceUnavailable from the

View File

@ -47,7 +47,7 @@ type
SyncManager*[A, B] = ref object SyncManager*[A, B] = ref object
pool: PeerPool[A, B] pool: PeerPool[A, B]
EIP4844_FORK_EPOCH: Epoch DENEB_FORK_EPOCH: Epoch
responseTimeout: chronos.Duration responseTimeout: chronos.Duration
maxHeadAge: uint64 maxHeadAge: uint64
getLocalHeadSlot: GetSlotCallback getLocalHeadSlot: GetSlotCallback
@ -139,7 +139,7 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B],
var res = SyncManager[A, B]( var res = SyncManager[A, B](
pool: pool, pool: pool,
EIP4844_FORK_EPOCH: eip4844Epoch, DENEB_FORK_EPOCH: eip4844Epoch,
getLocalHeadSlot: getLocalHeadSlotCb, getLocalHeadSlot: getLocalHeadSlotCb,
getLocalWallSlot: getLocalWallSlotCb, getLocalWallSlot: getLocalWallSlotCb,
getSafeSlot: getSafeSlot, getSafeSlot: getSafeSlot,
@ -189,7 +189,7 @@ proc getBlocks*[A, B](man: SyncManager[A, B], peer: A,
proc shouldGetBlobs[A, B](man: SyncManager[A, B], e: Epoch): bool = proc shouldGetBlobs[A, B](man: SyncManager[A, B], e: Epoch): bool =
let wallEpoch = man.getLocalWallSlot().epoch let wallEpoch = man.getLocalWallSlot().epoch
e >= man.EIP4844_FORK_EPOCH and e >= man.DENEB_FORK_EPOCH and
(wallEpoch < MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS or (wallEpoch < MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS or
e >= wallEpoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS) e >= wallEpoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS)

View File

@ -472,8 +472,8 @@ p2pProtocol BeaconSync(version = 1,
Epoch(MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS) Epoch(MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS)
epochBoundary = epochBoundary =
if dag.head.slot.epoch - min_epochs < dag.cfg.EIP4844_FORK_EPOCH: if dag.head.slot.epoch - min_epochs < dag.cfg.DENEB_FORK_EPOCH:
dag.cfg.EIP4844_FORK_EPOCH dag.cfg.DENEB_FORK_EPOCH
else: else:
dag.head.slot.epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS dag.head.slot.epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS
minimum_request_epoch = max(dag.finalizedHead.slot.epoch, epochBoundary) minimum_request_epoch = max(dag.finalizedHead.slot.epoch, epochBoundary)

View File

@ -854,7 +854,7 @@ proc proposeBlock(node: BeaconNode,
return newBlockMEV.get return newBlockMEV.get
let newBlock = let newBlock =
if slot.epoch >= node.dag.cfg.EIP4844_FORK_EPOCH: if slot.epoch >= node.dag.cfg.DENEB_FORK_EPOCH:
await makeBeaconBlockForHeadAndSlot[eip4844.ExecutionPayload]( await makeBeaconBlockForHeadAndSlot[eip4844.ExecutionPayload](
node, randao, validator_index, node.graffitiBytes, head, slot) node, randao, validator_index, node.graffitiBytes, head, slot)
elif slot.epoch >= node.dag.cfg.CAPELLA_FORK_EPOCH: elif slot.epoch >= node.dag.cfg.CAPELLA_FORK_EPOCH:

View File

@ -2622,7 +2622,7 @@
"response": { "response": {
"status": {"operator": "equals", "value": "200"}, "status": {"operator": "equals", "value": "200"},
"headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}], "headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}],
"body": [{"operator": "jstructcmps", "start": ["data"], "value": {"MAX_COMMITTEES_PER_SLOT":"","TARGET_COMMITTEE_SIZE":"","MAX_VALIDATORS_PER_COMMITTEE":"","SHUFFLE_ROUND_COUNT":"","HYSTERESIS_QUOTIENT":"","HYSTERESIS_DOWNWARD_MULTIPLIER":"","HYSTERESIS_UPWARD_MULTIPLIER":"","SAFE_SLOTS_TO_UPDATE_JUSTIFIED":"","MIN_DEPOSIT_AMOUNT":"","MAX_EFFECTIVE_BALANCE":"","EFFECTIVE_BALANCE_INCREMENT":"","MIN_ATTESTATION_INCLUSION_DELAY":"","SLOTS_PER_EPOCH":"","MIN_SEED_LOOKAHEAD":"","MAX_SEED_LOOKAHEAD":"","EPOCHS_PER_ETH1_VOTING_PERIOD":"","SLOTS_PER_HISTORICAL_ROOT":"","MIN_EPOCHS_TO_INACTIVITY_PENALTY":"","EPOCHS_PER_HISTORICAL_VECTOR":"","EPOCHS_PER_SLASHINGS_VECTOR":"","HISTORICAL_ROOTS_LIMIT":"","VALIDATOR_REGISTRY_LIMIT":"","BASE_REWARD_FACTOR":"","WHISTLEBLOWER_REWARD_QUOTIENT":"","PROPOSER_REWARD_QUOTIENT":"","INACTIVITY_PENALTY_QUOTIENT":"","MIN_SLASHING_PENALTY_QUOTIENT":"","PROPORTIONAL_SLASHING_MULTIPLIER":"","MAX_PROPOSER_SLASHINGS":"","MAX_ATTESTER_SLASHINGS":"","MAX_ATTESTATIONS":"","MAX_DEPOSITS":"","MAX_VOLUNTARY_EXITS":"","INACTIVITY_PENALTY_QUOTIENT_ALTAIR":"","MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR":"","PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR":"","SYNC_COMMITTEE_SIZE":"","EPOCHS_PER_SYNC_COMMITTEE_PERIOD":"","MIN_SYNC_COMMITTEE_PARTICIPANTS":"","UPDATE_TIMEOUT":"","INACTIVITY_PENALTY_QUOTIENT_BELLATRIX":"","MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX":"","PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX":"","MAX_BYTES_PER_TRANSACTION":"","MAX_TRANSACTIONS_PER_PAYLOAD":"","BYTES_PER_LOGS_BLOOM":"","MAX_EXTRA_DATA_BYTES":"","PRESET_BASE":"","CONFIG_NAME":"","TERMINAL_TOTAL_DIFFICULTY":"","TERMINAL_BLOCK_HASH":"","TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH":"","MIN_GENESIS_ACTIVE_VALIDATOR_COUNT":"","MIN_GENESIS_TIME":"","GENESIS_FORK_VERSION":"","GENESIS_DELAY":"","ALTAIR_FORK_VERSION":"","ALTAIR_FORK_EPOCH":"","BELLATRIX_FORK_VERSION":"","BELLATRIX_FORK_EPOCH":"","CAPELLA_FORK_VERSION":"","CAPELLA_FORK_EPOCH":"","SECONDS_PER_SLOT":"","SECONDS_PER_ETH1_BLOCK":"","MIN_VALIDATOR_WITHDRAWABILITY_DELAY":"","SHARD_COMMITTEE_PERIOD":"","ETH1_FOLLOW_DISTANCE":"","INACTIVITY_SCORE_BIAS":"","INACTIVITY_SCORE_RECOVERY_RATE":"","EJECTION_BALANCE":"","MIN_PER_EPOCH_CHURN_LIMIT":"","CHURN_LIMIT_QUOTIENT":"","PROPOSER_SCORE_BOOST":"","DEPOSIT_CHAIN_ID":"","DEPOSIT_NETWORK_ID":"","DEPOSIT_CONTRACT_ADDRESS":"","BLS_WITHDRAWAL_PREFIX":"","ETH1_ADDRESS_WITHDRAWAL_PREFIX":"","DOMAIN_BEACON_PROPOSER":"","DOMAIN_BEACON_ATTESTER":"","DOMAIN_RANDAO":"","DOMAIN_DEPOSIT":"","DOMAIN_VOLUNTARY_EXIT":"","DOMAIN_SELECTION_PROOF":"","DOMAIN_AGGREGATE_AND_PROOF":"","TIMELY_SOURCE_FLAG_INDEX":"","TIMELY_TARGET_FLAG_INDEX":"","TIMELY_HEAD_FLAG_INDEX":"","TIMELY_SOURCE_WEIGHT":"","TIMELY_TARGET_WEIGHT":"","TIMELY_HEAD_WEIGHT":"","SYNC_REWARD_WEIGHT":"","PROPOSER_WEIGHT":"","WEIGHT_DENOMINATOR":"","DOMAIN_SYNC_COMMITTEE":"","DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF":"","DOMAIN_CONTRIBUTION_AND_PROOF":"","TARGET_AGGREGATORS_PER_COMMITTEE":"","RANDOM_SUBNETS_PER_VALIDATOR":"","EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION":"","ATTESTATION_SUBNET_COUNT":"","TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE":"","SYNC_COMMITTEE_SUBNET_COUNT":""}}] "body": [{"operator": "jstructcmps", "start": ["data"], "value": {"MAX_COMMITTEES_PER_SLOT":"","TARGET_COMMITTEE_SIZE":"","MAX_VALIDATORS_PER_COMMITTEE":"","SHUFFLE_ROUND_COUNT":"","HYSTERESIS_QUOTIENT":"","HYSTERESIS_DOWNWARD_MULTIPLIER":"","HYSTERESIS_UPWARD_MULTIPLIER":"","SAFE_SLOTS_TO_UPDATE_JUSTIFIED":"","MIN_DEPOSIT_AMOUNT":"","MAX_EFFECTIVE_BALANCE":"","EFFECTIVE_BALANCE_INCREMENT":"","MIN_ATTESTATION_INCLUSION_DELAY":"","SLOTS_PER_EPOCH":"","MIN_SEED_LOOKAHEAD":"","MAX_SEED_LOOKAHEAD":"","EPOCHS_PER_ETH1_VOTING_PERIOD":"","SLOTS_PER_HISTORICAL_ROOT":"","MIN_EPOCHS_TO_INACTIVITY_PENALTY":"","EPOCHS_PER_HISTORICAL_VECTOR":"","EPOCHS_PER_SLASHINGS_VECTOR":"","HISTORICAL_ROOTS_LIMIT":"","VALIDATOR_REGISTRY_LIMIT":"","BASE_REWARD_FACTOR":"","WHISTLEBLOWER_REWARD_QUOTIENT":"","PROPOSER_REWARD_QUOTIENT":"","INACTIVITY_PENALTY_QUOTIENT":"","MIN_SLASHING_PENALTY_QUOTIENT":"","PROPORTIONAL_SLASHING_MULTIPLIER":"","MAX_PROPOSER_SLASHINGS":"","MAX_ATTESTER_SLASHINGS":"","MAX_ATTESTATIONS":"","MAX_DEPOSITS":"","MAX_VOLUNTARY_EXITS":"","INACTIVITY_PENALTY_QUOTIENT_ALTAIR":"","MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR":"","PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR":"","SYNC_COMMITTEE_SIZE":"","EPOCHS_PER_SYNC_COMMITTEE_PERIOD":"","MIN_SYNC_COMMITTEE_PARTICIPANTS":"","UPDATE_TIMEOUT":"","INACTIVITY_PENALTY_QUOTIENT_BELLATRIX":"","MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX":"","PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX":"","MAX_BYTES_PER_TRANSACTION":"","MAX_TRANSACTIONS_PER_PAYLOAD":"","BYTES_PER_LOGS_BLOOM":"","MAX_EXTRA_DATA_BYTES":"","PRESET_BASE":"","CONFIG_NAME":"","TERMINAL_TOTAL_DIFFICULTY":"","TERMINAL_BLOCK_HASH":"","TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH":"","MIN_GENESIS_ACTIVE_VALIDATOR_COUNT":"","MIN_GENESIS_TIME":"","GENESIS_FORK_VERSION":"","GENESIS_DELAY":"","ALTAIR_FORK_VERSION":"","ALTAIR_FORK_EPOCH":"","BELLATRIX_FORK_VERSION":"","BELLATRIX_FORK_EPOCH":"","CAPELLA_FORK_VERSION":"","CAPELLA_FORK_EPOCH":"","DENEB_FORK_VERSION":"","DENEB_FORK_EPOCH":"","SECONDS_PER_SLOT":"","SECONDS_PER_ETH1_BLOCK":"","MIN_VALIDATOR_WITHDRAWABILITY_DELAY":"","SHARD_COMMITTEE_PERIOD":"","ETH1_FOLLOW_DISTANCE":"","INACTIVITY_SCORE_BIAS":"","INACTIVITY_SCORE_RECOVERY_RATE":"","EJECTION_BALANCE":"","MIN_PER_EPOCH_CHURN_LIMIT":"","CHURN_LIMIT_QUOTIENT":"","PROPOSER_SCORE_BOOST":"","DEPOSIT_CHAIN_ID":"","DEPOSIT_NETWORK_ID":"","DEPOSIT_CONTRACT_ADDRESS":"","BLS_WITHDRAWAL_PREFIX":"","ETH1_ADDRESS_WITHDRAWAL_PREFIX":"","DOMAIN_BEACON_PROPOSER":"","DOMAIN_BEACON_ATTESTER":"","DOMAIN_RANDAO":"","DOMAIN_DEPOSIT":"","DOMAIN_VOLUNTARY_EXIT":"","DOMAIN_SELECTION_PROOF":"","DOMAIN_AGGREGATE_AND_PROOF":"","TIMELY_SOURCE_FLAG_INDEX":"","TIMELY_TARGET_FLAG_INDEX":"","TIMELY_HEAD_FLAG_INDEX":"","TIMELY_SOURCE_WEIGHT":"","TIMELY_TARGET_WEIGHT":"","TIMELY_HEAD_WEIGHT":"","SYNC_REWARD_WEIGHT":"","PROPOSER_WEIGHT":"","WEIGHT_DENOMINATOR":"","DOMAIN_SYNC_COMMITTEE":"","DOMAIN_SYNC_COMMITTEE_SELECTION_PROOF":"","DOMAIN_CONTRIBUTION_AND_PROOF":"","TARGET_AGGREGATORS_PER_COMMITTEE":"","RANDOM_SUBNETS_PER_VALIDATOR":"","EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION":"","ATTESTATION_SUBNET_COUNT":"","TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE":"","SYNC_COMMITTEE_SUBNET_COUNT":""}}]
} }
}, },
{ {

View File

@ -310,7 +310,7 @@ cli do(slots = SLOTS_PER_EPOCH * 6,
cfg.ALTAIR_FORK_EPOCH = 1.Epoch cfg.ALTAIR_FORK_EPOCH = 1.Epoch
cfg.BELLATRIX_FORK_EPOCH = 2.Epoch cfg.BELLATRIX_FORK_EPOCH = 2.Epoch
cfg.CAPELLA_FORK_EPOCH = 3.Epoch cfg.CAPELLA_FORK_EPOCH = 3.Epoch
cfg.EIP4844_FORK_EPOCH = 4.Epoch cfg.DENEB_FORK_EPOCH = 4.Epoch
echo "Starting simulation..." echo "Starting simulation..."

View File

@ -46,7 +46,7 @@ func genesisTestRuntimeConfig*(stateFork: ConsensusFork): RuntimeConfig =
var res = defaultRuntimeConfig var res = defaultRuntimeConfig
case stateFork case stateFork
of ConsensusFork.EIP4844: of ConsensusFork.EIP4844:
res.EIP4844_FORK_EPOCH = GENESIS_EPOCH res.DENEB_FORK_EPOCH = GENESIS_EPOCH
res.CAPELLA_FORK_EPOCH = GENESIS_EPOCH res.CAPELLA_FORK_EPOCH = GENESIS_EPOCH
res.BELLATRIX_FORK_EPOCH = GENESIS_EPOCH res.BELLATRIX_FORK_EPOCH = GENESIS_EPOCH
res.ALTAIR_FORK_EPOCH = GENESIS_EPOCH res.ALTAIR_FORK_EPOCH = GENESIS_EPOCH

View File

@ -127,7 +127,16 @@ proc runTest(path: string) =
# Reduce stack size by making this a `proc` # Reduce stack size by making this a `proc`
proc loadTestMeta(): (RuntimeConfig, TestMeta) = proc loadTestMeta(): (RuntimeConfig, TestMeta) =
let (cfg, unknowns) = readRuntimeConfig(path/"config.yaml") let (cfg, unknowns) = readRuntimeConfig(path/"config.yaml")
doAssert unknowns.len == 0, "Unknown config constants: " & $unknowns
# TODO
# Uncomment the assertion below and remove the loop below.
# The two unknown constants are "EIP4844_FORK_VERSION", "EIP4844_FORK_EPOCH"
# This is likely to be fixed in the next release of the test suite where
# EIP4844 will be renamed to DENEB (our code is already using the new name).
# doAssert unknowns.len == 0, "Unknown config constants: " & $unknowns
for name in unknowns:
if name notin ["EIP4844_FORK_VERSION", "EIP4844_FORK_EPOCH"]:
raiseAssert "Unknown constant: " & name
type TestMetaYaml {.sparse.} = object type TestMetaYaml {.sparse.} = object
genesis_validators_root: string genesis_validators_root: string

View File

@ -138,7 +138,7 @@ suite "EF - Deneb - Transition " & preset():
for kind, path in walkDir(TransitionDir, relative = true, checkDir = true): for kind, path in walkDir(TransitionDir, relative = true, checkDir = true):
let transitionInfo = getTransitionInfo(TransitionDir / path) let transitionInfo = getTransitionInfo(TransitionDir / path)
var cfg = defaultRuntimeConfig var cfg = defaultRuntimeConfig
cfg.EIP4844_FORK_EPOCH = transitionInfo.fork_epoch.Epoch cfg.DENEB_FORK_EPOCH = transitionInfo.fork_epoch.Epoch
runTest( runTest(
capella.BeaconState, eip4844.BeaconState, capella.SignedBeaconBlock, capella.BeaconState, eip4844.BeaconState, capella.SignedBeaconBlock,
eip4844.SignedBeaconBlock, cfg, "EF - EIP4844 - Transition", eip4844.SignedBeaconBlock, cfg, "EF - EIP4844 - Transition",

View File

@ -212,7 +212,7 @@ echo Wrote $RUNTIME_CONFIG_FILE:
tee "$RUNTIME_CONFIG_FILE" <<EOF tee "$RUNTIME_CONFIG_FILE" <<EOF
PRESET_BASE: "mainnet" PRESET_BASE: "mainnet"
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: ${TOTAL_VALIDATORS} MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: ${NUM_VALIDATORS}
MIN_GENESIS_TIME: 0 MIN_GENESIS_TIME: 0
GENESIS_DELAY: 10 GENESIS_DELAY: 10
GENESIS_FORK_VERSION: 0x00000000 GENESIS_FORK_VERSION: 0x00000000

View File

@ -27,7 +27,7 @@ suite "Light client" & preset():
res.ALTAIR_FORK_EPOCH = 1.Epoch res.ALTAIR_FORK_EPOCH = 1.Epoch
res.BELLATRIX_FORK_EPOCH = 2.Epoch res.BELLATRIX_FORK_EPOCH = 2.Epoch
# $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch # $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch
# $eip4844ImplementationMissing res.EIP4844_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch # $eip4844ImplementationMissing res.DENEB_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch
res res
altairStartSlot = cfg.ALTAIR_FORK_EPOCH.start_slot altairStartSlot = cfg.ALTAIR_FORK_EPOCH.start_slot

View File

@ -30,7 +30,7 @@ suite "Light client processor" & preset():
res.ALTAIR_FORK_EPOCH = 1.Epoch res.ALTAIR_FORK_EPOCH = 1.Epoch
res.BELLATRIX_FORK_EPOCH = 2.Epoch res.BELLATRIX_FORK_EPOCH = 2.Epoch
# $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch # $capellaImplementationMissing res.CAPELLA_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 1).Epoch
# $eip4844ImplementationMissing res.EIP4844_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch # $eip4844ImplementationMissing res.DENEB_FORK_EPOCH = (EPOCHS_PER_SYNC_COMMITTEE_PERIOD * 2).Epoch
res res
const numValidators = SLOTS_PER_EPOCH const numValidators = SLOTS_PER_EPOCH

View File

@ -73,7 +73,7 @@ proc getTestStates*(
if stateFork >= ConsensusFork.Capella: if stateFork >= ConsensusFork.Capella:
cfg.CAPELLA_FORK_EPOCH = 3.Epoch cfg.CAPELLA_FORK_EPOCH = 3.Epoch
if stateFork >= ConsensusFork.EIP4844: if stateFork >= ConsensusFork.EIP4844:
cfg.EIP4844_FORK_EPOCH = 4.Epoch cfg.DENEB_FORK_EPOCH = 4.Epoch
for i, epoch in stateEpochs: for i, epoch in stateEpochs:
let slot = epoch.Epoch.start_slot let slot = epoch.Epoch.start_slot

@ -1 +1 @@
Subproject commit a072c89b40cf4f28a26d047bb3aeb08995955f07 Subproject commit 51f96a0a1c4d87580065cf1f4d7f57b49872675b

@ -1 +1 @@
Subproject commit 8e04eb74cd06f2fa1c79f41b2ab9f8f13ee7d490 Subproject commit baebfaba3c0dcb8b6e4d5113e52fd6981253a152