From 969c6f73ae221ebbd5a551fde6b2eef6bcb87a66 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Sat, 11 Mar 2023 01:28:19 +0100 Subject: [PATCH] misc local `EIP4844` > `Deneb` bumps (#4717) * misc local `EIP4844` > `Deneb` bumps * fix --- AllTests-mainnet.md | 2 +- beacon_chain/nimbus_beacon_node.nim | 4 +-- beacon_chain/rpc/rest_beacon_api.nim | 2 +- beacon_chain/spec/beaconstate.nim | 2 +- beacon_chain/spec/datatypes/deneb.nim | 24 ++++++++--------- .../eth2_apis/eth2_rest_serialization.nim | 2 +- beacon_chain/spec/eth2_apis/rest_types.nim | 2 +- beacon_chain/spec/forks.nim | 2 +- .../spec/presets/gnosis/eip4844_preset.nim | 4 +-- .../spec/presets/mainnet/eip4844_preset.nim | 4 +-- .../spec/presets/minimal/eip4844_preset.nim | 4 +-- beacon_chain/spec/state_transition.nim | 4 +-- beacon_chain/spec/state_transition_block.nim | 26 +++++++++---------- beacon_chain/sync/request_manager.nim | 2 +- beacon_chain/sync/sync_manager.nim | 8 +++--- beacon_chain/sync/sync_protocol.nim | 4 +-- research/block_sim.nim | 4 +-- scripts/mainnet-non-overriden-config.yaml | 7 +++-- scripts/minimal-non-overriden-config.yaml | 7 +++-- tests/test_eth1_monitor.nim | 2 +- 20 files changed, 57 insertions(+), 59 deletions(-) diff --git a/AllTests-mainnet.md b/AllTests-mainnet.md index bf3fd8470..036082d87 100644 --- a/AllTests-mainnet.md +++ b/AllTests-mainnet.md @@ -167,7 +167,7 @@ OK: 10/12 Fail: 0/12 Skip: 2/12 + Rewrite HTTPS Infura URLs OK + Roundtrip engine RPC V1 and bellatrix ExecutionPayload representations OK + Roundtrip engine RPC V2 and capella ExecutionPayload representations OK -+ Roundtrip engine RPC V3 and eip4844 ExecutionPayload representations OK ++ Roundtrip engine RPC V3 and deneb ExecutionPayload representations OK ``` OK: 5/5 Fail: 0/5 Skip: 0/5 ## Eth2 specific discovery tests diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index 95e1a7437..1eda4ad6c 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1085,7 +1085,7 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} = removeAltairMessageHandlers, removeAltairMessageHandlers, # bellatrix (altair handlers, different forkDigest) removeCapellaMessageHandlers, - removeCapellaMessageHandlers # eip4844 (capella handlers, different forkDigest) + removeCapellaMessageHandlers # deneb (capella handlers, different forkDigest) ] for gossipFork in oldGossipForks: @@ -1096,7 +1096,7 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} = addAltairMessageHandlers, addAltairMessageHandlers, # bellatrix (altair handlers, different forkDigest) addCapellaMessageHandlers, - addCapellaMessageHandlers # eip4844 (capella handlers, different forkDigest) + addCapellaMessageHandlers # deneb (capella handlers, different forkDigest) ] for gossipFork in newGossipForks: diff --git a/beacon_chain/rpc/rest_beacon_api.nim b/beacon_chain/rpc/rest_beacon_api.nim index dbaab6776..20dee631d 100644 --- a/beacon_chain/rpc/rest_beacon_api.nim +++ b/beacon_chain/rpc/rest_beacon_api.nim @@ -803,7 +803,7 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) = withBlck(forked): blck.root = hash_tree_root(blck.message) - # TODO: Fetch blobs from EE when blck is eip4844.SignedBeaconBlock + # TODO: Fetch blobs from EE when blck is deneb.SignedBeaconBlock await node.router.routeSignedBeaconBlock(blck) if res.isErr(): diff --git a/beacon_chain/spec/beaconstate.nim b/beacon_chain/spec/beaconstate.nim index 848298732..bc5cac15a 100644 --- a/beacon_chain/spec/beaconstate.nim +++ b/beacon_chain/spec/beaconstate.nim @@ -921,7 +921,7 @@ proc initialize_hashed_beacon_state_from_eth1*( # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/bellatrix/beacon-chain.md#testing # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/capella/beacon-chain.md#testing -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/eip4844/beacon-chain.md#testing +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#testing proc initialize_beacon_state_from_eth1*( cfg: RuntimeConfig, eth1_block_hash: Eth2Digest, diff --git a/beacon_chain/spec/datatypes/deneb.nim b/beacon_chain/spec/datatypes/deneb.nim index 8592f8cf0..7d7989add 100644 --- a/beacon_chain/spec/datatypes/deneb.nim +++ b/beacon_chain/spec/datatypes/deneb.nim @@ -27,16 +27,16 @@ import export json_serialization, base const - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/polynomial-commitments.md#constants + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/polynomial-commitments.md#constants BYTES_PER_FIELD_ELEMENT = 32 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#blob + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#blob BLOB_TX_TYPE* = 0x05'u8 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/polynomial-commitments.md#constants + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/polynomial-commitments.md#constants BLS_MODULUS* = "52435875175126190479447740508185965837690552500527637822603658699938581184513".u256 - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.0/specs/eip4844/p2p-interface.md#configuration - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS* = 4096'u64 + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/p2p-interface.md#configuration + MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS* = 4096'u64 type # this block belongs elsewhere - will figure out after implementing c-kzg bindings @@ -366,7 +366,7 @@ type state_root*: Eth2Digest body*: TrustedBeaconBlockBody - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#beaconblockbody + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#beaconblockbody BeaconBlockBody* = object randao_reveal*: ValidatorSig eth1_data*: Eth1Data @@ -385,9 +385,9 @@ type sync_aggregate*: SyncAggregate # Execution - execution_payload*: ExecutionPayload + execution_payload*: ExecutionPayload # [Modified in Deneb] bls_to_execution_changes*: SignedBLSToExecutionChangeList - blob_kzg_commitments*: KZGCommitments # [New in EIP-4844] + blob_kzg_commitments*: KZGCommitments # [New in Deneb] SigVerifiedBeaconBlockBody* = object ## A BeaconBlock body with signatures verified @@ -420,9 +420,9 @@ type sync_aggregate*: TrustedSyncAggregate # Execution - execution_payload*: ExecutionPayload + execution_payload*: ExecutionPayload # [Modified in Deneb] bls_to_execution_changes*: SignedBLSToExecutionChangeList - blob_kzg_commitments*: List[KZGCommitment, Limit MAX_BLOBS_PER_BLOCK] # [New in EIP-4844] + blob_kzg_commitments*: List[KZGCommitment, Limit MAX_BLOBS_PER_BLOCK] # [New in Deneb] TrustedBeaconBlockBody* = object ## A full verified block @@ -443,9 +443,9 @@ type sync_aggregate*: TrustedSyncAggregate # Execution - execution_payload*: ExecutionPayload + execution_payload*: ExecutionPayload # [Modified in Deneb] bls_to_execution_changes*: SignedBLSToExecutionChangeList - blob_kzg_commitments*: List[KZGCommitment, Limit MAX_BLOBS_PER_BLOCK] # [New in EIP-4844] + blob_kzg_commitments*: List[KZGCommitment, Limit MAX_BLOBS_PER_BLOCK] # [New in Deneb] # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/phase0/beacon-chain.md#signedbeaconblock SignedBeaconBlock* = object diff --git a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim index 18a34710f..3db5a5d54 100644 --- a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim +++ b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim @@ -1773,7 +1773,7 @@ proc readValue*(reader: var JsonReader[RestJson], requireAllFields = true, allowUnknownFields = true) except SerializationError: - reader.raiseUnexpectedValue("Incorrect EIP4844 beacon state format") + reader.raiseUnexpectedValue("Incorrect deneb beacon state format") toValue(denebData) proc writeValue*(writer: var JsonWriter[RestJson], value: ForkedHashedBeaconState) diff --git a/beacon_chain/spec/eth2_apis/rest_types.nim b/beacon_chain/spec/eth2_apis/rest_types.nim index 4c054c581..54daffcbb 100644 --- a/beacon_chain/spec/eth2_apis/rest_types.nim +++ b/beacon_chain/spec/eth2_apis/rest_types.nim @@ -311,7 +311,7 @@ type of ConsensusFork.Altair: altairBody*: altair.BeaconBlockBody of ConsensusFork.Bellatrix: bellatrixBody*: bellatrix.BeaconBlockBody of ConsensusFork.Capella: capellaBody*: capella.BeaconBlockBody - of ConsensusFork.Deneb: eip4844Body*: deneb.BeaconBlockBody + of ConsensusFork.Deneb: denebBody*: deneb.BeaconBlockBody RestSpec* = object # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/presets/mainnet/phase0.yaml diff --git a/beacon_chain/spec/forks.nim b/beacon_chain/spec/forks.nim index a58fec397..1ef7337f6 100644 --- a/beacon_chain/spec/forks.nim +++ b/beacon_chain/spec/forks.nim @@ -417,7 +417,7 @@ template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: bellatrix.MsgTru template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: capella.MsgTrustedSignedBeaconBlock): T = T(kind: ConsensusFork.Capella, capellaData: blck) template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: deneb.MsgTrustedSignedBeaconBlock): T = - T(kind: ConsensusFork.Deneb, eip4844Data: blck) + T(kind: ConsensusFork.Deneb, denebData: blck) template init*(T: type ForkedTrustedSignedBeaconBlock, blck: phase0.TrustedSignedBeaconBlock): T = T(kind: ConsensusFork.Phase0, phase0Data: blck) diff --git a/beacon_chain/spec/presets/gnosis/eip4844_preset.nim b/beacon_chain/spec/presets/gnosis/eip4844_preset.nim index 7444a23e2..388107520 100644 --- a/beacon_chain/spec/presets/gnosis/eip4844_preset.nim +++ b/beacon_chain/spec/presets/gnosis/eip4844_preset.nim @@ -1,5 +1,5 @@ -# Mainnet preset - EIP-4844 -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/presets/mainnet/eip4844.yaml +# Mainnet preset - Deneb +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/presets/mainnet/deneb.yaml const # `uint64(4096)` FIELD_ELEMENTS_PER_BLOB*: uint64 = 4096 diff --git a/beacon_chain/spec/presets/mainnet/eip4844_preset.nim b/beacon_chain/spec/presets/mainnet/eip4844_preset.nim index 7444a23e2..388107520 100644 --- a/beacon_chain/spec/presets/mainnet/eip4844_preset.nim +++ b/beacon_chain/spec/presets/mainnet/eip4844_preset.nim @@ -1,5 +1,5 @@ -# Mainnet preset - EIP-4844 -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/presets/mainnet/eip4844.yaml +# Mainnet preset - Deneb +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/presets/mainnet/deneb.yaml const # `uint64(4096)` FIELD_ELEMENTS_PER_BLOB*: uint64 = 4096 diff --git a/beacon_chain/spec/presets/minimal/eip4844_preset.nim b/beacon_chain/spec/presets/minimal/eip4844_preset.nim index 634657644..ad571ac68 100644 --- a/beacon_chain/spec/presets/minimal/eip4844_preset.nim +++ b/beacon_chain/spec/presets/minimal/eip4844_preset.nim @@ -1,5 +1,5 @@ -# Minimal preset - EIP-4844 -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/presets/minimal/eip4844.yaml +# Minimal preset - Deneb +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/presets/minimal/deneb.yaml const # [customized] FIELD_ELEMENTS_PER_BLOB*: uint64 = 4 diff --git a/beacon_chain/spec/state_transition.nim b/beacon_chain/spec/state_transition.nim index 85c2cd168..31722d56d 100644 --- a/beacon_chain/spec/state_transition.nim +++ b/beacon_chain/spec/state_transition.nim @@ -165,7 +165,7 @@ func noRollback*(state: var capella.HashedBeaconState) = from ./datatypes/deneb import HashedBeaconState func noRollback*(state: var deneb.HashedBeaconState) = - trace "Skipping rollback of broken EIP4844 state" + trace "Skipping rollback of broken Deneb state" func maybeUpgradeStateToAltair( cfg: RuntimeConfig, state: var ForkedHashedBeaconState) = @@ -598,7 +598,7 @@ proc makeBeaconBlock*( case state.kind of ConsensusFork.Phase0, ConsensusFork.Altair, ConsensusFork.Bellatrix, ConsensusFork.Capella: - raiseAssert "Attempt to use EIP4844 payload with non-EIP4844 state" + raiseAssert "Attempt to use Deneb payload with non-Deneb state" of ConsensusFork.Deneb: makeBeaconBlock(deneb) else: {.error: "You need to add support for the next fork".} diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index 98737b74f..795b69328 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -595,7 +595,7 @@ proc process_execution_payload*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#process_execution_payload +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#process_execution_payload proc process_execution_payload*( state: var deneb.BeaconState, payload: deneb.ExecutionPayload, notify_new_payload: deneb.ExecutePayload): Result[void, cstring] = @@ -631,11 +631,11 @@ proc process_execution_payload*( gas_used: payload.gas_used, timestamp: payload.timestamp, base_fee_per_gas: payload.base_fee_per_gas, - excess_data_gas: payload.excess_data_gas, # [New in EIP-4844] block_hash: payload.block_hash, extra_data: payload.extra_data, transactions_root: hash_tree_root(payload.transactions), - withdrawals_root: hash_tree_root(payload.withdrawals)) + withdrawals_root: hash_tree_root(payload.withdrawals), + excess_data_gas: payload.excess_data_gas) # [New in Deneb] ok() @@ -681,11 +681,11 @@ func process_withdrawals*( ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#tx_peek_blob_versioned_hashes +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#tx_peek_blob_versioned_hashes func tx_peek_blob_versioned_hashes(opaque_tx: Transaction): Result[seq[VersionedHash], cstring] = ## This function retrieves the hashes from the `SignedBlobTransaction` as - ## defined in EIP-4844, using SSZ offsets. Offsets are little-endian `uint32` + ## defined in Deneb, using SSZ offsets. Offsets are little-endian `uint32` ## values, as defined in the SSZ specification. See the full details of ## `blob_versioned_hashes` offset calculation. if not (opaque_tx[0] == BLOB_TX_TYPE): @@ -710,10 +710,10 @@ func tx_peek_blob_versioned_hashes(opaque_tx: Transaction): res.add versionedHash ok res -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#kzg_commitment_to_versioned_hash +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#kzg_commitment_to_versioned_hash func kzg_commitment_to_versioned_hash( kzg_commitment: deneb.KZGCommitment): VersionedHash = - # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#blob + # https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#blob const VERSIONED_HASH_VERSION_KZG = 0x01'u8 var res: VersionedHash @@ -721,7 +721,7 @@ func kzg_commitment_to_versioned_hash( res[1 .. 31] = eth2digest(kzg_commitment).data.toOpenArray(1, 31) res -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#verify_kzg_commitments_against_transactions +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#verify_kzg_commitments_against_transactions func verify_kzg_commitments_against_transactions*( transactions: seq[Transaction], kzg_commitments: seq[deneb.KZGCommitment]): bool = @@ -738,7 +738,7 @@ func verify_kzg_commitments_against_transactions*( all_versioned_hashes == mapIt(kzg_commitments, it.kzg_commitment_to_versioned_hash) -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/beacon-chain.md#blob-kzg-commitments +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/beacon-chain.md#blob-kzg-commitments func process_blob_kzg_commitments( state: var deneb.BeaconState, body: deneb.BeaconBlockBody | deneb.TrustedBeaconBlockBody | @@ -771,7 +771,7 @@ proc validate_blobs_sidecar*(slot: Slot, root: Eth2Digest, ok() -# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.2/specs/eip4844/fork-choice.md#is_data_available +# https://github.com/ethereum/consensus-specs/blob/v1.3.0-rc.3/specs/deneb/fork-choice.md#is_data_available func is_data_available( slot: Slot, beacon_block_root: Eth2Digest, blob_kzg_commitments: seq[deneb.KZGCommitment]): bool = @@ -894,11 +894,11 @@ proc process_block*( # https://github.com/ethereum/consensus-specs/blob/v1.3.0-alpha.2/specs/eip4844/beacon-chain.md#block-processing # TODO workaround for https://github.com/nim-lang/Nim/issues/18095 -type SomeEIP4844Block = +type SomeDenebBlock = deneb.BeaconBlock | deneb.SigVerifiedBeaconBlock | deneb.TrustedBeaconBlock proc process_block*( cfg: RuntimeConfig, - state: var deneb.BeaconState, blck: SomeEIP4844Block, + state: var deneb.BeaconState, blck: SomeDenebBlock, flags: UpdateFlags, cache: var StateCache): Result[void, cstring]= ## When there's a new block, we need to verify that the block is sane and ## update the state accordingly - the state is left in an unknown state when @@ -922,7 +922,7 @@ proc process_block*( ? process_sync_aggregate( state, blck.body.sync_aggregate, total_active_balance, cache) - ? process_blob_kzg_commitments(state, blck.body) # [New in EIP-4844] + ? process_blob_kzg_commitments(state, blck.body) # [New in Deneb] # New in EIP-4844 if not is_data_available( diff --git a/beacon_chain/sync/request_manager.nim b/beacon_chain/sync/request_manager.nim index dd7a1e4e7..10ee8ae02 100644 --- a/beacon_chain/sync/request_manager.nim +++ b/beacon_chain/sync/request_manager.nim @@ -53,7 +53,7 @@ func shortLog*(x: seq[FetchRecord]): string = "[" & x.mapIt(shortLog(it.root)).join(", ") & "]" proc init*(T: type RequestManager, network: Eth2Node, - eip4844Epoch: Epoch, + denebEpoch: Epoch, getBeaconTime: GetBeaconTimeFn, blockVerifier: BlockVerifier): RequestManager = RequestManager( diff --git a/beacon_chain/sync/sync_manager.nim b/beacon_chain/sync/sync_manager.nim index 0cfda4774..48aa85e00 100644 --- a/beacon_chain/sync/sync_manager.nim +++ b/beacon_chain/sync/sync_manager.nim @@ -117,7 +117,7 @@ proc initQueue[A, B](man: SyncManager[A, B]) = man.ident) proc newSyncManager*[A, B](pool: PeerPool[A, B], - eip4844Epoch: Epoch, + denebEpoch: Epoch, direction: SyncQueueKind, getLocalHeadSlotCb: GetSlotCallback, getLocalWallSlotCb: GetSlotCallback, @@ -140,7 +140,7 @@ proc newSyncManager*[A, B](pool: PeerPool[A, B], var res = SyncManager[A, B]( pool: pool, - DENEB_FORK_EPOCH: eip4844Epoch, + DENEB_FORK_EPOCH: denebEpoch, getLocalHeadSlot: getLocalHeadSlotCb, getLocalWallSlot: getLocalWallSlotCb, getSafeSlot: getSafeSlot, @@ -191,8 +191,8 @@ 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.DENEB_FORK_EPOCH and - (wallEpoch < MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS or - e >= wallEpoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS) + (wallEpoch < MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS or + e >= wallEpoch - MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS) proc getBlobSidecars*[A, B](man: SyncManager[A, B], peer: A, req: SyncRequest): Future[BlobSidecarsRes] {.async.} = diff --git a/beacon_chain/sync/sync_protocol.nim b/beacon_chain/sync/sync_protocol.nim index e041ba60d..33b6984a7 100644 --- a/beacon_chain/sync/sync_protocol.nim +++ b/beacon_chain/sync/sync_protocol.nim @@ -504,10 +504,10 @@ p2pProtocol BeaconSync(version = 1, let dag = peer.networkState.dag epochBoundary = - if MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS >= dag.head.slot.epoch: + if MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS >= dag.head.slot.epoch: GENESIS_EPOCH else: - dag.head.slot.epoch - MIN_EPOCHS_FOR_BLOBS_SIDECARS_REQUESTS + dag.head.slot.epoch - MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS if startSlot.epoch < epochBoundary: raise newException(ResourceUnavailableError, BlobsOutOfRange) diff --git a/research/block_sim.nim b/research/block_sim.nim index deb1f40a8..1b32fa17e 100644 --- a/research/block_sim.nim +++ b/research/block_sim.nim @@ -633,7 +633,7 @@ cli do(slots = SLOTS_PER_EPOCH * 6, do: raiseAssert "withUpdatedState failed" - proc proposeEIP4844Block(slot: Slot) = + proc proposeDenebBlock(slot: Slot) = if rand(r, 1.0) > blockRatio: return @@ -695,7 +695,7 @@ cli do(slots = SLOTS_PER_EPOCH * 6, if blockRatio > 0.0: withTimer(timers[t]): case dag.cfg.consensusForkAtEpoch(slot.epoch) - of ConsensusFork.Deneb: proposeEIP4844Block(slot) + of ConsensusFork.Deneb: proposeDenebBlock(slot) of ConsensusFork.Capella: proposeCapellaBlock(slot) of ConsensusFork.Bellatrix: proposeBellatrixBlock(slot) of ConsensusFork.Altair: proposeAltairBlock(slot) diff --git a/scripts/mainnet-non-overriden-config.yaml b/scripts/mainnet-non-overriden-config.yaml index e63447dcb..20bd44e1b 100644 --- a/scripts/mainnet-non-overriden-config.yaml +++ b/scripts/mainnet-non-overriden-config.yaml @@ -54,9 +54,9 @@ BELLATRIX_FORK_VERSION: 0x02000000 # Capella CAPELLA_FORK_VERSION: 0x03000000 # (overriden in launch_local_testnet.sh) CAPELLA_FORK_EPOCH: 18446744073709551615 -# EIP4844 -EIP4844_FORK_VERSION: 0x04000000 -# (overriden in launch_local_testnet.sh) EIP4844_FORK_EPOCH: 18446744073709551615 +# Deneb +DENEB_FORK_VERSION: 0x04000000 +# (overriden in launch_local_testnet.sh) DENEB_FORK_EPOCH: 18446744073709551615 @@ -100,4 +100,3 @@ PROPOSER_SCORE_BOOST: 40 DEPOSIT_CHAIN_ID: 1 DEPOSIT_NETWORK_ID: 1 # (overriden in launch_local_testnet.sh) DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa - diff --git a/scripts/minimal-non-overriden-config.yaml b/scripts/minimal-non-overriden-config.yaml index a9dabf4ca..4a2186c6b 100644 --- a/scripts/minimal-non-overriden-config.yaml +++ b/scripts/minimal-non-overriden-config.yaml @@ -53,9 +53,9 @@ BELLATRIX_FORK_VERSION: 0x02000001 # Capella CAPELLA_FORK_VERSION: 0x03000001 # (overriden in launch_local_testnet.sh) CAPELLA_FORK_EPOCH: 18446744073709551615 -# EIP4844 -EIP4844_FORK_VERSION: 0x04000001 -# (overriden in launch_local_testnet.sh) EIP4844_FORK_EPOCH: 18446744073709551615 +# Deneb +DENEB_FORK_VERSION: 0x04000001 +# (overriden in launch_local_testnet.sh) DENEB_FORK_EPOCH: 18446744073709551615 # Time parameters @@ -99,4 +99,3 @@ DEPOSIT_CHAIN_ID: 5 DEPOSIT_NETWORK_ID: 5 # Configured on a per testnet basis # (overriden in launch_local_testnet.sh) DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890 - diff --git a/tests/test_eth1_monitor.nim b/tests/test_eth1_monitor.nim index 065af3ed8..ac17d86be 100644 --- a/tests/test_eth1_monitor.nim +++ b/tests/test_eth1_monitor.nim @@ -1023,7 +1023,7 @@ suite "Eth1 monitor": executionPayload == asConsensusType( asEngineExecutionPayload(executionPayload)) - test "Roundtrip engine RPC V3 and eip4844 ExecutionPayload representations": + test "Roundtrip engine RPC V3 and deneb ExecutionPayload representations": # Each Eth2Digest field is chosen randomly. Each uint64 field is random, # with boosted probabilities for 0, 1, and high(uint64). There can be 0, # 1, 2, or 3 transactions uniformly. Each transaction is 0, 8, 13, or 16