Skip to content

feat: electra support #1415

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

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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 .fork_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
deneb
electra
22 changes: 10 additions & 12 deletions .github/config/assertoor/network-params.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
participants:
- el_type: geth
el_image: ethereum/client-go:v1.14.12
el_image: ethereum/client-go:v1.15.6
cl_type: lighthouse
cl_image: sigp/lighthouse:v5.3.0
cl_image: sigp/lighthouse:v7.0.0-beta.5
validator_count: 32
count: 2
- el_type: geth
el_image: ethereum/client-go:v1.14.12
cl_type: lighthouse
cl_image: sigp/lighthouse:v5.3.0
validator_count: 32
- el_type: geth
el_image: ethereum/client-go:v1.14.12
el_image: ethereum/client-go:v1.15.6
cl_type: lambda
cl_image: lambda_ethereum_consensus:latest
use_separate_vc: false
Expand All @@ -19,10 +15,12 @@ participants:
cl_max_mem: 4096
keymanager_enabled: true

network_params:
electra_fork_epoch: 0

additional_services:
- assertoor
- tx_spammer
- blob_spammer
- tx_fuzz
- dora

assertoor_params:
Expand All @@ -31,5 +29,5 @@ assertoor_params:
tests:
- https://raw.githubusercontent.com/lambdaclass/lambda_ethereum_consensus/refs/heads/main/.github/config/assertoor/cl-stability-check.yml

tx_spammer_params:
tx_spammer_extra_args: ["--txcount=3", "--accounts=80"]
tx_fuzz_params:
tx_fuzz_extra_args: ["--txcount=3", "--accounts=80"]
4 changes: 2 additions & 2 deletions .github/workflows/assertoor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
enclave_name: "elixir-consensus-assertoor"
kurtosis_version: "1.4.2"
kurtosis_version: "1.6.0"
ethereum_package_url: 'github.com/lambdaclass/ethereum-package'
ethereum_package_branch: 'lecc-integration-and-assertoor'
ethereum_package_branch: 'lecc-integration-electra'
ethereum_package_args: './.github/config/assertoor/network-params.yml'
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ permissions:
jobs:
compile-native:
name: Build native libraries
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Go
# NOTE: this action comes with caching by default
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.24"
cache-dependency-path: |
native/libp2p_port/go.sum
- name: Cache output artifacts
Expand All @@ -58,7 +58,7 @@ jobs:

download-beacon-node-oapi:
name: Download Beacon Node OAPI
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Cache Beacon Node OAPI
Expand All @@ -75,7 +75,7 @@ jobs:
build:
name: Build project
needs: [compile-native, download-beacon-node-oapi]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:

docker-build:
name: Build Docker image
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
Expand All @@ -150,7 +150,7 @@ jobs:
smoke:
name: Start and stop the node
needs: [compile-native, download-beacon-node-oapi]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
Expand Down Expand Up @@ -195,12 +195,12 @@ jobs:
run: mix compile --warnings-as-errors
- name: Run the node
# NOTE: this starts and then stops the application. It should catch simple runtime errors
run: mix run -- --checkpoint-sync-url https://mainnet-checkpoint-sync.stakely.io/
run: mix run -- --checkpoint-sync-url https://sepolia.beaconstate.info --network sepolia

test:
name: Test
needs: [compile-native, download-beacon-node-oapi]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:

lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:

download-spectests:
name: Download spectests
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Cache compressed spectests
Expand All @@ -295,7 +295,7 @@ jobs:
matrix:
fork: ["deneb"]
config: ["minimal", "general", "mainnet"]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Elixir
Expand Down Expand Up @@ -357,7 +357,7 @@ jobs:
spectests-success:
name: All spec-tests passed
needs: spectests-matrix
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: always()
steps:
- if: needs.spectests-matrix.result == 'success'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci_skipped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,36 @@ on:
jobs:
compile-native:
name: Build native libraries
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: false
steps: [run: true]

build:
name: Build project
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: false
steps: [run: true]

smoke:
name: Start and stop the node
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: false
steps: [run: true]

test:
name: Test
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: false
steps: [run: true]

lint:
name: Lint
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: false
steps: [run: true]

spectests-success:
name: All spec-tests passed
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: false
steps: [run: true]
2 changes: 1 addition & 1 deletion .spectest_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4.0
v1.5.0-beta.3
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
erlang 26.2
elixir 1.16.2-otp-26
golang 1.22.12
golang 1.24.2
rust 1.81.0
protoc 30.2
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# libp2p port
FROM golang:1.22 AS libp2p_builder
FROM golang:1.24 AS libp2p_builder
LABEL stage=builder

# Install dependencies
Expand Down Expand Up @@ -120,4 +120,4 @@
# TODO: This could be an issue regarding OS signals, we should use JSONArgs but shell form is the
# only way to pass args to ENTRYPOINT, specially important because of the cookie. Best
# solution would be to move to releases and avoid starting the node manually through iex.
ENTRYPOINT iex $IEX_ARGS_VALUE -S mix run -- $0 $@

Check warning on line 123 in Dockerfile

View workflow job for this annotation

GitHub Actions / ethereum-testnet

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 123 in Dockerfile

View workflow job for this annotation

GitHub Actions / Build Docker image

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ We take security seriously. If you discover a vulnerability in this project, ple

For more details, please refer to our [Security Policy](./.github/SECURITY.md).

## Electra Support

We are working on the electra support in [this branch](https://github.com/lambdaclass/lambda_ethereum_consensus/tree/electra-support) and the current progress is updated in [this document](https://github.com/lambdaclass/lambda_ethereum_consensus/tree/electra-support/electra-gap.md)

## Prerequisites

Expand Down
1 change: 1 addition & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fork_raw = File.read!(".fork_version") |> String.trim()
fork =
case fork_raw do
"deneb" -> :deneb
"electra" -> :electra
v -> raise "Invalid fork specified: #{v}"
end

Expand Down
12 changes: 10 additions & 2 deletions config/networks/mainnet/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6
# Deneb
# `2**7` (=128)
MAX_REQUEST_BLOCKS_DENEB: 128
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
MAX_REQUEST_BLOB_SIDECARS: 768
# `2**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6
## 6 blobs
MAX_BLOBS_PER_BLOCK: 6
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK (= 128 * 6) sidecars
MAX_REQUEST_BLOB_SIDECARS: 768

# Whisk
# `Epoch(2**8)`
Expand All @@ -151,3 +153,9 @@ WHISK_PROPOSER_SELECTION_GAP: 2
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615

# Electra
# 2**7 * 10**9 (= 128,000,000,000) Gwei
MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000
# 2**8 * 10**9) (= 256,000,000,000) Gwei
MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000
12 changes: 10 additions & 2 deletions config/networks/minimal/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ ATTESTATION_SUBNET_PREFIX_BITS: 6
# Deneb
# `2**7` (=128)
MAX_REQUEST_BLOCKS_DENEB: 128
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK
MAX_REQUEST_BLOB_SIDECARS: 768
# `2**12` (= 4096 epochs, ~18 days)
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096
# `6`
BLOB_SIDECAR_SUBNET_COUNT: 6
## 6 blobs
MAX_BLOBS_PER_BLOCK: 6
# MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK (= 128 * 6) sidecars
MAX_REQUEST_BLOB_SIDECARS: 768

# Whisk
WHISK_EPOCHS_PER_SHUFFLING_PHASE: 4
Expand All @@ -149,3 +151,9 @@ WHISK_PROPOSER_SELECTION_GAP: 1
# EIP7594
EIP7594_FORK_VERSION: 0x06000001
EIP7594_FORK_EPOCH: 18446744073709551615

# Electra
# [customized] 2**7 * 10**9 (= 128,000,000,000) Gwei
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
50 changes: 50 additions & 0 deletions config/presets/gnosis/electra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Mainnet preset - Electra

# Gwei values
# ---------------------------------------------------------------
# 2**5 * 10**9 (= 32,000,000,000) Gwei
MIN_ACTIVATION_BALANCE: 32000000000
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000

# State list lengths
# ---------------------------------------------------------------
# `uint64(2**27)` (= 134,217,728)
PENDING_DEPOSITS_LIMIT: 134217728
# `uint64(2**27)` (= 134,217,728)
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728
# `uint64(2**18)` (= 262,144)
PENDING_CONSOLIDATIONS_LIMIT: 262144

# Reward and penalty quotients
# ---------------------------------------------------------------
# `uint64(2**12)` (= 4,096)
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
# `uint64(2**12)` (= 4,096)
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096

# # Max operations per block
# ---------------------------------------------------------------
# `uint64(2**0)` (= 1)
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
# `uint64(2**3)` (= 8)
MAX_ATTESTATIONS_ELECTRA: 8
# `uint64(2**1)` (= 2)
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2

# Execution
# ---------------------------------------------------------------
# 2**13 (= 8192) deposit requests
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192
# 2**4 (= 16) withdrawal requests
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16

# Withdrawals processing
# ---------------------------------------------------------------
# 2**3 ( = 8) pending withdrawals
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8

# Pending deposits processing
# ---------------------------------------------------------------
# 2**4 ( = 4) pending deposits
MAX_PENDING_DEPOSITS_PER_EPOCH: 16
50 changes: 50 additions & 0 deletions config/presets/mainnet/electra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Mainnet preset - Electra

# Gwei values
# ---------------------------------------------------------------
# 2**5 * 10**9 (= 32,000,000,000) Gwei
MIN_ACTIVATION_BALANCE: 32000000000
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000

# State list lengths
# ---------------------------------------------------------------
# `uint64(2**27)` (= 134,217,728)
PENDING_DEPOSITS_LIMIT: 134217728
# `uint64(2**27)` (= 134,217,728)
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728
# `uint64(2**18)` (= 262,144)
PENDING_CONSOLIDATIONS_LIMIT: 262144

# Reward and penalty quotients
# ---------------------------------------------------------------
# `uint64(2**12)` (= 4,096)
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
# `uint64(2**12)` (= 4,096)
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096

# # Max operations per block
# ---------------------------------------------------------------
# `uint64(2**0)` (= 1)
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
# `uint64(2**3)` (= 8)
MAX_ATTESTATIONS_ELECTRA: 8
# `uint64(2**1)` (= 2)
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2

# Execution
# ---------------------------------------------------------------
# 2**13 (= 8192) deposit requests
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192
# 2**4 (= 16) withdrawal requests
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16

# Withdrawals processing
# ---------------------------------------------------------------
# 2**3 ( = 8) pending withdrawals
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8

# Pending deposits processing
# ---------------------------------------------------------------
# 2**4 ( = 4) pending deposits
MAX_PENDING_DEPOSITS_PER_EPOCH: 16
Loading
Loading