Skip to content

Commit

Permalink
add mainnet presets for gnosis and fix minimal preset default values
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Apr 24, 2024
1 parent 8aa1b77 commit fc505eb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 7 deletions.
46 changes: 44 additions & 2 deletions consensus/types/presets/gnosis/electra.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# Gnosis preset - Electra
# Mainnet preset - Electra

ELECTRA_PLACEHOLDER: 0
# 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_BALANCE_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**0)` (= 1)
MAX_CONSOLIDATIONS: 1

# Execution
# ---------------------------------------------------------------
# 2**13 (= 8192) receipts
MAX_DEPOSIT_RECEIPTS_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
2 changes: 2 additions & 0 deletions consensus/types/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,8 @@ impl ChainSpec {
// Electra
electra_fork_version: [0x05, 0x00, 0x00, 0x01],
electra_fork_epoch: None,
max_pending_partials_per_withdrawals_sweep: u64::checked_pow(2, 0)
.expect("pow does not overflow"),
// Other
network_id: 2, // lighthouse testnet network id
deposit_chain_id: 5,
Expand Down
10 changes: 5 additions & 5 deletions consensus/types/src/eth_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,10 @@ impl EthSpec for MinimalEthSpec {
type BytesPerBlob = U131072;
type MaxBlobCommitmentsPerBlock = U16;
type KzgCommitmentInclusionProofDepth = U9;
type PendingPartialWithdrawalsLimit = U64;
type PendingConsolidationsLimit = U64;
type MaxDepositReceiptsPerPayload = U4;
type MaxWithdrawalRequestsPerPayload = U2;

params_from_eth_spec!(MainnetEthSpec {
JustificationBitsLength,
Expand All @@ -442,13 +446,9 @@ impl EthSpec for MinimalEthSpec {
MaxBlobsPerBlock,
BytesPerFieldElement,
PendingBalanceDepositsLimit,
PendingPartialWithdrawalsLimit,
PendingConsolidationsLimit,
MaxConsolidations,
MaxDepositReceiptsPerPayload,
MaxAttesterSlashingsElectra,
MaxAttestationsElectra,
MaxWithdrawalRequestsPerPayload
MaxAttestationsElectra
});

fn default_spec() -> ChainSpec {
Expand Down

0 comments on commit fc505eb

Please sign in to comment.