diff --git a/beacon_chain/beacon_chain_db_immutable.nim b/beacon_chain/beacon_chain_db_immutable.nim index bcf2b1caa1..ef7b006185 100644 --- a/beacon_chain/beacon_chain_db_immutable.nim +++ b/beacon_chain/beacon_chain_db_immutable.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021-2024 Status Research & Development GmbH +# Copyright (c) 2021-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/beacon_node_light_client.nim b/beacon_chain/beacon_node_light_client.nim index ab98dbcac3..e516dc6223 100644 --- a/beacon_chain/beacon_node_light_client.nim +++ b/beacon_chain/beacon_node_light_client.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2022-2024 Status Research & Development GmbH +# Copyright (c) 2022-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/consensus_object_pools/blob_quarantine.nim b/beacon_chain/consensus_object_pools/blob_quarantine.nim index 7deaf9d8d6..41b6861525 100644 --- a/beacon_chain/consensus_object_pools/blob_quarantine.nim +++ b/beacon_chain/consensus_object_pools/blob_quarantine.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/consensus_object_pools/block_dag.nim b/beacon_chain/consensus_object_pools/block_dag.nim index 4a81027ea0..34405ce8c5 100644 --- a/beacon_chain/consensus_object_pools/block_dag.nim +++ b/beacon_chain/consensus_object_pools/block_dag.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/consensus_object_pools/blockchain_dag.nim b/beacon_chain/consensus_object_pools/blockchain_dag.nim index 8be0d99fac..05d639b4cf 100644 --- a/beacon_chain/consensus_object_pools/blockchain_dag.nim +++ b/beacon_chain/consensus_object_pools/blockchain_dag.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/consensus_object_pools/blockchain_list.nim b/beacon_chain/consensus_object_pools/blockchain_list.nim index 95a38249ec..5ae36b34f7 100644 --- a/beacon_chain/consensus_object_pools/blockchain_list.nim +++ b/beacon_chain/consensus_object_pools/blockchain_list.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/consensus_object_pools/data_column_quarantine.nim b/beacon_chain/consensus_object_pools/data_column_quarantine.nim index 20e9ed7846..2c22a53a23 100644 --- a/beacon_chain/consensus_object_pools/data_column_quarantine.nim +++ b/beacon_chain/consensus_object_pools/data_column_quarantine.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/el/el_manager.nim b/beacon_chain/el/el_manager.nim index 3f18b2e9e8..cfe6bc54ab 100644 --- a/beacon_chain/el/el_manager.nim +++ b/beacon_chain/el/el_manager.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/el/engine_api_conversions.nim b/beacon_chain/el/engine_api_conversions.nim index 1e7a9de05f..e940bd047c 100644 --- a/beacon_chain/el/engine_api_conversions.nim +++ b/beacon_chain/el/engine_api_conversions.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2024 Status Research & Development GmbH +# Copyright (c) 2024-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/gossip_processing/block_processor.nim b/beacon_chain/gossip_processing/block_processor.nim index 4c93339cc7..7231ccdc7e 100644 --- a/beacon_chain/gossip_processing/block_processor.nim +++ b/beacon_chain/gossip_processing/block_processor.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -302,7 +302,7 @@ proc newExecutionPayload*( blck.body.execution_payload else: debug "Block body does not support execution payload" - nil + default(electra.ExecutionPayload) if not elManager.hasProperlyConfiguredConnection: if elManager.hasConnection: diff --git a/beacon_chain/gossip_processing/gossip_validation.nim b/beacon_chain/gossip_processing/gossip_validation.nim index 90cb46eac2..4207c213e7 100644 --- a/beacon_chain/gossip_processing/gossip_validation.nim +++ b/beacon_chain/gossip_processing/gossip_validation.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2019-2024 Status Research & Development GmbH +# Copyright (c) 2019-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/nimbus_beacon_node.nim b/beacon_chain/nimbus_beacon_node.nim index b60111a16d..80f8c801db 100644 --- a/beacon_chain/nimbus_beacon_node.nim +++ b/beacon_chain/nimbus_beacon_node.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/nimbus_light_client.nim b/beacon_chain/nimbus_light_client.nim index 519b1e89db..2d2a5403f9 100644 --- a/beacon_chain/nimbus_light_client.nim +++ b/beacon_chain/nimbus_light_client.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2022-2024 Status Research & Development GmbH +# Copyright (c) 2022-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -111,7 +111,8 @@ programMain: signedBlock: ForkedSignedBeaconBlock ): Future[void] {.async: (raises: [CancelledError]).} = withBlck(signedBlock): - when consensusFork >= ConsensusFork.Bellatrix: + when consensusFork >= ConsensusFork.Bellatrix and + consensusFork < ConsensusFork.Fulu: if forkyBlck.message.is_execution_block: template payload(): auto = forkyBlck.message.body.execution_payload if elManager != nil and not payload.block_hash.isZero: diff --git a/beacon_chain/spec/beacon_time.nim b/beacon_chain/spec/beacon_time.nim index aac8082ab7..90bad916d8 100644 --- a/beacon_chain/spec/beacon_time.nim +++ b/beacon_chain/spec/beacon_time.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/beaconstate.nim b/beacon_chain/spec/beaconstate.nim index fe10a90fd4..c6b6005c85 100644 --- a/beacon_chain/spec/beaconstate.nim +++ b/beacon_chain/spec/beaconstate.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/datatypes/constants.nim b/beacon_chain/spec/datatypes/constants.nim index d96647a069..84904c771e 100644 --- a/beacon_chain/spec/datatypes/constants.nim +++ b/beacon_chain/spec/datatypes/constants.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2022-2024 Status Research & Development GmbH +# Copyright (c) 2022-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/datatypes/fulu.nim b/beacon_chain/spec/datatypes/fulu.nim index df385a529a..0eeeac47f8 100644 --- a/beacon_chain/spec/datatypes/fulu.nim +++ b/beacon_chain/spec/datatypes/fulu.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2024 Status Research & Development GmbH +# Copyright (c) 2024-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -20,7 +20,6 @@ import ssz_serialization/[merkleization, proofs], ssz_serialization/types as sszTypes, kzg4844/[kzg, kzg_abi], - std/typetraits, chronicles, ../digest, "."/[base, phase0, electra], @@ -36,11 +35,6 @@ from ./capella import ExecutionBranch, HistoricalSummary, SignedBLSToExecutionChangeList, Withdrawal, EXECUTION_PAYLOAD_GINDEX from ./deneb import Blobs, BlobsBundle, KzgCommitments, KzgProofs -from ./electra import - PendingDeposit, PendingPartialWithdrawal, - PendingConsolidation, ExecutionPayload, Attestation, TrustedAttestation, - ElectraCommitteeValidatorsBits,AttesterSlashing, AttestationCommitteeBits, - FINALIZED_ROOT_GINDEX_ELECTRA, ExecutionRequests export json_serialization, base, kzg4844 @@ -130,16 +124,16 @@ const PTC_SIZE* = 512 # https://github.com/ethereum/consensus-specs/blob/v1.5.0-alpha.4/specs/_features/eip7732/beacon-chain.md#max-operations-per-block - MAX_PAYLOAD_ATTESTATIONS = 4 + MAX_PAYLOAD_ATTESTATIONS* = 4 type PTCStatus* = distinct uint64 # https://github.com/ethereum/consensus-specs/blob/dev/specs/_features/eip7732/beacon-chain.md#payloadattestationdata PayloadAttestationData* = object - beaconBlockRoot*: Eth2Digest + beacon_block_root*: Eth2Digest slot*: Slot - payload_Status*: uint8 + payload_status*: uint8 # https://github.com/ethereum/consensus-specs/blob/dev/specs/_features/eip7732/beacon-chain.md#payloadattestation PayloadAttestation* = object @@ -155,7 +149,7 @@ type # https://github.com/ethereum/consensus-specs/blob/dev/specs/_features/eip7732/beacon-chain.md#indexedpayloadattestation IndexedPayloadAttestation* = object - attestingIndices*: List[ValidatorIndex, Limit PTC_SIZE] + attesting_indices*: List[ValidatorIndex, Limit PTC_SIZE] data*: PayloadAttestationData signature*: ValidatorSig @@ -630,9 +624,9 @@ func initHashedBeaconState*(s: BeaconState): HashedBeaconState = func shortLog*(v: PayloadAttestationData): auto = ( - beaconBlockRoot: shortLog(v.beaconBlockRoot), + beacon_block_root: shortLog(v.beacon_block_root), slot: shortLog(v.slot), - payload_Status: $v.payload_Status + payload_status: $v.payload_status ) func shortLog*(v: SomeBeaconBlock): auto = diff --git a/beacon_chain/spec/eip7594_helpers.nim b/beacon_chain/spec/eip7594_helpers.nim index 036d258752..1bfd4378da 100644 --- a/beacon_chain/spec/eip7594_helpers.nim +++ b/beacon_chain/spec/eip7594_helpers.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/eip7732_helpers.nim b/beacon_chain/spec/eip7732_helpers.nim index c562eca0fa..3e28db1c0e 100644 --- a/beacon_chain/spec/eip7732_helpers.nim +++ b/beacon_chain/spec/eip7732_helpers.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2024 Status Research & Development GmbH +# Copyright (c) 2024-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim index e5fde6b128..7ee3dc5fc3 100644 --- a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim +++ b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/forks_light_client.nim b/beacon_chain/spec/forks_light_client.nim index e664bcec37..a8cf90e0d6 100644 --- a/beacon_chain/spec/forks_light_client.nim +++ b/beacon_chain/spec/forks_light_client.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2023-2024 Status Research & Development GmbH +# Copyright (c) 2023-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/helpers.nim b/beacon_chain/spec/helpers.nim index 7ec080ffe8..26f3c8b7ce 100644 --- a/beacon_chain/spec/helpers.nim +++ b/beacon_chain/spec/helpers.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/helpers_el.nim b/beacon_chain/spec/helpers_el.nim index 5451cd14b0..1e0dbff1b6 100644 --- a/beacon_chain/spec/helpers_el.nim +++ b/beacon_chain/spec/helpers_el.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2024 Status Research & Development GmbH +# Copyright (c) 2024-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/mev/fulu_mev.nim b/beacon_chain/spec/mev/fulu_mev.nim index 0ddc9d976a..7b72442eb2 100644 --- a/beacon_chain/spec/mev/fulu_mev.nim +++ b/beacon_chain/spec/mev/fulu_mev.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2024 Status Research & Development GmbH +# Copyright (c) 2024-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -40,10 +40,10 @@ type deposits*: List[Deposit, Limit MAX_DEPOSITS] voluntary_exits*: List[SignedVoluntaryExit, Limit MAX_VOLUNTARY_EXITS] sync_aggregate*: SyncAggregate - signed_execution_payload_header*: SignedExecutionPayloadHeader bls_to_execution_changes*: - List[SignedBLSToExecutionChange, - Limit MAX_BLS_TO_EXECUTION_CHANGES] + List[SignedBLSToExecutionChange, Limit MAX_BLS_TO_EXECUTION_CHANGES] + signed_execution_payload_header*: SignedExecutionPayloadHeader + payload_attestations*: List[PayloadAttestation, Limit MAX_PAYLOAD_ATTESTATIONS] # blob_kzg_commitments*: KzgCommitments # [New in Deneb] # execution_requests*: ExecutionRequests # [New in Electra] @@ -124,6 +124,7 @@ func toSignedBlindedBeaconBlock*(blck: fulu.SignedBeaconBlock): deposits: blck.message.body.deposits, voluntary_exits: blck.message.body.voluntary_exits, sync_aggregate: blck.message.body.sync_aggregate, + bls_to_execution_changes: blck.message.body.bls_to_execution_changes, signed_execution_payload_header: SignedExecutionPayloadHeader( message: ExecutionPayloadHeader( parent_block_hash: blck.message.body.signed_execution_payload_header.message.parent_block_hash, @@ -135,6 +136,6 @@ func toSignedBlindedBeaconBlock*(blck: fulu.SignedBeaconBlock): blob_kzg_commitments_root: blck.message.body.signed_execution_payload_header.message.blob_kzg_commitments_root, block_hash: blck.message.body.signed_execution_payload_header.message.block_hash ), - signature: blck.signature), - bls_to_execution_changes: blck.message.body.bls_to_execution_changes)), + signature: blck.message.body.signed_execution_payload_header.signature), + payload_attestations: blck.message.body.payload_attestations)), signature: blck.signature) diff --git a/beacon_chain/spec/network.nim b/beacon_chain/spec/network.nim index f6564dc4fc..91b7ab0f41 100644 --- a/beacon_chain/spec/network.nim +++ b/beacon_chain/spec/network.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/signatures.nim b/beacon_chain/spec/signatures.nim index b2ab7a0997..10c5340951 100644 --- a/beacon_chain/spec/signatures.nim +++ b/beacon_chain/spec/signatures.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/state_transition.nim b/beacon_chain/spec/state_transition.nim index c0d30d0694..1e8d0e5fd5 100644 --- a/beacon_chain/spec/state_transition.nim +++ b/beacon_chain/spec/state_transition.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/spec/state_transition_block.nim b/beacon_chain/spec/state_transition_block.nim index 3e91f3f92a..80c6f05a37 100644 --- a/beacon_chain/spec/state_transition_block.nim +++ b/beacon_chain/spec/state_transition_block.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/sync/request_manager.nim b/beacon_chain/sync/request_manager.nim index f35d7e030b..608d7e9d5f 100644 --- a/beacon_chain/sync/request_manager.nim +++ b/beacon_chain/sync/request_manager.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/sync/sync_manager.nim b/beacon_chain/sync/sync_manager.nim index 77be5bd511..e15f161697 100644 --- a/beacon_chain/sync/sync_manager.nim +++ b/beacon_chain/sync/sync_manager.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/validators/beacon_validators.nim b/beacon_chain/validators/beacon_validators.nim index 953c1cb695..b9f0b8c383 100644 --- a/beacon_chain/validators/beacon_validators.nim +++ b/beacon_chain/validators/beacon_validators.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/validators/message_router.nim b/beacon_chain/validators/message_router.nim index 4321f4d2b3..f0b402b744 100644 --- a/beacon_chain/validators/message_router.nim +++ b/beacon_chain/validators/message_router.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/beacon_chain/validators/message_router_mev.nim b/beacon_chain/validators/message_router_mev.nim index 39efdbe720..43dff7e115 100644 --- a/beacon_chain/validators/message_router_mev.nim +++ b/beacon_chain/validators/message_router_mev.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2022-2024 Status Research & Development GmbH +# Copyright (c) 2022-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/ncli/ncli_testnet.nim b/ncli/ncli_testnet.nim index d0367b9ff7..ec8b6bb651 100644 --- a/ncli/ncli_testnet.nim +++ b/ncli/ncli_testnet.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/research/mev_mock.nim b/research/mev_mock.nim index be9840babc..9f0d148164 100644 --- a/research/mev_mock.nim +++ b/research/mev_mock.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2023-2024 Status Research & Development GmbH +# Copyright (c) 2023-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -50,13 +50,27 @@ proc getParentBlock(restClient: RestClientRef): return Opt.none ParentHeaderInfo withBlck(resp): - when consensusFork >= ConsensusFork.Capella: - return Opt.some ParentHeaderInfo( - block_number: forkyBlck.message.body.execution_payload.block_number, - timestamp: forkyBlck.message.body.execution_payload.timestamp) + when consensusFork >= ConsensusFork.Capella and + consensusFork < ConsensusFork.Fulu: + return Opt.some ParentHeaderInfo( + block_number: forkyBlck.message.body.execution_payload.block_number, + timestamp: forkyBlck.message.body.execution_payload.timestamp) else: discard + # TODO {what is expected of eip-7732 blocks} + # withBlck(resp): + # when consensusFork >= ConsensusFork.Fulu: + # return Opt.some ParentHeaderInfo( + # block_: forkyBlck.message.body.signed_execution_payload_header.message, + # timestamp: forkyBlck.message.signed_execution_payload_header.message) + # elif consensusFork >= ConsensusFork.Capella: + # return Opt.some ParentHeaderInfo( + # block_number: forkyBlck.message.body.execution_payload.block_number, + # timestamp: forkyBlck.message.body.execution_payload.timestamp) + # else: + # discard + proc getWithdrawals(restClient: RestClientRef): Future[Opt[seq[Withdrawal]]] {.async.} = let resp: RestResponse[rest_types.GetNextWithdrawalsResponse] = diff --git a/research/wss_sim.nim b/research/wss_sim.nim index 72fddb6b75..7b8219556f 100644 --- a/research/wss_sim.nim +++ b/research/wss_sim.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2022-2024 Status Research & Development GmbH +# Copyright (c) 2022-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -119,27 +119,28 @@ cli do(validatorsDir: string, secretsDir: string, # The EL may otherwise refuse to produce new heads elManager.start(syncChain = false) withBlck(blck[]): - when consensusFork >= ConsensusFork.Bellatrix: - if forkyBlck.message.is_execution_block: - template payload(): auto = forkyBlck.message.body.execution_payload - if not payload.block_hash.isZero: - notice "Syncing EL", elUrl, jwtSecret - while true: - waitFor noCancel sleepAsync(chronos.seconds(2)) - (waitFor noCancel elManager - .newExecutionPayload(forkyBlck.message)).isOkOr: - continue - - let (status, _) = waitFor noCancel elManager.forkchoiceUpdated( - headBlockHash = payload.block_hash, - safeBlockHash = payload.block_hash, - finalizedBlockHash = ZERO_HASH, - payloadAttributes = Opt.none(consensusFork.PayloadAttributes)) - if status != PayloadExecutionStatus.valid: - continue - - notice "EL synced", elUrl, jwtSecret - break + when consensusFork >= ConsensusFork.Bellatrix and + consensusFork < ConsensusFork.Fulu: + if forkyBlck.message.is_execution_block: + template payload(): auto = forkyBlck.message.body.execution_payload + if not payload.block_hash.isZero: + notice "Syncing EL", elUrl, jwtSecret + while true: + waitFor noCancel sleepAsync(chronos.seconds(2)) + (waitFor noCancel elManager + .newExecutionPayload(forkyBlck.message)).isOkOr: + continue + + let (status, _) = waitFor noCancel elManager.forkchoiceUpdated( + headBlockHash = payload.block_hash, + safeBlockHash = payload.block_hash, + finalizedBlockHash = ZERO_HASH, + payloadAttributes = Opt.none(consensusFork.PayloadAttributes)) + if status != PayloadExecutionStatus.valid: + continue + + notice "EL synced", elUrl, jwtSecret + break var clock = BeaconClock.init(getStateField(state[], genesis_time)).valueOr: diff --git a/tests/all_tests.nim b/tests/all_tests.nim index c9df26277b..28ac4d1e4d 100644 --- a/tests/all_tests.nim +++ b/tests/all_tests.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -7,7 +7,7 @@ {.push raises: [].} -# All tests except scenarios, which as compiled separately for mainnet and minimal +# All tests except scenarios, which is compiled separately for mainnet and minimal import ./testutil diff --git a/tests/consensus_spec/test_fixture_fork_choice.nim b/tests/consensus_spec/test_fixture_fork_choice.nim index b735640c36..d62a8d534e 100644 --- a/tests/consensus_spec/test_fixture_fork_choice.nim +++ b/tests/consensus_spec/test_fixture_fork_choice.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -182,12 +182,13 @@ proc stepOnBlock( invalidatedHashes: Table[Eth2Digest, Eth2Digest]): Result[BlockRef, VerifierError] = # 1. Validate blobs - when typeof(signedBlock).kind >= ConsensusFork.Deneb: - let kzgCommits = signedBlock.message.body.blob_kzg_commitments.asSeq - if kzgCommits.len > 0 or blobData.isSome: - if blobData.isNone or kzgCommits.validate_blobs( - blobData.get.blobs, blobData.get.proofs).isErr: - return err(VerifierError.Invalid) + when typeof(signedBlock).kind >= ConsensusFork.Deneb and + typeof(signedBlock).kind < ConsensusFork.Fulu: + let kzgCommits = signedBlock.message.body.blob_kzg_commitments.asSeq + if kzgCommits.len > 0 or blobData.isSome: + if blobData.isNone or kzgCommits.validate_blobs( + blobData.get.blobs, blobData.get.proofs).isErr: + return err(VerifierError.Invalid) else: doAssert blobData.isNone, "Pre-Deneb test with specified blob data" @@ -209,21 +210,22 @@ proc stepOnBlock( # this wouldn't be part of this check, presumably, their FC test vector step # would also have `true` validity because it'd not be known they weren't, so # adding this mock of the block processor is realistic and sufficient. - when consensusFork >= ConsensusFork.Bellatrix: - let executionBlockHash = - signedBlock.message.body.execution_payload.block_hash - if executionBlockHash in invalidatedHashes: - # Mocks fork choice INVALID list application. These tests sequence this - # in a way the block processor does not, specifying each payload_status - # before the block itself, while Nimbus fork choice treats invalidating - # a non-existent block root as a no-op and does not remember it for the - # future. - let lvh = invalidatedHashes.getOrDefault( - executionBlockHash, static(default(Eth2Digest))) - fkChoice[].mark_root_invalid(dag.getEarliestInvalidBlockRoot( - signedBlock.message.parent_root, lvh, executionBlockHash)) - - return err VerifierError.Invalid + when consensusFork >= ConsensusFork.Bellatrix and + consensusFork >= ConsensusFork.Fulu: + let executionBlockHash = + signedBlock.message.body.execution_payload.block_hash + if executionBlockHash in invalidatedHashes: + # Mocks fork choice INVALID list application. These tests sequence this + # in a way the block processor does not, specifying each payload_status + # before the block itself, while Nimbus fork choice treats invalidating + # a non-existent block root as a no-op and does not remember it for the + # future. + let lvh = invalidatedHashes.getOrDefault( + executionBlockHash, static(default(Eth2Digest))) + fkChoice[].mark_root_invalid(dag.getEarliestInvalidBlockRoot( + signedBlock.message.parent_root, lvh, executionBlockHash)) + + return err VerifierError.Invalid let blockAdded = dag.addHeadBlock(verifier, signedBlock) do ( blckRef: BlockRef, signedBlock: consensusFork.TrustedSignedBeaconBlock, diff --git a/tests/test_message_signatures.nim b/tests/test_message_signatures.nim index 86ade21ba8..3d74a0076b 100644 --- a/tests/test_message_signatures.nim +++ b/tests/test_message_signatures.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2018-2024 Status Research & Development GmbH +# Copyright (c) 2018-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -272,4 +272,107 @@ suite "Message signatures": fork0, genesis_validators_root0, slot, subcommittee_index, load(pubkey0).get, get_sync_committee_selection_proof( fork0, genesis_validators_root1, slot, - subcommittee_index, privkey0).toValidatorSig) \ No newline at end of file + subcommittee_index, privkey0).toValidatorSig) + + test "execution payload header signatures": + let + msg = default(fulu.SignedExecutionPayloadHeader) + state = default(fulu.BeaconState) + + check: + # Matching public/private keys and genesis validator roots + verify_execution_payload_header_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_header_signature( + fork0, genesis_validators_root0, msg, + state, privkey0).toValidatorSig) + + # Mismatched public/private keys + not verify_execution_payload_header_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_header_signature( + fork0, genesis_validators_root0, msg, + state, privkey1).toValidatorSig) + + # Mismatched forks + not verify_execution_payload_header_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_header_signature( + fork1, genesis_validators_root0, msg, + state, privkey0).toValidatorSig) + + # Mismatched genesis validator roots + not verify_execution_payload_header_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_header_signature( + fork0, genesis_validators_root1, msg, + state, privkey0).toValidatorSig) + + test "execution payload envelope signatures": + let + msg = default(fulu.SignedExecutionPayloadEnvelope) + state = default(fulu.BeaconState) + + check: + # Matching public/private keys and genesis validator roots + verify_execution_payload_envelope_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_envelope_signature( + fork0, genesis_validators_root0, msg, + state, privkey0).toValidatorSig) + + # Mismatched public/private keys + not verify_execution_payload_envelope_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_envelope_signature( + fork0, genesis_validators_root0, msg, + state, privkey1).toValidatorSig) + + # Mismatched forks + not verify_execution_payload_envelope_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_envelope_signature( + fork1, genesis_validators_root0, msg, + state, privkey0).toValidatorSig) + + # Mismatched genesis validator roots + not verify_execution_payload_envelope_signature( + fork0, genesis_validators_root0, msg, state, + load(pubkey0).get, get_execution_payload_envelope_signature( + fork0, genesis_validators_root1, msg, + state, privkey0).toValidatorSig) + + test "execution payload attestation signatures": + let + slot = default(Slot) + attestation = default(fulu.PayloadAttestationMessage) + state = default(fulu.BeaconState) + + check: + # Matching public/private keys and genesis validator roots + verify_payload_attestation_message_signature( + fork0, genesis_validators_root0, attestation, state, + load(pubkey0).get, get_payload_attestation_message_signature( + fork0, genesis_validators_root0, attestation, + state, privkey0).toValidatorSig) + + # Mismatched public/private keys + not verify_payload_attestation_message_signature( + fork0, genesis_validators_root0, attestation, state, + load(pubkey0).get, get_payload_attestation_message_signature( + fork0, genesis_validators_root0, attestation, + state, privkey1).toValidatorSig) + + # Mismatched forks + not verify_payload_attestation_message_signature( + fork0, genesis_validators_root0, attestation, state, + load(pubkey0).get, get_payload_attestation_message_signature( + fork1, genesis_validators_root0, attestation, + state, privkey0).toValidatorSig) + + # Mismatched genesis validator roots + not verify_payload_attestation_message_signature( + fork0, genesis_validators_root0, attestation, state, + load(pubkey0).get, get_payload_attestation_message_signature( + fork0, genesis_validators_root1, attestation, + state, privkey0).toValidatorSig) diff --git a/tests/test_sync_manager.nim b/tests/test_sync_manager.nim index 256e9c2af4..531693cfa7 100644 --- a/tests/test_sync_manager.nim +++ b/tests/test_sync_manager.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2020-2024 Status Research & Development GmbH +# Copyright (c) 2020-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). diff --git a/tests/test_toblindedblock.nim b/tests/test_toblindedblock.nim index ed7768ea2f..b0736631bc 100644 --- a/tests/test_toblindedblock.nim +++ b/tests/test_toblindedblock.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2024 Status Research & Development GmbH +# Copyright (c) 2024-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). @@ -136,18 +136,6 @@ template electra_steps() = default(ConsolidationRequest)) do_check -template fulu_steps() = - when consensusFork < ConsensusFork.Fulu: - check: b.message.body.execution_requests.deposits.add( - default(DepositRequest)) - do_check - check: b.message.body.execution_requests.withdrawals.add( - default(WithdrawalRequest)) - do_check - check: b.message.body.execution_requests.consolidations.add( - default(ConsolidationRequest)) - do_check - suite "Blinded block conversions": withAll(ConsensusFork): when consensusFork >= ConsensusFork.Bellatrix: