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:
parent
b7c3037f01
commit
067ba13c52
|
@ -527,7 +527,8 @@ proc new*(T: type BeaconChainDB,
|
|||
else:
|
||||
"",
|
||||
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"
|
||||
else:
|
||||
"",
|
||||
|
@ -539,7 +540,7 @@ proc new*(T: type BeaconChainDB,
|
|||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
||||
|
||||
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()
|
||||
|
||||
# Versions prior to 1.4.0 (altair) stored validators in `immutable_validators`
|
||||
|
|
|
@ -1067,7 +1067,7 @@ proc init*(T: type ChainDAGRef, cfg: RuntimeConfig, db: BeaconChainDB,
|
|||
of ConsensusFork.Altair: altairFork(cfg)
|
||||
of ConsensusFork.Bellatrix: bellatrixFork(cfg)
|
||||
of ConsensusFork.Capella: capellaFork(cfg)
|
||||
of ConsensusFork.EIP4844: eip4844Fork(cfg)
|
||||
of ConsensusFork.EIP4844: denebFork(cfg)
|
||||
stateFork = getStateField(dag.headState, fork)
|
||||
|
||||
if stateFork != configFork:
|
||||
|
|
|
@ -380,7 +380,7 @@ proc updateGossipStatus*(
|
|||
|
||||
currentEpochTargetGossipState = getTargetGossipState(
|
||||
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 =
|
||||
if lcBehind or epoch < 1:
|
||||
currentEpochTargetGossipState
|
||||
|
@ -390,7 +390,7 @@ proc updateGossipStatus*(
|
|||
# Therefore, LC topic subscriptions are kept for 1 extra epoch.
|
||||
let previousEpochTargetGossipState = getTargetGossipState(
|
||||
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
|
||||
|
||||
template currentGossipState(): auto = lightClient.gossipState
|
||||
|
|
|
@ -217,7 +217,7 @@ when const_preset == "gnosis":
|
|||
static:
|
||||
checkForkConsistency(gnosisMetadata.cfg)
|
||||
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":
|
||||
const
|
||||
|
@ -225,11 +225,12 @@ elif const_preset == "mainnet":
|
|||
praterMetadata* = eth2Network("shared/prater", goerli)
|
||||
sepoliaMetadata* = mergeTestnet("sepolia", sepolia)
|
||||
static:
|
||||
for network in [
|
||||
mainnetMetadata, praterMetadata, sepoliaMetadata]:
|
||||
for network in [mainnetMetadata, praterMetadata, sepoliaMetadata]:
|
||||
checkForkConsistency(network.cfg)
|
||||
|
||||
for network in [mainnetMetadata, praterMetadata]:
|
||||
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*(
|
||||
networkName: string): Eth2NetworkMetadata {.raises: [Defect, IOError].} =
|
||||
|
|
|
@ -350,11 +350,11 @@ proc initFullNode(
|
|||
validatorChangePool, node.attachedValidators, syncCommitteeMsgPool,
|
||||
lightClientPool, quarantine, rng, getBeaconTime, taskpool)
|
||||
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,
|
||||
getFrontfillSlot, dag.tail.slot, blockVerifier, blockBlobsVerifier)
|
||||
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,
|
||||
getFrontfillSlot, dag.backfill.slot, blockVerifier, blockBlobsVerifier,
|
||||
maxHeadAge = 0)
|
||||
|
@ -392,7 +392,7 @@ proc initFullNode(
|
|||
node.blockProcessor = blockProcessor
|
||||
node.consensusManager = consensusManager
|
||||
node.requestManager = RequestManager.init(node.network,
|
||||
dag.cfg.EIP4844_FORK_EPOCH,
|
||||
dag.cfg.DENEB_FORK_EPOCH,
|
||||
getBeaconTime,
|
||||
blockVerifier, blockBlobsVerifier)
|
||||
node.syncManager = syncManager
|
||||
|
@ -787,7 +787,7 @@ proc updateBlocksGossipStatus*(
|
|||
|
||||
targetGossipState = getTargetGossipState(
|
||||
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
|
||||
if currentGossipState == targetGossipState:
|
||||
|
@ -1019,7 +1019,7 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} =
|
|||
node.dag.cfg.ALTAIR_FORK_EPOCH,
|
||||
node.dag.cfg.BELLATRIX_FORK_EPOCH,
|
||||
node.dag.cfg.CAPELLA_FORK_EPOCH,
|
||||
node.dag.cfg.EIP4844_FORK_EPOCH,
|
||||
node.dag.cfg.DENEB_FORK_EPOCH,
|
||||
isBehind)
|
||||
|
||||
doAssert targetGossipState.card <= 2
|
||||
|
@ -1444,7 +1444,7 @@ proc installMessageValidators(node: BeaconNode) =
|
|||
installPhase0Validators(forkDigests.altair)
|
||||
installPhase0Validators(forkDigests.bellatrix)
|
||||
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)
|
||||
|
||||
node.network.addValidator(
|
||||
|
@ -1477,7 +1477,7 @@ proc installMessageValidators(node: BeaconNode) =
|
|||
toValidationResult(node.processor[].processSignedBeaconBlock(
|
||||
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(
|
||||
getBeaconBlockAndBlobsSidecarTopic(forkDigests.eip4844),
|
||||
proc (
|
||||
|
@ -1537,7 +1537,7 @@ proc installMessageValidators(node: BeaconNode) =
|
|||
installSyncCommitteeeValidators(forkDigests.altair)
|
||||
installSyncCommitteeeValidators(forkDigests.bellatrix)
|
||||
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)
|
||||
|
||||
template installBlsToExecutionChangeValidators(digest: auto) =
|
||||
|
@ -1548,7 +1548,7 @@ proc installMessageValidators(node: BeaconNode) =
|
|||
node.processor[].processBlsToExecutionChange(MsgSource.gossip, msg)))
|
||||
|
||||
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)
|
||||
|
||||
node.installLightClientMessageValidators()
|
||||
|
|
|
@ -239,7 +239,7 @@ programMain:
|
|||
|
||||
targetGossipState = getTargetGossipState(
|
||||
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
|
||||
if currentGossipState == targetGossipState:
|
||||
|
|
|
@ -153,6 +153,10 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
"0x" & $cfg.CAPELLA_FORK_VERSION,
|
||||
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:
|
||||
Base10.toString(SECONDS_PER_SLOT),
|
||||
SECONDS_PER_ETH1_BLOCK:
|
||||
|
@ -272,8 +276,6 @@ proc installConfigApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||
"/eth/v1/config/spec") do () -> RestApiResponse:
|
||||
return RestApiResponse.response(cachedConfigSpec, Http200,
|
||||
"application/json")
|
||||
# EIP4844_FORK_EPOCH and EIP4844_FORK_VERSION not yet in config
|
||||
discard $eip4844ImplementationMissing
|
||||
|
||||
# https://ethereum.github.io/beacon-APIs/#/Config/getDepositContract
|
||||
router.api(MethodGet,
|
||||
|
|
|
@ -1145,7 +1145,7 @@ func upgrade_to_eip4844*(cfg: RuntimeConfig, pre: capella.BeaconState):
|
|||
slot: pre.slot,
|
||||
fork: Fork(
|
||||
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
|
||||
),
|
||||
|
||||
|
|
|
@ -985,12 +985,10 @@ const eth1BlockHash* = block:
|
|||
x
|
||||
|
||||
func checkForkConsistency*(cfg: RuntimeConfig) =
|
||||
doAssert cfg.SHARDING_FORK_EPOCH == FAR_FUTURE_EPOCH
|
||||
|
||||
let forkVersions =
|
||||
[cfg.GENESIS_FORK_VERSION, cfg.ALTAIR_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 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.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
|
||||
# due to a Deneb implementation missing. checkForkConsistency() checks that
|
||||
|
|
|
@ -523,7 +523,7 @@ func get_lc_execution_root*(
|
|||
header: LightClientHeader, cfg: RuntimeConfig): Eth2Digest =
|
||||
let epoch = header.beacon.slot.epoch
|
||||
|
||||
if epoch >= cfg.EIP4844_FORK_EPOCH:
|
||||
if epoch >= cfg.DENEB_FORK_EPOCH:
|
||||
return hash_tree_root(header.execution)
|
||||
|
||||
if epoch >= cfg.CAPELLA_FORK_EPOCH:
|
||||
|
@ -552,7 +552,7 @@ func is_valid_light_client_header*(
|
|||
header: LightClientHeader, cfg: RuntimeConfig): bool =
|
||||
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:
|
||||
return false
|
||||
|
||||
|
|
|
@ -383,8 +383,8 @@ type
|
|||
BELLATRIX_FORK_EPOCH*: uint64
|
||||
CAPELLA_FORK_VERSION*: Version
|
||||
CAPELLA_FORK_EPOCH*: uint64
|
||||
EIP4844_FORK_VERSION*: Version
|
||||
EIP4844_FORK_EPOCH*: uint64
|
||||
DENEB_FORK_VERSION*: Version
|
||||
DENEB_FORK_EPOCH*: uint64
|
||||
SECONDS_PER_SLOT*: uint64
|
||||
SECONDS_PER_ETH1_BLOCK*: uint64
|
||||
MIN_VALIDATOR_WITHDRAWABILITY_DELAY*: uint64
|
||||
|
|
|
@ -648,7 +648,7 @@ func stateForkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): ConsensusFork =
|
|||
doAssert ConsensusFork.Altair > ConsensusFork.Phase0
|
||||
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.BELLATRIX_FORK_EPOCH: ConsensusFork.Bellatrix
|
||||
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 =
|
||||
## Return the current fork for the given epoch.
|
||||
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.BELLATRIX_FORK_EPOCH: ConsensusFork.Bellatrix
|
||||
elif epoch >= cfg.ALTAIR_FORK_EPOCH: ConsensusFork.Altair
|
||||
|
@ -891,15 +891,15 @@ func capellaFork*(cfg: RuntimeConfig): Fork =
|
|||
current_version: cfg.CAPELLA_FORK_VERSION,
|
||||
epoch: cfg.CAPELLA_FORK_EPOCH)
|
||||
|
||||
func eip4844Fork*(cfg: RuntimeConfig): Fork =
|
||||
func denebFork*(cfg: RuntimeConfig): Fork =
|
||||
Fork(
|
||||
previous_version: cfg.CAPELLA_FORK_VERSION,
|
||||
current_version: cfg.EIP4844_FORK_VERSION,
|
||||
epoch: cfg.EIP4844_FORK_EPOCH)
|
||||
current_version: cfg.DENEB_FORK_VERSION,
|
||||
epoch: cfg.DENEB_FORK_EPOCH)
|
||||
|
||||
func forkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Fork =
|
||||
case cfg.stateForkAtEpoch(epoch)
|
||||
of ConsensusFork.EIP4844: cfg.eip4844Fork
|
||||
of ConsensusFork.EIP4844: cfg.denebFork
|
||||
of ConsensusFork.Capella: cfg.capellaFork
|
||||
of ConsensusFork.Bellatrix: cfg.bellatrixFork
|
||||
of ConsensusFork.Altair: cfg.altairFork
|
||||
|
@ -907,7 +907,7 @@ func forkAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Fork =
|
|||
|
||||
func forkVersionAtEpoch*(cfg: RuntimeConfig, epoch: Epoch): Version =
|
||||
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.Bellatrix: cfg.BELLATRIX_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 =
|
||||
case cfg.stateForkAtEpoch(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.Altair: cfg.BELLATRIX_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.Bellatrix: cfg.BELLATRIX_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 =
|
||||
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.
|
||||
[cfg.genesisFork(), cfg.altairFork(), cfg.bellatrixFork(), cfg.capellaFork(),
|
||||
cfg.eip4844Fork()]
|
||||
cfg.denebFork()]
|
||||
|
||||
type
|
||||
# The first few fields of a state, shared across all forks
|
||||
|
@ -1041,7 +1041,7 @@ func init*(T: type ForkDigests,
|
|||
capella:
|
||||
compute_fork_digest(cfg.CAPELLA_FORK_VERSION, genesis_validators_root),
|
||||
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 =
|
||||
|
|
|
@ -149,7 +149,7 @@ type
|
|||
func lcDataForkAtEpoch*(
|
||||
cfg: RuntimeConfig, epoch: Epoch): LightClientDataFork =
|
||||
static: doAssert LightClientDataFork.high == LightClientDataFork.EIP4844
|
||||
if epoch >= cfg.EIP4844_FORK_EPOCH:
|
||||
if epoch >= cfg.DENEB_FORK_EPOCH:
|
||||
LightClientDataFork.EIP4844
|
||||
elif epoch >= cfg.CAPELLA_FORK_EPOCH:
|
||||
LightClientDataFork.Capella
|
||||
|
|
|
@ -148,13 +148,13 @@ func getDiscoveryForkID*(cfg: RuntimeConfig,
|
|||
type GossipState* = set[ConsensusFork]
|
||||
func getTargetGossipState*(
|
||||
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:
|
||||
return {}
|
||||
|
||||
doAssert BELLATRIX_FORK_EPOCH >= ALTAIR_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
|
||||
# Don't care whether ALTAIR_FORK_EPOCH == BELLATRIX_FORK_EPOCH or
|
||||
|
@ -178,9 +178,9 @@ func getTargetGossipState*(
|
|||
maybeIncludeFork(
|
||||
ConsensusFork.Bellatrix, BELLATRIX_FORK_EPOCH, CAPELLA_FORK_EPOCH)
|
||||
maybeIncludeFork(
|
||||
ConsensusFork.Capella, CAPELLA_FORK_EPOCH, EIP4844_FORK_EPOCH)
|
||||
ConsensusFork.Capella, CAPELLA_FORK_EPOCH, DENEB_FORK_EPOCH)
|
||||
maybeIncludeFork(
|
||||
ConsensusFork.EIP4844, EIP4844_FORK_EPOCH, FAR_FUTURE_EPOCH)
|
||||
ConsensusFork.EIP4844, DENEB_FORK_EPOCH, FAR_FUTURE_EPOCH)
|
||||
|
||||
doAssert len(targetForks) <= 2
|
||||
targetForks
|
||||
|
|
|
@ -52,10 +52,8 @@ type
|
|||
BELLATRIX_FORK_EPOCH*: Epoch
|
||||
CAPELLA_FORK_VERSION*: Version
|
||||
CAPELLA_FORK_EPOCH*: Epoch
|
||||
EIP4844_FORK_VERSION*: Version
|
||||
EIP4844_FORK_EPOCH*: Epoch
|
||||
SHARDING_FORK_VERSION*: Version
|
||||
SHARDING_FORK_EPOCH*: Epoch
|
||||
DENEB_FORK_VERSION*: Version
|
||||
DENEB_FORK_EPOCH*: Epoch
|
||||
|
||||
# Time parameters
|
||||
# TODO SECONDS_PER_SLOT*: uint64
|
||||
|
@ -159,12 +157,9 @@ when const_preset == "mainnet":
|
|||
# Capella
|
||||
CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x00],
|
||||
CAPELLA_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
# eip4844
|
||||
EIP4844_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x00],
|
||||
EIP4844_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
# Sharding
|
||||
SHARDING_FORK_VERSION: Version [byte 0x05, 0x00, 0x00, 0x00],
|
||||
SHARDING_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
# Deneb
|
||||
DENEB_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x00],
|
||||
DENEB_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
|
@ -266,12 +261,10 @@ elif const_preset == "gnosis":
|
|||
# Capella
|
||||
CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x64],
|
||||
CAPELLA_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
# eip4844
|
||||
EIP4844_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x64],
|
||||
EIP4844_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
# Sharding
|
||||
SHARDING_FORK_VERSION: Version [byte 0x05, 0x00, 0x00, 0x64],
|
||||
SHARDING_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
# Deneb
|
||||
DENEB_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x64],
|
||||
DENEB_FORK_EPOCH: FAR_FUTURE_EPOCH,
|
||||
|
||||
|
||||
# Time parameters
|
||||
# ---------------------------------------------------------------
|
||||
|
@ -369,12 +362,9 @@ elif const_preset == "minimal":
|
|||
# Capella
|
||||
CAPELLA_FORK_VERSION: Version [byte 0x03, 0x00, 0x00, 0x01],
|
||||
CAPELLA_FORK_EPOCH: Epoch(uint64.high),
|
||||
# eip4844
|
||||
EIP4844_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x01],
|
||||
EIP4844_FORK_EPOCH: Epoch(uint64.high),
|
||||
# Sharding
|
||||
SHARDING_FORK_VERSION: Version [byte 0x05, 0x00, 0x00, 0x00],
|
||||
SHARDING_FORK_EPOCH: Epoch(uint64.high),
|
||||
# Deneb
|
||||
DENEB_FORK_VERSION: Version [byte 0x04, 0x00, 0x00, 0x01],
|
||||
DENEB_FORK_EPOCH: Epoch(uint64.high),
|
||||
|
||||
|
||||
# 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
|
||||
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():
|
||||
if name in values:
|
||||
try:
|
||||
|
|
|
@ -207,7 +207,7 @@ func maybeUpgradeStateToEIP4844(
|
|||
cfg: RuntimeConfig, state: var ForkedHashedBeaconState) =
|
||||
# Both process_slots() and state_transition_block() call this, so only run it
|
||||
# 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:
|
||||
let newState = upgrade_to_eip4844(cfg, state.capellaData.data)
|
||||
state = (ref ForkedHashedBeaconState)(
|
||||
|
|
|
@ -40,7 +40,7 @@ type
|
|||
RequestManager* = object
|
||||
network*: Eth2Node
|
||||
inpQueue*: AsyncQueue[FetchRecord]
|
||||
EIP4844_FORK_EPOCH: Epoch
|
||||
DENEB_FORK_EPOCH: Epoch
|
||||
getBeaconTime: GetBeaconTimeFn
|
||||
blockVerifier: BlockVerifier
|
||||
blockBlobsVerifier: BlockBlobsVerifier
|
||||
|
@ -60,7 +60,7 @@ proc init*(T: type RequestManager, network: Eth2Node,
|
|||
RequestManager(
|
||||
network: network,
|
||||
inpQueue: newAsyncQueue[FetchRecord](),
|
||||
EIP4844_FORK_EPOCH: eip4844Epoch,
|
||||
DENEB_FORK_EPOCH: eip4844Epoch,
|
||||
getBeaconTime: getBeaconTime,
|
||||
blockVerifier: blockVerifier,
|
||||
blockBlobsVerifier: blockBlobsVerifier,
|
||||
|
@ -253,7 +253,7 @@ proc fetchAncestorBlocksAndBlobsFromNetwork(rman: RequestManager,
|
|||
|
||||
|
||||
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.} =
|
||||
var rootList = newSeq[Eth2Digest]()
|
||||
|
@ -271,7 +271,7 @@ proc requestManagerLoop(rman: RequestManager) {.async.} =
|
|||
|
||||
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
|
||||
# transition, that means that we *may* request blobs for a
|
||||
# pre-eip4844. In that case, we get ResourceUnavailable from the
|
||||
|
|
|
@ -47,7 +47,7 @@ type
|
|||
|
||||
SyncManager*[A, B] = ref object
|
||||
pool: PeerPool[A, B]
|
||||
EIP4844_FORK_EPOCH: Epoch
|
||||
DENEB_FORK_EPOCH: Epoch
|
||||
responseTimeout: chronos.Duration
|
||||
maxHeadAge: uint64
|
||||
getLocalHeadSlot: GetSlotCallback
|
||||
|
@ -139,7 +139,7 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B],
|
|||
|
||||
var res = SyncManager[A, B](
|
||||
pool: pool,
|
||||
EIP4844_FORK_EPOCH: eip4844Epoch,
|
||||
DENEB_FORK_EPOCH: eip4844Epoch,
|
||||
getLocalHeadSlot: getLocalHeadSlotCb,
|
||||
getLocalWallSlot: getLocalWallSlotCb,
|
||||
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 =
|
||||
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
|
||||
e >= wallEpoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS)
|
||||
|
||||
|
|
|
@ -472,8 +472,8 @@ p2pProtocol BeaconSync(version = 1,
|
|||
Epoch(MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS)
|
||||
|
||||
epochBoundary =
|
||||
if dag.head.slot.epoch - min_epochs < dag.cfg.EIP4844_FORK_EPOCH:
|
||||
dag.cfg.EIP4844_FORK_EPOCH
|
||||
if dag.head.slot.epoch - min_epochs < dag.cfg.DENEB_FORK_EPOCH:
|
||||
dag.cfg.DENEB_FORK_EPOCH
|
||||
else:
|
||||
dag.head.slot.epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS
|
||||
minimum_request_epoch = max(dag.finalizedHead.slot.epoch, epochBoundary)
|
||||
|
|
|
@ -854,7 +854,7 @@ proc proposeBlock(node: BeaconNode,
|
|||
return newBlockMEV.get
|
||||
|
||||
let newBlock =
|
||||
if slot.epoch >= node.dag.cfg.EIP4844_FORK_EPOCH:
|
||||
if slot.epoch >= node.dag.cfg.DENEB_FORK_EPOCH:
|
||||
await makeBeaconBlockForHeadAndSlot[eip4844.ExecutionPayload](
|
||||
node, randao, validator_index, node.graffitiBytes, head, slot)
|
||||
elif slot.epoch >= node.dag.cfg.CAPELLA_FORK_EPOCH:
|
||||
|
|
|
@ -2622,7 +2622,7 @@
|
|||
"response": {
|
||||
"status": {"operator": "equals", "value": "200"},
|
||||
"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":""}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -310,7 +310,7 @@ cli do(slots = SLOTS_PER_EPOCH * 6,
|
|||
cfg.ALTAIR_FORK_EPOCH = 1.Epoch
|
||||
cfg.BELLATRIX_FORK_EPOCH = 2.Epoch
|
||||
cfg.CAPELLA_FORK_EPOCH = 3.Epoch
|
||||
cfg.EIP4844_FORK_EPOCH = 4.Epoch
|
||||
cfg.DENEB_FORK_EPOCH = 4.Epoch
|
||||
|
||||
echo "Starting simulation..."
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ func genesisTestRuntimeConfig*(stateFork: ConsensusFork): RuntimeConfig =
|
|||
var res = defaultRuntimeConfig
|
||||
case stateFork
|
||||
of ConsensusFork.EIP4844:
|
||||
res.EIP4844_FORK_EPOCH = GENESIS_EPOCH
|
||||
res.DENEB_FORK_EPOCH = GENESIS_EPOCH
|
||||
res.CAPELLA_FORK_EPOCH = GENESIS_EPOCH
|
||||
res.BELLATRIX_FORK_EPOCH = GENESIS_EPOCH
|
||||
res.ALTAIR_FORK_EPOCH = GENESIS_EPOCH
|
||||
|
|
|
@ -46,7 +46,7 @@ suite "EF - Altair - Fork " & preset():
|
|||
SszTestsDir/const_preset/"altair"/"fork"/"fork"/"pyspec_tests"
|
||||
for kind, path in walkDir(OpForkDir, relative = true, checkDir = true):
|
||||
runTest(phase0.BeaconState, altair.BeaconState, "Altair", OpForkDir,
|
||||
upgrade_to_altair, path)
|
||||
upgrade_to_altair, path)
|
||||
|
||||
from ../../beacon_chain/spec/datatypes/bellatrix import BeaconState
|
||||
|
||||
|
@ -55,7 +55,7 @@ suite "EF - Bellatrix - Fork " & preset():
|
|||
SszTestsDir/const_preset/"bellatrix"/"fork"/"fork"/"pyspec_tests"
|
||||
for kind, path in walkDir(OpForkDir, relative = true, checkDir = true):
|
||||
runTest(altair.BeaconState, bellatrix.BeaconState, "Bellatrix", OpForkDir,
|
||||
upgrade_to_bellatrix, path)
|
||||
upgrade_to_bellatrix, path)
|
||||
|
||||
from ../../beacon_chain/spec/datatypes/capella import BeaconState
|
||||
|
||||
|
@ -64,7 +64,7 @@ suite "EF - Capella - Fork " & preset():
|
|||
SszTestsDir/const_preset/"capella"/"fork"/"fork"/"pyspec_tests"
|
||||
for kind, path in walkDir(OpForkDir, relative = true, checkDir = true):
|
||||
runTest(bellatrix.BeaconState, capella.BeaconState, "Capella", OpForkDir,
|
||||
upgrade_to_capella, path)
|
||||
upgrade_to_capella, path)
|
||||
|
||||
from ../../beacon_chain/spec/datatypes/eip4844 import BeaconState
|
||||
|
||||
|
@ -73,4 +73,4 @@ suite "EF - Deneb - Fork " & preset():
|
|||
SszTestsDir/const_preset/"eip4844"/"fork"/"fork"/"pyspec_tests"
|
||||
for kind, path in walkDir(OpForkDir, relative = true, checkDir = true):
|
||||
runTest(capella.BeaconState, eip4844.BeaconState, "Deneb", OpForkDir,
|
||||
upgrade_to_eip4844, path)
|
||||
upgrade_to_eip4844, path)
|
||||
|
|
|
@ -127,7 +127,16 @@ proc runTest(path: string) =
|
|||
# Reduce stack size by making this a `proc`
|
||||
proc loadTestMeta(): (RuntimeConfig, TestMeta) =
|
||||
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
|
||||
genesis_validators_root: string
|
||||
|
|
|
@ -138,7 +138,7 @@ suite "EF - Deneb - Transition " & preset():
|
|||
for kind, path in walkDir(TransitionDir, relative = true, checkDir = true):
|
||||
let transitionInfo = getTransitionInfo(TransitionDir / path)
|
||||
var cfg = defaultRuntimeConfig
|
||||
cfg.EIP4844_FORK_EPOCH = transitionInfo.fork_epoch.Epoch
|
||||
cfg.DENEB_FORK_EPOCH = transitionInfo.fork_epoch.Epoch
|
||||
runTest(
|
||||
capella.BeaconState, eip4844.BeaconState, capella.SignedBeaconBlock,
|
||||
eip4844.SignedBeaconBlock, cfg, "EF - EIP4844 - Transition",
|
||||
|
|
|
@ -212,7 +212,7 @@ echo Wrote $RUNTIME_CONFIG_FILE:
|
|||
|
||||
tee "$RUNTIME_CONFIG_FILE" <<EOF
|
||||
PRESET_BASE: "mainnet"
|
||||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: ${TOTAL_VALIDATORS}
|
||||
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: ${NUM_VALIDATORS}
|
||||
MIN_GENESIS_TIME: 0
|
||||
GENESIS_DELAY: 10
|
||||
GENESIS_FORK_VERSION: 0x00000000
|
||||
|
|
|
@ -27,7 +27,7 @@ suite "Light client" & preset():
|
|||
res.ALTAIR_FORK_EPOCH = 1.Epoch
|
||||
res.BELLATRIX_FORK_EPOCH = 2.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
|
||||
altairStartSlot = cfg.ALTAIR_FORK_EPOCH.start_slot
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ suite "Light client processor" & preset():
|
|||
res.ALTAIR_FORK_EPOCH = 1.Epoch
|
||||
res.BELLATRIX_FORK_EPOCH = 2.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
|
||||
|
||||
const numValidators = SLOTS_PER_EPOCH
|
||||
|
|
|
@ -73,7 +73,7 @@ proc getTestStates*(
|
|||
if stateFork >= ConsensusFork.Capella:
|
||||
cfg.CAPELLA_FORK_EPOCH = 3.Epoch
|
||||
if stateFork >= ConsensusFork.EIP4844:
|
||||
cfg.EIP4844_FORK_EPOCH = 4.Epoch
|
||||
cfg.DENEB_FORK_EPOCH = 4.Epoch
|
||||
|
||||
for i, epoch in stateEpochs:
|
||||
let slot = epoch.Epoch.start_slot
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a072c89b40cf4f28a26d047bb3aeb08995955f07
|
||||
Subproject commit 51f96a0a1c4d87580065cf1f4d7f57b49872675b
|
|
@ -1 +1 @@
|
|||
Subproject commit 8e04eb74cd06f2fa1c79f41b2ab9f8f13ee7d490
|
||||
Subproject commit baebfaba3c0dcb8b6e4d5113e52fd6981253a152
|
Loading…
Reference in New Issue