Skip to content

Commit bb5b00e

Browse files
Update and cleanup Electra preset (#7303)
- Update the bundled `electra.yaml` preset files for `mainnet` and `minimal` to match `consensus-specs` as of: ethereum/consensus-specs@bf09ede - Add the field `max_pending_deposits_per_epoch` to our runtime representation of `ElectraPreset`. This results in it appearing in `/eth/v1/config/spec` where it was previously absent.
1 parent aed562a commit bb5b00e

File tree

3 files changed

+62
-47
lines changed

3 files changed

+62
-47
lines changed

consensus/types/presets/mainnet/electra.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ MIN_ACTIVATION_BALANCE: 32000000000
77
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
88
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000
99

10+
# Rewards and penalties
11+
# ---------------------------------------------------------------
12+
# 2**12 (= 4,096)
13+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
14+
# 2**12 (= 4,096)
15+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
16+
1017
# State list lengths
1118
# ---------------------------------------------------------------
12-
# `uint64(2**27)` (= 134,217,728)
19+
# 2**27 (= 134,217,728) pending deposits
1320
PENDING_DEPOSITS_LIMIT: 134217728
14-
# `uint64(2**27)` (= 134,217,728)
21+
# 2**27 (= 134,217,728) pending partial withdrawals
1522
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728
16-
# `uint64(2**18)` (= 262,144)
23+
# 2**18 (= 262,144) pending consolidations
1724
PENDING_CONSOLIDATIONS_LIMIT: 262144
1825

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
26+
# Max operations per block
2727
# ---------------------------------------------------------------
28-
# `uint64(2**0)` (= 1)
28+
# 2**0 (= 1) attester slashings
2929
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
30-
# `uint64(2**3)` (= 8)
30+
# 2**3 (= 8) attestations
3131
MAX_ATTESTATIONS_ELECTRA: 8
32-
# `uint64(2**1)` (= 2)
33-
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
3432

3533
# Execution
3634
# ---------------------------------------------------------------
37-
# 2**13 (= 8192) deposit requests
35+
# 2**13 (= 8,192) deposit requests
3836
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 8192
3937
# 2**4 (= 16) withdrawal requests
4038
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16
39+
# 2**1 (= 2) consolidation requests
40+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
4141

4242
# Withdrawals processing
4343
# ---------------------------------------------------------------
44-
# 2**3 ( = 8) pending withdrawals
44+
# 2**3 (= 8) pending withdrawals
4545
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8
4646

4747
# Pending deposits processing
4848
# ---------------------------------------------------------------
49-
# 2**4 ( = 4) pending deposits
49+
# 2**4 (= 16) pending deposits
5050
MAX_PENDING_DEPOSITS_PER_EPOCH: 16

consensus/types/presets/minimal/electra.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,44 +7,44 @@ MIN_ACTIVATION_BALANCE: 32000000000
77
# 2**11 * 10**9 (= 2,048,000,000,000) Gwei
88
MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000
99

10+
# Rewards and penalties
11+
# ---------------------------------------------------------------
12+
# 2**12 (= 4,096)
13+
MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096
14+
# 2**12 (= 4,096)
15+
WHISTLEBLOWER_REWARD_QUOTIENT_ELECTRA: 4096
16+
1017
# State list lengths
1118
# ---------------------------------------------------------------
12-
# `uint64(2**27)` (= 134,217,728)
19+
# 2**27 (= 134,217,728) pending deposits
1320
PENDING_DEPOSITS_LIMIT: 134217728
14-
# [customized] `uint64(2**6)` (= 64)
21+
# [customized] 2**6 (= 64) pending partial withdrawals
1522
PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64
16-
# [customized] `uint64(2**6)` (= 64)
23+
# [customized] 2**6 (= 64) pending consolidations
1724
PENDING_CONSOLIDATIONS_LIMIT: 64
1825

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
26+
# Max operations per block
2727
# ---------------------------------------------------------------
28-
# `uint64(2**0)` (= 1)
28+
# 2**0 (= 1) attester slashings
2929
MAX_ATTESTER_SLASHINGS_ELECTRA: 1
30-
# `uint64(2**3)` (= 8)
30+
# 2**3 (= 8) attestations
3131
MAX_ATTESTATIONS_ELECTRA: 8
32-
# `uint64(2**1)` (= 2)
33-
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
3432

3533
# Execution
3634
# ---------------------------------------------------------------
37-
# [customized]
35+
# [customized] 2**2 (= 4) deposit requests
3836
MAX_DEPOSIT_REQUESTS_PER_PAYLOAD: 4
3937
# [customized] 2**1 (= 2) withdrawal requests
4038
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 2
39+
# 2**1 (= 2) consolidation requests
40+
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD: 2
4141

4242
# Withdrawals processing
4343
# ---------------------------------------------------------------
44-
# 2**1 ( = 2) pending withdrawals
44+
# 2**1 (= 2) pending withdrawals
4545
MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 2
4646

4747
# Pending deposits processing
4848
# ---------------------------------------------------------------
49-
# 2**4 ( = 4) pending deposits
49+
# 2**4 (= 16) pending deposits
5050
MAX_PENDING_DEPOSITS_PER_EPOCH: 16

consensus/types/src/preset.rs

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,48 +227,63 @@ pub struct ElectraPreset {
227227
pub min_activation_balance: u64,
228228
#[serde(with = "serde_utils::quoted_u64")]
229229
pub max_effective_balance_electra: u64,
230+
230231
#[serde(with = "serde_utils::quoted_u64")]
231232
pub min_slashing_penalty_quotient_electra: u64,
232233
#[serde(with = "serde_utils::quoted_u64")]
233234
pub whistleblower_reward_quotient_electra: u64,
234-
#[serde(with = "serde_utils::quoted_u64")]
235-
pub max_pending_partials_per_withdrawals_sweep: u64,
235+
236236
#[serde(with = "serde_utils::quoted_u64")]
237237
pub pending_deposits_limit: u64,
238238
#[serde(with = "serde_utils::quoted_u64")]
239239
pub pending_partial_withdrawals_limit: u64,
240240
#[serde(with = "serde_utils::quoted_u64")]
241241
pub pending_consolidations_limit: u64,
242-
#[serde(with = "serde_utils::quoted_u64")]
243-
pub max_consolidation_requests_per_payload: u64,
244-
#[serde(with = "serde_utils::quoted_u64")]
245-
pub max_deposit_requests_per_payload: u64,
242+
246243
#[serde(with = "serde_utils::quoted_u64")]
247244
pub max_attester_slashings_electra: u64,
248245
#[serde(with = "serde_utils::quoted_u64")]
249246
pub max_attestations_electra: u64,
247+
248+
#[serde(with = "serde_utils::quoted_u64")]
249+
pub max_deposit_requests_per_payload: u64,
250250
#[serde(with = "serde_utils::quoted_u64")]
251251
pub max_withdrawal_requests_per_payload: u64,
252+
#[serde(with = "serde_utils::quoted_u64")]
253+
pub max_consolidation_requests_per_payload: u64,
254+
255+
#[serde(with = "serde_utils::quoted_u64")]
256+
pub max_pending_partials_per_withdrawals_sweep: u64,
257+
258+
#[serde(with = "serde_utils::quoted_u64")]
259+
pub max_pending_deposits_per_epoch: u64,
252260
}
253261

254262
impl ElectraPreset {
255263
pub fn from_chain_spec<E: EthSpec>(spec: &ChainSpec) -> Self {
256264
Self {
257265
min_activation_balance: spec.min_activation_balance,
258266
max_effective_balance_electra: spec.max_effective_balance_electra,
267+
259268
min_slashing_penalty_quotient_electra: spec.min_slashing_penalty_quotient_electra,
260269
whistleblower_reward_quotient_electra: spec.whistleblower_reward_quotient_electra,
261-
max_pending_partials_per_withdrawals_sweep: spec
262-
.max_pending_partials_per_withdrawals_sweep,
270+
263271
pending_deposits_limit: E::pending_deposits_limit() as u64,
264272
pending_partial_withdrawals_limit: E::pending_partial_withdrawals_limit() as u64,
265273
pending_consolidations_limit: E::pending_consolidations_limit() as u64,
266-
max_consolidation_requests_per_payload: E::max_consolidation_requests_per_payload()
267-
as u64,
268-
max_deposit_requests_per_payload: E::max_deposit_requests_per_payload() as u64,
274+
269275
max_attester_slashings_electra: E::max_attester_slashings_electra() as u64,
270276
max_attestations_electra: E::max_attestations_electra() as u64,
277+
278+
max_deposit_requests_per_payload: E::max_deposit_requests_per_payload() as u64,
271279
max_withdrawal_requests_per_payload: E::max_withdrawal_requests_per_payload() as u64,
280+
max_consolidation_requests_per_payload: E::max_consolidation_requests_per_payload()
281+
as u64,
282+
283+
max_pending_partials_per_withdrawals_sweep: spec
284+
.max_pending_partials_per_withdrawals_sweep,
285+
286+
max_pending_deposits_per_epoch: E::max_pending_deposits_per_epoch() as u64,
272287
}
273288
}
274289
}

0 commit comments

Comments
 (0)