Skip to content

Commit be8f62a

Browse files
committed
Updated config/preset to support electra additions
1 parent 6e472a2 commit be8f62a

File tree

5 files changed

+170
-1
lines changed

5 files changed

+170
-1
lines changed

config/presets/gnosis/electra.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Mainnet preset - Electra
2+
3+
# Gwei values
4+
# ---------------------------------------------------------------
5+
# 2**5 * 10**9 (= 32,000,000,000) Gwei
6+
MIN_ACTIVATION_BALANCE: 32000000000
7+
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
8+
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000
9+
10+
# State list lengths
11+
# ---------------------------------------------------------------
12+
# `uint64(2**27)` (= 134,217,728)
13+
PENDING_DEPOSITS_LIMIT: 134217728
14+
# `uint64(2**27)` (= 134,217,728)
15+
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728
16+
# `uint64(2**18)` (= 262,144)
17+
PENDING_CONSOLIDATIONS_LIMIT: 262144
18+
19+
# Reward and penalty quotients
20+
# ---------------------------------------------------------------
21+
# `uint64(2**12)` (= 4,096)
22+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
23+
# `uint64(2**12)` (= 4,096)
24+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
25+
26+
# # Max operations per block
27+
# ---------------------------------------------------------------
28+
# `uint64(2**0)` (= 1)
29+
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
30+
# `uint64(2**3)` (= 8)
31+
MAX_ATTESTATIONS_ELECTRA: 8
32+
# `uint64(2**1)` (= 2)
33+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
34+
35+
# Execution
36+
# ---------------------------------------------------------------
37+
# 2**13 (= 8192) deposit requests
38+
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192
39+
# 2**4 (= 16) withdrawal requests
40+
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16
41+
42+
# Withdrawals processing
43+
# ---------------------------------------------------------------
44+
# 2**3 ( = 8) pending withdrawals
45+
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8
46+
47+
# Pending deposits processing
48+
# ---------------------------------------------------------------
49+
# 2**4 ( = 4) pending deposits
50+
MAX_PENDING_DEPOSITS_PER_EPOCH: 16

config/presets/mainnet/electra.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Mainnet preset - Electra
2+
3+
# Gwei values
4+
# ---------------------------------------------------------------
5+
# 2**5 * 10**9 (= 32,000,000,000) Gwei
6+
MIN_ACTIVATION_BALANCE: 32000000000
7+
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
8+
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000
9+
10+
# State list lengths
11+
# ---------------------------------------------------------------
12+
# `uint64(2**27)` (= 134,217,728)
13+
PENDING_DEPOSITS_LIMIT: 134217728
14+
# `uint64(2**27)` (= 134,217,728)
15+
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728
16+
# `uint64(2**18)` (= 262,144)
17+
PENDING_CONSOLIDATIONS_LIMIT: 262144
18+
19+
# Reward and penalty quotients
20+
# ---------------------------------------------------------------
21+
# `uint64(2**12)` (= 4,096)
22+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
23+
# `uint64(2**12)` (= 4,096)
24+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
25+
26+
# # Max operations per block
27+
# ---------------------------------------------------------------
28+
# `uint64(2**0)` (= 1)
29+
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
30+
# `uint64(2**3)` (= 8)
31+
MAX_ATTESTATIONS_ELECTRA: 8
32+
# `uint64(2**1)` (= 2)
33+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
34+
35+
# Execution
36+
# ---------------------------------------------------------------
37+
# 2**13 (= 8192) deposit requests
38+
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192
39+
# 2**4 (= 16) withdrawal requests
40+
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16
41+
42+
# Withdrawals processing
43+
# ---------------------------------------------------------------
44+
# 2**3 ( = 8) pending withdrawals
45+
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8
46+
47+
# Pending deposits processing
48+
# ---------------------------------------------------------------
49+
# 2**4 ( = 4) pending deposits
50+
MAX_PENDING_DEPOSITS_PER_EPOCH: 16

config/presets/minimal/electra.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Minimal preset - Electra
2+
3+
# Gwei values
4+
# ---------------------------------------------------------------
5+
# 2**5 * 10**9 (= 32,000,000,000) Gwei
6+
MIN_ACTIVATION_BALANCE: 32000000000
7+
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
8+
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000
9+
10+
# State list lengths
11+
# ---------------------------------------------------------------
12+
# `uint64(2**27)` (= 134,217,728)
13+
PENDING_DEPOSITS_LIMIT: 134217728
14+
# [customized] `uint64(2**6)` (= 64)
15+
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64
16+
# [customized] `uint64(2**6)` (= 64)
17+
PENDING_CONSOLIDATIONS_LIMIT: 64
18+
19+
# Reward and penalty quotients
20+
# ---------------------------------------------------------------
21+
# `uint64(2**12)` (= 4,096)
22+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
23+
# `uint64(2**12)` (= 4,096)
24+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
25+
26+
# # Max operations per block
27+
# ---------------------------------------------------------------
28+
# `uint64(2**0)` (= 1)
29+
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
30+
# `uint64(2**3)` (= 8)
31+
MAX_ATTESTATIONS_ELECTRA: 8
32+
# `uint64(2**1)` (= 2)
33+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
34+
35+
# Execution
36+
# ---------------------------------------------------------------
37+
# [customized]
38+
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 4
39+
# [customized] 2**1 (= 2) withdrawal requests
40+
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 2
41+
42+
# Withdrawals processing
43+
# ---------------------------------------------------------------
44+
# 2**1 ( = 2) pending withdrawals
45+
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 2
46+
47+
# Pending deposits processing
48+
# ---------------------------------------------------------------
49+
# 2**4 ( = 4) pending deposits
50+
MAX_PENDING_DEPOSITS_PER_EPOCH: 16

lib/chain_spec/utils.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule ConfigUtils do
22
@moduledoc """
33
Utilities for parsing configs and presets.
44
"""
5-
@forks ["phase0", "altair", "bellatrix", "capella", "deneb"]
5+
@forks ["phase0", "altair", "bellatrix", "capella", "deneb", "electra"]
66

77
def load_config_from_file!(path) do
88
path

lib/constants.ex

+19
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,23 @@ defmodule Constants do
132132

133133
@spec versioned_hash_version_kzg() :: <<_::8>>
134134
def versioned_hash_version_kzg(), do: <<1>>
135+
136+
# New in Electra
137+
@spec unset_deposit_requests_start_index() :: Types.uint64()
138+
def unset_deposit_requests_start_index(), do: 2 ** 64 - 1
139+
140+
@spec full_exit_request_amount() :: Types.uint64()
141+
def full_exit_request_amount(), do: 0
142+
143+
@spec compounding_withdrawal_prefix() :: Types.bytes1()
144+
def compounding_withdrawal_prefix(), do: <<2>>
145+
146+
@spec deposit_request_type() :: Types.bytes1()
147+
def deposit_request_type(), do: <<0>>
148+
149+
@spec withdrawal_request_type() :: Types.bytes1()
150+
def withdrawal_request_type(), do: <<1>>
151+
152+
@spec consolidation_request_type() :: Types.bytes1()
153+
def consolidation_request_type(), do: <<2>>
135154
end

0 commit comments

Comments
 (0)