Skip to content

feat: electra MAX_BLOBS_PER_BLOCK_ELECTRA #1438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 121 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from 120 commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
ed74379
feat EpochProcessing.process_slashings electra changes
LeanSerra Apr 3, 2025
71b3674
feat compute_proposer_index changes
LeanSerra Apr 4, 2025
9aa4202
feat compute_sync_committees Electra changes
LeanSerra Apr 4, 2025
f09b71b
fix fork_choice.ex tests were flaky because env var cleanup was not done
LeanSerra Apr 4, 2025
df45ee4
feat eligible_for_activation_queue Electra changes
LeanSerra Apr 7, 2025
8fb4d63
feat new compounding_withdrawal_credential? Electra function
LeanSerra Apr 7, 2025
6e34108
feat new has_compounding_withdrawal_credential Electra function
LeanSerra Apr 7, 2025
620e700
feat new has_execution_withdrawal_credential Electra function
LeanSerra Apr 7, 2025
d904593
feat fully_withdrawable_validator? Electra changes
LeanSerra Apr 7, 2025
5445583
feat new get_max_effective_balance Electra function
LeanSerra Apr 7, 2025
5cbc5af
feat partially_withdrawable_validator? Electra changes
LeanSerra Apr 7, 2025
753badb
fix typo in struct field in has_compounding_withdrawal_credential
LeanSerra Apr 7, 2025
29bf08a
feat new get_committee_indices Electra function
LeanSerra Apr 7, 2025
17bf479
feat get_attesting_indices Electra changes
LeanSerra Apr 7, 2025
42b0bfb
lint remove unnecessary parentheses in if
LeanSerra Apr 7, 2025
6df1b36
feat slash_validator Electra changes
LeanSerra Apr 7, 2025
9e13ad5
feat new get_balance_churn_limit Electra function
LeanSerra Apr 7, 2025
abc2585
feat new get_activation_exit_churn_limit Electra function
LeanSerra Apr 7, 2025
5b7e5dc
feat compute_exit_epoch_and_churn Electra function
LeanSerra Apr 7, 2025
4eddb4b
feat initiate_validator_exit Electra changes
LeanSerra Apr 7, 2025
44a00ec
feat process_registry_updates Electra changes
LeanSerra Apr 8, 2025
9bc3a0b
refactor remove unused eject_validator(_,_,_, false) variant
LeanSerra Apr 8, 2025
ed8be8a
fix compute_exit_epoch_and_update_churn wrong exit_balance calculation
LeanSerra Apr 8, 2025
c084913
Merge branch 'electra-support' into electra_predicates
LeanSerra Apr 8, 2025
6ec0216
fix additional_epochs calculation in compute_exit_epoch_and_update_churn
LeanSerra Apr 8, 2025
7da3d5a
fix wrong values for constants in minimal config
LeanSerra Apr 8, 2025
70d40aa
Merge branch 'electra_predicates' into electra_validator_exit
LeanSerra Apr 8, 2025
e4e8607
feat process_epoch changes + deposits/consolidation scaffolding
LeanSerra Apr 8, 2025
0e53f57
feat new is_valid_deposit_signature Electra function
LeanSerra Apr 9, 2025
12ed2d3
feat get_validator_from_deposit Electra changes
LeanSerra Apr 9, 2025
a73c061
feat apply_deposit Electra changes
LeanSerra Apr 9, 2025
6ad6e4d
feat new apply_pending_deposit Electra function
LeanSerra Apr 9, 2025
3eef3e7
feat new process_pending_deposits Electra function
LeanSerra Apr 9, 2025
88c7308
refactor move registry_update for each validator to own function inli…
LeanSerra Apr 9, 2025
14a0539
Merge branch 'electra_validator_exit' into electra_deposits
LeanSerra Apr 9, 2025
ebc73e0
refactor avoid negation in if when calculating pending_deposits in ap…
LeanSerra Apr 9, 2025
f8c443a
Merge branch 'electra-support' into electra_validator_exit
LeanSerra Apr 10, 2025
8f72d6b
Merge branch 'electra_validator_exit' into electra_deposits
LeanSerra Apr 10, 2025
b4a9d15
Merge branch 'electra-support' into electra_validator_exit
LeanSerra Apr 10, 2025
280669a
Merge branch 'electra_validator_exit' into electra_deposits
LeanSerra Apr 10, 2025
c2db045
refactor move logic to handle an individual pending_deposit to its ow…
LeanSerra Apr 10, 2025
7bc38b9
feat process_operations Electra changes
LeanSerra Apr 10, 2025
6d74e53
feat new process_deposit_request Electra function
LeanSerra Apr 10, 2025
40b0a5c
fix conditional logic for verify_deposits was incorrect
LeanSerra Apr 10, 2025
82afc64
fix get_committee_indices calculation was incorrect
LeanSerra Apr 10, 2025
6521f68
feat process_attestation Electra changes
LeanSerra Apr 10, 2025
e437245
feat new get_pending_balance_to_withdraw Electra function
LeanSerra Apr 10, 2025
8417e96
feat process_voluntary_exit Electra changes
LeanSerra Apr 10, 2025
39dd889
feat new process_withdrawal_request Electra function
LeanSerra Apr 11, 2025
2db24de
feat add constant g2_point_at_infinity
LeanSerra Apr 11, 2025
1b8024e
feat new queue_excess_active_balance Electra function
LeanSerra Apr 11, 2025
253b824
feat new switch_to_compounding_validator Electra function
LeanSerra Apr 11, 2025
6ace4d9
feat new get_consolidation_churn_limit Electra function
LeanSerra Apr 11, 2025
2166fb4
refactor move logic to find a validator by pubkey to own function
LeanSerra Apr 11, 2025
2c1001f
refactor invalid_withdrawal_credentials parameter is now the address …
LeanSerra Apr 11, 2025
0f8b360
feat new process_consolidation_request Electra function
LeanSerra Apr 11, 2025
5b9721c
Merge branch 'electra-support' into electra_deposits
LeanSerra Apr 11, 2025
38c5a4e
docs update electra-gap.md with changes from #1424
LeanSerra Apr 11, 2025
a7997c5
Merge branch 'electra_deposits' into electra_process_operations
LeanSerra Apr 11, 2025
20515be
refactor process_consolidation_request split validations to different…
LeanSerra Apr 11, 2025
0726736
refactor process_withdrawal_request split validations to different fu…
LeanSerra Apr 14, 2025
65b1f57
feat new compute_consolidation_epoch_and_update_churn Electra function
LeanSerra Apr 14, 2025
9f720d5
fix do_process_conslidation_request was using compute_exit when it sh…
LeanSerra Apr 14, 2025
27ef594
fix typo in struct field in do_process_consolidation_request
LeanSerra Apr 14, 2025
4dcfb90
fix typo in struct field in do_process_consolidation_request
LeanSerra Apr 14, 2025
e246258
feat new process_pending_consolidations Electra function
LeanSerra Apr 14, 2025
15453e1
feat process_effective_balance_updates Electra changes
LeanSerra Apr 14, 2025
93c1002
docs update electra-gap.md with changes from #1426
LeanSerra Apr 14, 2025
5b4ece8
Merge branch 'electra_process_operations' into electra_consolidations
LeanSerra Apr 14, 2025
3e392ea
docs update electra-gap.md with changes from #1428
LeanSerra Apr 14, 2025
ff7ab9f
Merge branch 'electra-support' into electra_deposits
LeanSerra Apr 15, 2025
7cab380
Merge branch 'electra_deposits' into electra_process_operations
LeanSerra Apr 15, 2025
aaa1dde
Merge branch 'electra_process_operations' into electra_consolidations
LeanSerra Apr 15, 2025
ae7be10
fix full_exit valid_withdrawal was returning a nested tuple instead o…
LeanSerra Apr 15, 2025
7f55534
Merge branch 'electra_process_operations' into electra_consolidations
LeanSerra Apr 15, 2025
b426cc7
fix do_process_consolidation_request was returnig {:process, BeaconSt…
LeanSerra Apr 16, 2025
7d711d5
fix full_exit handle_valid_withdrawal_request was not updating the ex…
LeanSerra Apr 16, 2025
c4008f2
fix apply_deposits, apply_initial_deposit amount should be 0, returne…
LeanSerra Apr 16, 2025
ffbd715
fix apply_deposits using Enum.member when it should be using Enum.any
LeanSerra Apr 16, 2025
a9a9d2f
fix process_deposit_request was overwritting the updated_state
LeanSerra Apr 16, 2025
3346f10
fix add new Containers to operations.ex runner
LeanSerra Apr 16, 2025
86d539f
fix invalid_consolidation_request_credentials? logic was inverted + s…
LeanSerra Apr 16, 2025
b85fcbd
Merge branch 'electra-support' into electra_deposits
LeanSerra Apr 16, 2025
5f2929f
Merge branch 'electra_deposits' into electra_process_operations
LeanSerra Apr 16, 2025
8dab043
Merge branch 'electra_process_operations' into electra_consolidations
LeanSerra Apr 16, 2025
ba16426
feat get_expected_withdrawals Electra changes
LeanSerra Apr 14, 2025
2fef959
feat process_withdrawals Electra changes
LeanSerra Apr 14, 2025
0b06993
fix stream should be converted to list before concatenating lists in …
LeanSerra Apr 15, 2025
2a1bbfc
fix add ::binary to address pattern matching in do_process_partial_wi…
LeanSerra Apr 15, 2025
ba77dcb
fix do_process_conslidation_request was using the wrong validator_index
LeanSerra Apr 15, 2025
48965d5
fix non_partial_withdrawals calculation was skipping an incorrect amo…
LeanSerra Apr 15, 2025
5415c8c
docs update electra-gap.md with changes from #1431
LeanSerra Apr 15, 2025
f9250cb
fix incorrect check for already exiting validator in process_withdraw…
LeanSerra Apr 15, 2025
1bb0e6c
fix add ::binary to validator_address pattern matching in invalid_wit…
LeanSerra Apr 15, 2025
c049a33
Merge branch 'electra-support' into electra_deposits
LeanSerra Apr 16, 2025
2b6c4e1
Merge branch 'electra_deposits' into electra_process_operations
LeanSerra Apr 16, 2025
bdd2e21
Merge branch 'electra_process_operations' into electra_consolidations
LeanSerra Apr 16, 2025
a764dc9
Merge branch 'electra_consolidations' into electra_withdrawals
LeanSerra Apr 16, 2025
2eb2ce3
Merge branch 'electra-support' into electra_process_operations
LeanSerra Apr 21, 2025
5bdef50
fix added diff lines
LeanSerra Apr 21, 2025
e163179
fix added diff lines
LeanSerra Apr 21, 2025
75bf0b4
fix fast_process_attestation wrong attesting indices
LeanSerra Apr 21, 2025
dd42e10
fix BitList.set should be BitList.set?, fix incorrect pattern matchin…
LeanSerra Apr 16, 2025
d1eacf7
feat: implement electra deposits (#1424)
LeanSerra Apr 21, 2025
87a465e
fix added diff lines
LeanSerra Apr 21, 2025
46717b4
fix added diff lines
LeanSerra Apr 21, 2025
27aeeb0
fix fast_process_attestation wrong attesting indices
LeanSerra Apr 21, 2025
0b8ed91
fix BitList.set should be BitList.set?, fix incorrect pattern matchin…
LeanSerra Apr 16, 2025
f3d5531
Merge branch 'electra_process_operations' into electra_consolidations
LeanSerra Apr 21, 2025
8b6f6a8
Merge branch 'electra_consolidations' into electra_withdrawals
LeanSerra Apr 21, 2025
aff110f
feat use new constant MAX_BLOBS_PER_BLOCK_ELECTRA
LeanSerra Apr 21, 2025
e1f90bf
fix change ci to use electra
LeanSerra Apr 21, 2025
81b04d9
Merge branch 'electra-support' into electra_withdrawals
LeanSerra Apr 24, 2025
66b5f72
fix update MAX_BLOBS constant in fork_choice test runner
LeanSerra Apr 25, 2025
a6c143c
Merge branch 'electra-support' into electra_withdrawals
LeanSerra Apr 25, 2025
71eb4d8
Merge branch 'electra_withdrawals' into electra_max_blobs
LeanSerra Apr 25, 2025
7125416
docs update electra-gap.md
LeanSerra Apr 25, 2025
47075aa
docs update electra-gap.md
LeanSerra Apr 25, 2025
6f3c419
Merge branch 'electra_withdrawals' into electra_max_blobs
LeanSerra Apr 25, 2025
46bb9d1
Merge branch 'electra-support' into electra_max_blobs
LeanSerra Apr 25, 2025
30c4083
fix removed final lines
LeanSerra Apr 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ jobs:
strategy:
fail-fast: false
matrix:
fork: ["deneb"]
fork: ["electra"]
config: ["minimal", "general", "mainnet"]
runs-on: ubuntu-24.04
steps:
Expand Down
2 changes: 2 additions & 0 deletions config/networks/mainnet/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,5 @@ EIP7594_FORK_EPOCH: 18446744073709551615
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000
# 2**8 * 10**9) (= 256,000,000,000) Gwei
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000
# 9
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
2 changes: 2 additions & 0 deletions config/networks/minimal/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,5 @@ EIP7594_FORK_EPOCH: 18446744073709551615
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000
# [customized] 2**8 * 10**9) (= 256,000,000,000) Gwei
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 128000000000
# 9
MAX_BLOBS_PER_BLOCK_ELECTRA: 9
3 changes: 1 addition & 2 deletions electra-gap.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Here we will detail the current implementation gaps with the specs and the way t

### Phase 1: Beacon Chain Implementation

We are at `54/58` (91%) of the [beacon chain changes](docs/specs/electra/beacon-chain.md), and most of the remaining functions are already in progress. We have still `4/11370` spec test failures, but we are working on them. The skipped tests were there previous to the electra upgrade, so we will work on them if needed after we finish the first phase. Our aim as mentioned before is to reach `0` failures before going to the next phase.

We are at `54/58` (91%) of the [beacon chain changes](docs/specs/electra/beacon-chain.md), 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](https://github.com/lambdaclass/lambda_ethereum_consensus/tree/electra-support) branch is as follows:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ defmodule LambdaEthereumConsensus.StateTransition.Operations do
payload.timestamp != Misc.compute_timestamp_at_slot(state, state.slot) ->
{:error, "Timestamp verification failed"}

body.blob_kzg_commitments |> length() > ChainSpec.get("MAX_BLOBS_PER_BLOCK") ->
body.blob_kzg_commitments |> length() > ChainSpec.get("MAX_BLOBS_PER_BLOCK_ELECTRA") ->
{:error, "Too many commitments"}

# Cache execution payload header
Expand Down
2 changes: 1 addition & 1 deletion test/spec/runners/fork_choice.ex
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ defmodule ForkChoiceTestRunner do

# TODO: validate the filename's hash
defp load_blob_data(case_dir, block, %{blobs: "blobs_0x" <> _hash = blobs_file, proofs: proofs}) do
schema = {:list, TypeAliases.blob(), ChainSpec.get("MAX_BLOBS_PER_BLOCK")}
schema = {:list, TypeAliases.blob(), ChainSpec.get("MAX_BLOBS_PER_BLOCK_ELECTRA")}

blobs = SpecTestUtils.read_ssz_ex_from_file!(case_dir <> "/#{blobs_file}.ssz_snappy", schema)

Expand Down
Loading