# Pectra Auditor Handbook ## Specifications ### EIPs - [EIP-2537: Precompile for BLS12-381 curve operations](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2537.md) - [EIP-2935: Save historical block hashes in state](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2935.md) - [EIP-6110: Supply validator deposits on chain](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6110.md) - [EIP-7002: Execution layer triggerable exits](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7002.md) - [EIP-7251: Increase the MAX_EFFECTIVE_BALANCE](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7251.md) - [EIP-7549: Move committee index outside Attestation](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7549.md) - [EIP-7623: Increase calldata cost](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7623.md) - [EIP-7685: General purpose execution layer requests](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7685.md) - [EIP-7691: Blob throughput increase](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7691.md) - [EIP-7702: Add a new tx type that permanently sets the code for an EOA](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7702.md) - [EIP-7840: Add blob schedule to EL config files](https://github.com/ethereum/EIPs/pull/9129) ### [consensus-specs](https://github.com/ethereum/consensus-specs) - [specs/electra/beacon-chain.md](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md) - [specs/electra/fork.md](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/fork.md) - [specs/electra/p2p-interface.md](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/p2p-interface.md) - [specs/electra/validator.md](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/validator.md) ### [execution-specs](https://github.com/ethereum/execution-specs) - [prague spec](https://github.com/ethereum/execution-specs/tree/forks/prague/src/ethereum/prague) ## Previous Audits https://github.com/ethereum/audits/tree/master/Pectra ## Consensus Layer Clients ### [Lighthouse](https://github.com/sigp/lighthouse) This is a guide to the implementation of the Electra hard fork in Lighthouse, aimed at security researchers and testers. #### Branches For the upcoming `v7.0.0` release which includes Electra on Holesky/Sepolia we will use the `release-v7.0.0` branch: - https://github.com/sigp/lighthouse/blob/release-v7.0.0 This branch was forked from `unstable` on 10 Feb 2025 to form a stable basis for all of the v7 releases, allowing development of new features like PeerDAS and tree-states to continue on `unstable`. **Reviews should focus on the `release-v7.0.0` branch.**, but there may be newer branches coming as well. #### Electra data structures Lighthouse uses a library called [superstruct](https://crates.io/crates/superstruct) to generate fork-specific variants of data types like `BeaconState`, `Attestation`, etc. These types live inside the `consensus/types` crate. Every fork so far has created a new variant of `BeaconState`, but Electra is the first to create a new variant of `Attestation`. Grepping for `Electra` in the `types` crate is a decent way to see all of the new Electra-related changes, as type variants are named by fork. #### State transition Lighthouse's state transition is implemented in the `consensus/state_processing` crate. For Electra the major changes are: - Updates to epoch processing integrated with _single-pass_ epoch processing, inside [single_pass.rs](https://github.com/sigp/lighthouse/blob/release-v7.0.0-beta.0/consensus/state_processing/src/per_epoch_processing/single_pass.rs). These are some of the more complex and subtle changes, as the Electra spec changed during development, and had to be carefully translated into the single-pass paradigm several times. We are quite happy with the result, but the more eyes on this code the better. - Processing of new operations within blocks: deposit requests, withdrawal requests, and consolidations. Implemented in [process_operations.rs](https://github.com/sigp/lighthouse/blob/release-v7.0.0-beta.0/consensus/state_processing/src/per_block_processing/process_operations.rs). Unlike single-pass epoch processing these changes should map almost line-to-line onto [the spec](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#block-processing). #### Attestation verification Lighthouse's attestation processing is mostly implemented in: - [attestation_verification.rs](https://github.com/sigp/lighthouse/blob/release-v7.0.0-beta.0/beacon_node/beacon_chain/src/attestation_verification.rs) - [gossip_methods.rs](https://github.com/sigp/lighthouse/blob/release-v7.0.0-beta.0/beacon_node/network/src/network_beacon_processor/gossip_methods.rs) Lighthouse uses a priority-based scheduler (which is not without its [downsides](https://github.com/sigp/lighthouse/issues/6291)), and for now we have opted to translate `SingleAttestation`s into `Attestation`s, with a view to [optimising this in the future](https://github.com/sigp/lighthouse/issues/6970). The translation from `SingleAttestation` mostly happens in the `gossip_methods.rs` file, while attestation verification itself remains mostly the same with a few checks added for Electra. With the `SingleAttestation` changes, the container for the attestation received over the gossip network also changes which means we have 2 different types of attestations that could be accepted around the electra fork boundary. We need to make sure we are not rejecting valid messages because of previously seen invalid messages. The decoding of gossipsub messages happens in [pubsub.rs](https://github.com/sigp/lighthouse/blob/release-v7.0.0-beta.0/beacon_node/lighthouse_network/src/types/pubsub.rs) Links to Electra-specific attestation checks: - [Check AttestationData committee index is 0.](https://github.com/sigp/lighthouse/blob/62a0f25f97249029c9b7efeb443dd8d085ecc5ed/beacon_node/beacon_chain/src/attestation_verification.rs#L1354-L1359) - [Check SingleAttestation attester is in committee.](https://github.com/sigp/lighthouse/blob/62a0f25f97249029c9b7efeb443dd8d085ecc5ed/beacon_node/beacon_chain/src/single_attestation.rs#L12-L25) Links to pre-Electra checks that should be removed for Electra: - Not removed, but safe and redundant: [check aggregation bitfield has 1 bit set](https://github.com/sigp/lighthouse/blob/62a0f25f97249029c9b7efeb443dd8d085ecc5ed/beacon_node/beacon_chain/src/attestation_verification.rs#L841-L846). - [Check unaggregated attestation bitfield length matches committee.](https://github.com/sigp/lighthouse/blob/62a0f25f97249029c9b7efeb443dd8d085ecc5ed/consensus/state_processing/src/common/get_attesting_indices.rs#L28-L30) #### Execution layer interaction Lighthouse's code for interacting with execution layer (EL) clients lives in `beacon_node/execution_layer`. The new fork-specific types are defined in [json_structures.rs](https://github.com/sigp/lighthouse/blob/release-v7.0.0-beta.0/beacon_node/execution_layer/src/engine_api/json_structures.rs) using superstruct. The code for making V4 requests via JSON RPC is in [http.rs](https://github.com/sigp/lighthouse/blob/62a0f25f97249029c9b7efeb443dd8d085ecc5ed/beacon_node/execution_layer/src/engine_api/http.rs#L808-L830). #### Max blobs per block Electra changed the max-blobs-per-block paramater from a compile-time preset to a runtime configurable value. This had wide-reaching implications for Lighthouse, leading to changes inside `consensus/types` to support a dynamic length in `RuntimeVariableList`, and in networking interfaces (`beacon_node/lighthouse_network`) where messages from the network are parsed and processed. Grepping for `max_blobs_per_block` shows all the places where the parameter is used. Almost all uses should use one of the [functions on ChainSpec](https://github.com/sigp/lighthouse/blob/62a0f25f97249029c9b7efeb443dd8d085ecc5ed/consensus/types/src/chain_spec.rs#L652-L664) which select the correct value based on the active fork. The `max_blobs_per_block` change along with [this](https://github.com/sigp/lighthouse/pull/6798) change touches a lot of code used to calculate max sizes for rpc objects received over the wire. #### Files **Note: This is a non-exhaustive list of some important files.** - [`beacon_node/operation_pool/src/attestation_storage.rs`](https://github.com/sigp/lighthouse/blob/unstable/beacon_node/operation_pool/src/attestation_storage.rs) - `compute_on_chain_aggregate` - [`consensus/types/src/attestation.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/types/src/attestation.rs) - `get_committee_indices` - [`consensus/types/src/beacon_state.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/types/src/beacon_state.rs) - `compute_consolidation_epoch_and_update_churn` - `compute_exit_epoch_and_update_churn` - `get_activation_exit_churn_limit` - `get_balance_churn_limit` - `get_consolidation_churn_limit` - `get_pending_balance_to_withdraw` - `queue_excess_active_balance` - `switch_to_compounding_validator` - [`consensus/types/src/validator.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/types/src/validator.rs) - `get_max_effective_balance` - `has_compounding_withdrawal_credential` - `has_execution_withdrawal_credential` - `is_compounding_withdrawal_credential` - `is_fully_withdrawable_at_electra` - `is_partially_withdrawable_validator_electra` - `validator_from_deposit` - [`consensus/state_processing/src/per_epoch_processing/single_pass.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/state_processing/src/per_epoch_processing/single_pass.rs) - `apply_pending_deposit` - `process_pending_consolidations` - `process_pending_deposits` - [`consensus/state_processing/src/per_block_processing/process_operations.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/state_processing/src/per_block_processing/process_operations.rs) - `get_eth1_pending_deposit_count (no function)` - `is_valid_switch_to_compounding_request` - `process_consolidation_request` - `process_deposit_request` - `process_withdrawal_request` - [`consensus/state_processing/src/per_block_processing.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/state_processing/src/per_block_processing.rs) - `get_expected_withdrawals` - `process_withdrawals` - [`consensus/types/src/execution_requests.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/types/src/execution_requests.rs) - `get_execution_requests_list` - `get_execution_requests` - [`consensus/state_processing/src/upgrade/electra.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/state_processing/src/upgrade/electra.rs) - `upgrade_to_electra` - [`consensus/state_processing/src/common/initiate_validator_exit.rs`](https://github.com/sigp/lighthouse/blob/unstable/consensus/state_processing/src/common/initiate_validator_exit.rs) - `initiate_validator_exit` ### [Prysm](https://github.com/prysmaticlabs/prysm) #### Files **Note: This is a non-exhaustive list of some important files.** - [`beacon-chain/core/electra/`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra) - [`attestation.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/attestation.go) - [`churn.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/churn.go) - [`consolidations.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/consolidations.go) - [`deposits.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/deposits.go) - [`effective_balance_updates.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/effective_balance_updates.go) - [`registry_updates.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/registry_updates.go) - [`transition.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/transition.go) - [`transition_no_verify_sig.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/transition_no_verify_sig.go) - [`upgrade.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/upgrade.go) - [`validator.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/validator.go) - [`withdrawals.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/electra/withdrawals.go) - [`beacon-chain/state/state-native/`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native) - [`beacon_state.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/beacon_state.go) - [`getters_consolidation.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/getters_consolidation.go) - [`getters_deposit_requests.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/getters_deposit_requests.go) - [`getters_deposits.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/getters_deposits.go) - [`getters_exit.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/getters_exit.go) - [`getters_state.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/getters_state.go) - [`getters_withdrawal.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/getters_withdrawal.go) - [`setters_churn.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/setters_churn.go) - [`setters_consolidation.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/setters_consolidation.go) - [`setters_deposit_requests.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/setters_deposit_requests.go) - [`setters_deposits.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/setters_deposits.go) - [`setters_withdrawal.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/setters_withdrawal.go) - [`spec_parameters.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/spec_parameters.go) - [`state_trie.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/state_trie.go) - [`types/types.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/state/state-native/types/types.go) - [`beacon-chain/rpc/prysm/v1alpha1/validator/`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/rpc/prysm/v1alpha1/validator/) - [`proposer_attestations_electra.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations_electra.go) - [`beacon-chain/sync/`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/sync/) - [`validate_beacon_attestation.go`](https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/sync/validate_beacon_attestation.go) - [`proto/prysm/v1alpha1/`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/prysm/v1alpha1/) - [`attestation.go`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/prysm/v1alpha1/attestation.go) - [`beacon_block.go`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/prysm/v1alpha1/beacon_block.go) - [`eip_7251.proto`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/prysm/v1alpha1/eip_7251.proto) - [`validator.proto`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/prysm/v1alpha1/validator.proto) - [`proto/engine/v1/`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/engine/v1/) - [`electra.go`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/engine/v1/electra.go) - [`electra.proto`](https://github.com/prysmaticlabs/prysm/blob/develop/proto/engine/v1/electra.proto) ### [Teku](https://github.com/Consensys/teku) ## Attestations changes (EIP-7549 + SingleAttestation) https://github.com/Consensys/teku/pull/8884 https://github.com/Consensys/teku/pull/8867 https://github.com/Consensys/teku/pull/8346 https://github.com/Consensys/teku/pulls?q=is%3Apr+is%3Aclosed+author%3Atbenr+7549 https://github.com/Consensys/teku/pull/9114 ## MaxEB (EIP-7251) https://github.com/Consensys/teku/pull/8908 https://github.com/Consensys/teku/pull/8876 https://github.com/Consensys/teku/pull/8684 https://github.com/Consensys/teku/pull/8684 https://github.com/Consensys/teku/pulls?q=is%3Apr+is%3Aclosed+%227251%22 ## validator deposit (EIP-6110) https://github.com/Consensys/teku/pulls?q=is%3Apr+6110+is%3Aclosed ## EL exits (EIP-7002) https://github.com/Consensys/teku/pulls?q=is%3Apr+7002+is%3Aclosed ### Overall Pectra Epic issues https://github.com/Consensys/teku/issues?q=state%3Aclosed%20label%3A%22Epic%20Electra%22 #### Files **Note: This is a non-exhaustive list of some important files.** - [`data/serializer/`](https://github.com/Consensys/teku/tree/master/data/serializer/src/main/java/tech/pegasys/teku/api/schema/electra) - [`ethereum/spec/.../logic/`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/electra) - `ethereum/spec/.../datastructures/` - [`builder/`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/builder/versions/electra) - [`execution/`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/execution/versions/electra) - [`operations/`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/operations/versions/electra) - [`blockbody/`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/electra) - [`state/`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/versions/electra) - [`beaconstate/`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra) - `ethereum/spec/.../spec/` - [`Spec.java`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java) - [`SpecFactory.java`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecFactory.java) - [`SpecMilestone.java`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecMilestone.java) - [`SpecVersion.java`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/SpecVersion.java) - [`SpecConfigElectraImpl.java`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectraImpl.java) - [`ElectraBuilder.java`](https://github.com/Consensys/teku/tree/master/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/ElectraBuilder.java) - `beacon/validator/` - [`BlockOperationSelectorFactory.java`](https://github.com/Consensys/teku/tree/master/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/BlockOperationSelectorFactory.java) - [`DepositProvider.java`](https://github.com/Consensys/teku/tree/master/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/DepositProvider.java) - `data/beaconrestapi/` - [`PostAttesterSlashingV2.java`](https://github.com/Consensys/teku/tree/master/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/PostAttesterSlashingV2.java) - [`GetBlockAttestationsV2.java`](https://github.com/Consensys/teku/tree/master/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java) - [`GetAttesterSlashingsV2.java`](https://github.com/Consensys/teku/tree/master/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttesterSlashingsV2.java) - `ethereum/executionlayer/` - [`BuilderBidValidatorImpl.java`](https://github.com/Consensys/teku/tree/master/ethereum/executionlayer/src/main/java/tech/pegasys/teku/ethereum/executionlayer/BuilderBidValidatorImpl.java) ### [Lodestar](https://github.com/ChainSafe/lodestar/) The Lodestar update for Electra introduces several targeted modifications across protocol logic, feature enhancements, and maintenance improvements. These changes ensure that the client’s consensus logic and network parameters conform to the [Electra hard fork specifications](https://eips.ethereum.org/EIPS/eip-7600) while also improving performance and code quality. This summary is intended for researchers/auditors to ensure the Lodestar consensus client functions as intended going into the Pectra hard fork. #### Key Electra-Specific Updates This summary is intended to highlight and direct researchers to the pull requests which indicate the code diff changes related to the Pectra hard fork. For the most up-to-date state of the code changes, please verify your findings against the Pectra-ready release v1.27.x and/or the `unstable` branch in [our repository](https://github.com/ChainSafe/lodestar). Additionally, an easy way to find the most up to date Electra code is by searching for: - `>= ForkSeq.electra` - `< ForkSeq.electra` - `isForkPostElectra` ##### Electra Fork Rebase branch July 30, 2024 [Pull request 6986](https://github.com/ChainSafe/lodestar/pull/6986) highlights the first squashed batch of commitments for Electra as it went through review on our team. Electra features were built on the Electra fork titled [electra-fork-rebase-jul30](https://github.com/ChainSafe/lodestar/tree/electra-fork-rebasejul30). It highlights most of the initial changes alongside a Part 2 of the review with [pull request 7019](https://github.com/ChainSafe/lodestar/pull/7019). Subsequent changes made to Electra during the development process were generally done through devnet feature branches. Devnet-4 tests against the `v1.5.0-alpha.8` specification tests and builder specs with changes listed at https://github.com/ChainSafe/lodestar/pull/7154 Devnet-5 tests against the `v1.5.0-beta.0` with changes listed at https://github.com/ChainSafe/lodestar/pull/7246 Below, we will highlight some additional PRs of significance for referencing specific parts of the codebase pertaining to various EIPs. For light client Electra changes please see: https://github.com/ChainSafe/lodestar/pull/7063 and https://github.com/ChainSafe/lodestar/pull/7187 For remote signer API changes for Electra, please see: https://github.com/ChainSafe/lodestar/pull/7100 ##### EIP Specific Implementations ###### EIP-6110: In-Protocol Deposits - Initial implementation: https://github.com/ChainSafe/lodestar/pull/6042 - [eip-6110 deprecate eth1 data poll](https://github.com/ChainSafe/lodestar/pull/7414) - [remove unfinalized pubkey cache](https://github.com/ChainSafe/lodestar/pull/7230) ###### EIP-7251: Increase `MAX_EFFECTIVE_BALANCE` - [EIP-7251: Update correlation penalty computation](https://github.com/ethereum/consensus-specs/pull/3882) is covered by https://github.com/ChainSafe/lodestar/pull/7071 ###### EIP-7685: Execution Requests - Initial implementation: https://github.com/ChainSafe/lodestar/pull/6651 - [engine: Make execution requests a sidecar](https://github.com/ethereum/execution-apis/pull/591) is covered by https://github.com/ChainSafe/lodestar/pull/7094 - pass execution requests as bytes to engine API is covered by https://github.com/ChainSafe/lodestar/pull/7145 - Add execution requests to builder flow is covered by https://github.com/ChainSafe/lodestar/pull/7148 - [improve performance of getExpectedWithdrawals](https://github.com/ChainSafe/lodestar/pull/7045) ###### EIP-7251: MaxEB related changes - Inital implementation: https://github.com/ChainSafe/lodestar/pull/6539 - Switch to compounding from consolidation requests is covered by https://github.com/ChainSafe/lodestar/pull/7122 ###### EIP-7549: Move committee index outside Attestation - Initial implementation: https://github.com/ChainSafe/lodestar/pull/6689 - https://github.com/ChainSafe/lodestar/pull/6732 - https://github.com/ChainSafe/lodestar/pull/6738 - [Separate type for unaggregated network attestations](https://github.com/ethereum/consensus-specs/pull/3900) is covered by https://github.com/ChainSafe/lodestar/pull/7126 - - An electra attester slashing mechanism has been implemented, which is a critical part of risk and reward adjustments under the new rules (see PR #7397). ###### EIP-7691: Blob throughput increase - https://github.com/ChainSafe/lodestar/pull/7309 ##### Other notable changes - [Make MAX_BLOBS_PER_BLOCK a config parameter](https://github.com/ethereum/consensus-specs/pull/3817) is covered by https://github.com/ChainSafe/lodestar/issues/7172 - The calculation for “partially withdrawn” validator balances now only runs after Electra activates, ensuring state transitions reflect new consensus rules ([see PR #7389](https://github.com/ChainSafe/lodestar/pull/7389)). - Electra-specific fork constants have been added to unscheduled networks, which sets the stage for proper network behavior once the hard fork is triggered ([see PR #7401](https://github.com/ChainSafe/lodestar/pull/7401)). ### [Grandine](https://github.com/grandinetech/grandine) Grandine started to merge Pectra changes on September 30th 2024, so Pectra relevant changes are in commits stating that date. Another good approach is to simply search for "electra" keyword (case insensitive) as this marks the places where code branches for Electra. ### [Nimbus](https://github.com/status-im/nimbus-eth2) To find Electra-specific code and codepaths in Nimbus in general, generically, one can start with by finding the Nim identifiers: - `ConsensusFork.Electra`; - `ELECTRA_FORK_EPOCH`; - `ELECTRA_FORK_VERSION`; - `MAX_BLOBS_PER_BLOCK_ELECTRA`; - `Electra.Attestation`; - `Electra.AttesterSlashing` Electra constants and datatypes are defined in - `beacon_chain/spec/datatypes/electra.nim` - `beacon_chain/spec/mev/electra_mev.nim` - `beacon_chain/spec/presets/gnosis/electra_preset.nim` - `beacon_chain/spec/presets/mainnet/electra_preset.nim` - `beacon_chain/spec/presets/minimal/electra_preset.nim` In general, any usage of the Electra-specific presets or data types (`ExecutionRequests`, the various `_ELECTRA` presets, `MAX_FOO_PER_PAYLOAD`, et cetera) is an efficient way to find Electra handling. More broadly, `beacon_chain/spec/` contains most hardfork-specific code, various of which concerns Electra. Parts are outside that, for example the `beacon_chain/sync/` code has to handle Pectra-specific concerns at times due to differing maximum sizes of attestations, blobs, and other protocol tweaks. To find the Electra functions and datatypes from another direction, starting from https://github.com/ethereum/consensus-specs/blob/v1.5.0-beta.2/specs/electra/beacon-chain.md and browsing any new, modified, or extended containers and simply searching for those extact strings in Nimbus will generally find them, as Nimbus when at all possible attempts to nominally and structurally mirror the consensus specs. Similarly, all of the function names (new `get_balance_churn_limit`, new `queue_excess_active_balance`, et cetera) all directly appear in a basically 1:1 way in Nimbus, mirroring the spec code as closely as practically feasible. This also applies to https://github.com/ethereum/consensus-specs/blob/v1.5.0-beta.2/specs/electra/p2p-interface.md where one can search for, e.g., `MAX_REQUEST_BLOB_SIDECARS_ELECTRA` and `BLOB_SIDECAR_SUBNET_COUNT_ELECTRA` and find relevant handling, because Nimbus mirrors those precisely. https://github.com/ethereum/consensus-specs/blob/v1.5.0-beta.2/specs/electra/validator.md#execution-requests is the main substantive new part of the honest validator spec, and similarly there, it's efficient to search for spec identifiers such as `DEPOSIT_REQUEST_TYPE`, `MAX_DEPOSIT_REQUESTS_PER_PAYLOAD`, `WITHDRAWAL_REQUEST_TYPE`, `MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD`, and `CONSOLIDATION_REQUEST_TYPE` in Nimbus. ## Execution Layer Clients ### [Go-Ethereum](https://github.com/ethereum/go-ethereum) - [EIP-2537: Precompile for BLS12-381 curve operations](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2537.md) - [EIP-2935: Save historical block hashes in state](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2935.md) - [EIP-6110: Supply validator deposits on chain](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6110.md) - [core/chain_makers.go, function ConsensusLayerRequests](https://github.com/ethereum/go-ethereum/blob/master/core/chain_makers.go#L297) - [core/chain_makers.go, function collectRequests](https://github.com/ethereum/go-ethereum/blob/master/core/chain_makers.go#301) - [core/state_processor.go, function Process](https://vscode.dev/github/ethereum/go-ethereum/blob/master/core/state_processor.go#L109) - [EIP-7002: Execution layer triggerable exits](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7002.md) - [EIP-7623: Increase calldata cost](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7623.md) - [core/](https://github.com/ethereum/go-ethereum/pull/30946) - [EIP-7685: General purpose execution layer requests](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7685.md) - [core/chain_makers.go, function ConsensusLayerRequests](https://github.com/ethereum/go-ethereum/blob/master/core/chain_makers.go#L297) - [core/chain_makers.go, function collectRequests](https://github.com/ethereum/go-ethereum/blob/master/core/chain_makers.go#301) - [core/state_processor.go, function Process](https://vscode.dev/github/ethereum/go-ethereum/blob/master/core/state_processor.go#L109) - [EIP-7702: Add a new tx type that permanently sets the code for an EOA](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7702.md) - [EIP-7840: Add blob schedule to EL config files](https://github.com/ethereum/EIPs/pull/9129) ### [Nethermind](https://github.com/NethermindEth/nethermind) The release branch for Pectra: https://github.com/NethermindEth/nethermind/tree/release/1.31.0 PRs related to Pectra that touches different EIPs: https://github.com/NethermindEth/nethermind/pulls?q=is%3Apr+Pectra+is%3Amerged+ Chainspec changes for activation on Holesky and Sepolia: https://github.com/NethermindEth/nethermind/pull/8115 - **[EIP-2935]** - [PRs related to EIP-2935](https://github.com/NethermindEth/nethermind/pulls?q=is%3Apr+2935+is%3Amerged) - [Main class related to EIP-2935](https://github.com/NethermindEth/nethermind/blob/release/1.31.0/src/Nethermind/Nethermind.Blockchain/Blocks/BlockhashStore.cs#L17) - **[EIP-2537]** - [PRs related to BLS precompile](https://github.com/NethermindEth/nethermind/pulls?q=is%3Apr+bls+is%3Amerged+) - [Folder with all BLS precompiles](https://github.com/NethermindEth/nethermind/tree/release/1.31.0/src/Nethermind/Nethermind.Evm/Precompiles/Bls) - **[EIP-6110/7002/7251/7685]** - [The main processor class for consensus requests]( https://github.com/NethermindEth/nethermind/blob/release/1.31.0/src/Nethermind/Nethermind.Consensus/ExecutionRequests/ExecutionRequestProcessor.cs) - [Execution requests in Engine API](https://github.com/NethermindEth/nethermind/blob/release/1.31.0/src/Nethermind/Nethermind.Merge.Plugin/Data/ExecutionPayloadV3.cs#L39) - [Main PR with those EIPs](https://github.com/NethermindEth/nethermind/pull/7421) - **[EIP-7623]** - [PRs related to 7623](https://github.com/NethermindEth/nethermind/pulls?q=is%3Apr+7623+is%3Amerged) - **[EIP-7702]** - [PRs merged related to EIP-7702]( https://github.com/NethermindEth/nethermind/pulls?q=is%3Apr+7702+is%3Amerged) - [Authorization Tuple](https://github.com/NethermindEth/nethermind/blob/release/1.31.0/src/Nethermind/Nethermind.Core/AuthorizationTuple.cs) - [Filter SetCode in Mempool](https://github.com/NethermindEth/nethermind/pull/8167) - **[EIP-7840]** - [PRs related to EIP-7840](https://github.com/NethermindEth/nethermind/pulls?q=is%3Apr+7840+is%3Amerged+) ### [Erigon](https://github.com/erigontech/erigon) The following should be the majority of Pectra changes: https://github.com/erigontech/erigon/pulls?q=is%3Apr+pectra+is%3Aclosed ### [Reth](https://github.com/paradigmxyz/reth/) https://laced-king-de5.notion.site/Reth-Pectra-Changes-One-Pager-19e32f2c3484805fbc66f0867804bc4d ### [Besu](https://github.com/hyperledger/besu)