Skip to content

Latest commit

 

History

History
173 lines (126 loc) · 18.4 KB

electra-gap.md

File metadata and controls

173 lines (126 loc) · 18.4 KB

Implementation Gaps for electra Upgrade

This document will guide you through our step-by-step plan for the implementation of the new electra fork. We’ve broken the work into three clear phases to make our goals and priorities easy to follow. This is a living document, so we will update it as we progress through the implementation.

Roadmap

Status Phase What & Why Key Steps Testing
🏗️ Phase 1: Beacon Chain Implementation Build the electra-upgraded beacon chain core • Apply electra-specific changes
• Run & pass full spec tests
Run spec suite (make spec-test), aim for 0 failures
Phase 2: P2P & Sepolia Long-Running Sessions Ensure stability on Sepolia • Implement the P2P changes
• Deploy the node on our server pointing to Sepolia
• Fix every issue we found that interrupts the node execution
Continuous uptime checks & up-to-date block processing for 72+ hrs in Sepolia
Phase 3: Validator Upgrades Ensure validators duties on devnets • Implement the honest validator changes
• Make assertoor work
• Test via Kurtosis & Assertoor
Execute Kurtosis scenarios & Assertoor with continuous uptime checks and up-to-date validation duties for 72+ hrs on kurtosis

Why this Order

We kick off with the beacon chain implementation because passing the full spec test suite is critical for protocol correctness and a solid foundation. Once all tests are green, we move to Phase 2 for prolonged Sepolia sessions and the implementation of the p2p interface changes, ensuring real-world testnet stability before mainnet moves to electra which would limit our network options before we upgrade. This will allow us to continue running long session on our servers and monitor the node execution given that just the block/epoch processing and state transitions are needed for this. With a stable node confirmed, Phase 3 begins, upgrading the validator logic, tested through Kurtosis and Assertoor to finalize the electra upgrade roadmap.

Next Steps

Once we finish the whole electra upgrade we have a clear path to follow for the next steps:

  • Hooli long running sessions: Right now Holesky was not an option for us because of performance issues, we need to test on Hooli and see if we can run the node on it on acceptable performance. This effort will be in parallel to the performance optimization one.
  • Performance optimization: We need to run the node on Hooli and mainnet to identify and fix the current bottlenecks, specially on block and epoch processing.
  • Electra code enhancements: During the implementation, some complex functions were identified that could be simplified. They are mostly related to how to manage early returns in already large python reference functions and port the logic to elixir. We will work on those to improve the code quality and make it easier to maintain in the future.

Current Status

Right now we are at the Beacon Chain Implementation phase, our current spec test results for the past weeks are:

  • April 15th, 2025: 11370 tests, 2003 failures, 784 skipped
  • April 22th, 2025: 11370 tests, 165 failures, 784 skipped

Note: The aim is to reach 0 failures before next week, so we can start the long running sessions on Sepolia. Also, we want to validate the 784 test skipped on the second phase.

Implementation Gap

Here we will detail the current implementation gaps with the specs and the way to test every phase. The initial one is the larger to implement but it has the most clear way to validate it (spec-tests). The next phases are smaller but they need to be validated on long running sessions both in devnets and testnets.

Phase 1: Beacon Chain Implementation

We are at 54/58 (91%) of the beacon chain changes, and most of the remaining functions are already in progress. We have fixed all 11370 spec tests. The skipped tests were there previous to the electra upgrade, so we will work on them if needed after we finish the first phase.

The current status of the implementation in the electra-support branch is as follows:

Containers (13/13 - 100%)

  • New PendingDeposit (Spec, PR)
  • New PendingPartialWithdrawal (Spec, PR)
  • New PendingConsolidation (Spec, PR)
  • New DepositRequest (Spec, PR)
  • New WithdrawalRequest (Spec, PR)
  • New ConsolidationRequest (Spec, PR)
  • New ExecutionRequests (Spec, PR)
  • New SingleAttestation (Spec, PR)
  • Modified AttesterSlashing (Spec, PR)
  • Modified BeaconBlockBody (Spec, PR)
  • Modified Attestation (Spec, PR)
  • Modified IndexedAttestation (Spec, PR)
  • Modified BeaconState (Spec, PR)

Predicates (6/6 - 100%)

  • Modified is_eligible_for_activation_queue (Spec, PR)
  • New is_compounding_withdrawal_credential (Spec, PR)
  • New has_compounding_withdrawal_credential (Spec, PR)
  • New has_execution_withdrawal_credential (Spec, PR)
  • Modified is_fully_withdrawable_validator (Spec, PR)
  • Modified is_partially_withdrawable_validator (Spec, PR)

Beacon State Accessors (6/6 - 100%)

  • Modified get_attesting_indices (Spec, PR)
  • Modified get_next_sync_committee_indices (Spec, PR)
  • New get_balance_churn_limit (Spec, PR)
  • New get_activation_exit_churn_limit (Spec, PR)
  • New get_consolidation_churn_limit (Spec, PR)
  • New get_pending_balance_to_withdraw (Spec, PR)

Beacon State Mutators (6/6 - 100%)

  • Modified initiate_validator_exit (Spec, PR)
  • New switch_to_compounding_validator (Spec, PR)
  • New queue_excess_active_balance (Spec, PR)
  • New compute_exit_epoch_and_update_churn (Spec, PR)
  • New compute_consolidation_epoch_and_update_churn (Spec, PR)
  • Modified slash_validator (Spec, PR)

Miscellaneous (3/3 - 100%)

  • New get_committee_indices (Spec, PR)
  • Modified compute_proposer_index (Spec, PR)
  • New get_max_effective_balance (Spec, PR)

Epoch Processing (8/8 - 100%)

  • Modified process_epoch (Spec, PR)
  • Modified process_registry_updates (Spec, PR)
  • Modified process_slashings (Spec, PR)
  • New apply_pending_deposit (Spec, PR)
  • New process_pending_deposits (Spec, PR)
  • New process_pending_consolidations (Spec, PR)
  • Modified process_effective_balance_updates (Spec, PR)
  • Modified get_validator_from_deposit (Spec, PR)

Block Processing (12/13 - 92%)

  • Modified process_withdrawals (Spec, PR)
  • Modified process_execution_payload (Spec)
  • Modified process_operations (Spec, PR)
  • Modified process_attestation (Spec, PR)
  • Modified process_deposit (Spec, PR)
  • Modified process_voluntary_exit (Spec, PR)
  • New process_withdrawal_request (Spec, PR)
  • New process_deposit_request (Spec, PR)
  • New process_consolidation_request (Spec, PR)
  • New is_valid_deposit_signature (Spec, PR)
  • Modified add_validator_to_registry (Spec, PR)
  • Modified apply_deposit (Spec, PR)
  • Modified get_expected_withdrawals (Spec, PR)

Execution Engine

Execution Engine (0/3 - 0%)

  • Modified is_valid_block_hash (Spec)
  • Modified notify_new_payload (Spec)
  • Modified verify_and_notify_new_payload (Spec)

Phase 2: P2P & Sepolia Long-Running Sessions

We didn't start this phase yet, its goals are:

  • P2P electra changes implementated.
  • To have a stable node processing state transitions in testnets, especially Sepolia.
  • Validate the remaining 784 skipped tests to make sure they are not masking any issues.

The aim is to have the node running on Sepolia uninterrupted for 72+ hrs. The following is the implementation gap for this phase:

Networking (0/8 - 0% Complete)

  • Updated beacon_block topic validation (Spec)
  • Updated beacon_aggregate_and_proof topic validation (Spec)
  • Updated blob_sidecar_{subnet_id} topic validation (Spec)
  • Updated beacon_attestation_{subnet_id} topic validation (Spec)
  • Updated BeaconBlocksByRange v2 (Spec)
  • Updated BeaconBlocksByRoot v2 (Spec)
  • Updated BlobSidecarsByRange v1 (Spec)
  • Updated BlobSidecarsByRoot v1 (Spec)

Phase 3: Validator Upgrades

We didn't start this phase yet, its goals are:

  • Honest validator changes implemented.
  • To have a stable node processing validator duties in a kurtosis devnet.
  • Have assertoor working with automatic test for the validator duties.

The aim is to have the node running on kurtosis uninterrupted for 72+ hrs. The following is the implementation gap for this phase:

Honest Validator (0/9 - 0% Complete)

  • Modified GetPayloadResponse (Spec)
  • Modified AggregateAndProof (Spec)
  • Modified SignedAggregateAndProof (Spec)
  • Modified get_payload (Spec)
  • Updated prepare_execution_payload (Spec)
  • New get_execution_requests (Spec)
  • Updated compute_subnet_for_blob_sidecar (Spec)
  • Updated construct attestation (Spec)
  • Updated construct aggregate (Spec)

Changelog

  • April 10th, 2025: Created the document with the implementation gap.
  • April 22th, 2025: Updated the document with a clear roadmap, next steps and detailed current status.