From 46563eb782d7fd6295bdc04728921e88c196f08f Mon Sep 17 00:00:00 2001 From: Lucas Saldanha Date: Sat, 5 Oct 2024 16:36:54 +1300 Subject: [PATCH] Updated presets for EIP-6110 --- .../teku/spec/config/SpecConfigElectra.java | 2 +- .../teku/spec/config/SpecConfigElectraImpl.java | 14 +++++++------- .../teku/spec/config/builder/ElectraBuilder.java | 12 ++++++------ .../versions/electra/BeaconStateSchemaElectra.java | 3 +-- .../teku/spec/config/presets/mainnet/electra.yaml | 9 +++++++-- .../teku/spec/config/presets/minimal/electra.yaml | 9 +++++++-- .../teku/spec/config/presets/swift/electra.yaml | 9 +++++++-- 7 files changed, 36 insertions(+), 22 deletions(-) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectra.java index e443cc26f83..2970e61fa24 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectra.java @@ -42,7 +42,7 @@ static SpecConfigElectra required(final SpecConfig specConfig) { UInt64 getMaxEffectiveBalanceElectra(); - int getPendingBalanceDepositsLimit(); + int getPendingDepositsLimit(); int getPendingPartialWithdrawalsLimit(); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectraImpl.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectraImpl.java index a389e74e797..ba325581367 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectraImpl.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectraImpl.java @@ -27,7 +27,7 @@ public class SpecConfigElectraImpl extends DelegatingSpecConfigDeneb implements private final UInt64 minActivationBalance; private final UInt64 maxEffectiveBalanceElectra; - private final int pendingBalanceDepositsLimit; + private final int pendingDepositsLimit; private final int pendingPartialWithdrawalsLimit; private final int pendingConsolidationsLimit; private final int minSlashingPenaltyQuotientElectra; @@ -46,7 +46,7 @@ public SpecConfigElectraImpl( final UInt64 minPerEpochChurnLimitElectra, final UInt64 minActivationBalance, final UInt64 maxEffectiveBalanceElectra, - final int pendingBalanceDepositsLimit, + final int pendingDepositsLimit, final int pendingPartialWithdrawalsLimit, final int pendingConsolidationsLimit, final int minSlashingPenaltyQuotientElectra, @@ -63,7 +63,7 @@ public SpecConfigElectraImpl( this.minPerEpochChurnLimitElectra = minPerEpochChurnLimitElectra; this.minActivationBalance = minActivationBalance; this.maxEffectiveBalanceElectra = maxEffectiveBalanceElectra; - this.pendingBalanceDepositsLimit = pendingBalanceDepositsLimit; + this.pendingDepositsLimit = pendingDepositsLimit; this.pendingPartialWithdrawalsLimit = pendingPartialWithdrawalsLimit; this.pendingConsolidationsLimit = pendingConsolidationsLimit; this.minSlashingPenaltyQuotientElectra = minSlashingPenaltyQuotientElectra; @@ -102,8 +102,8 @@ public UInt64 getMaxEffectiveBalanceElectra() { } @Override - public int getPendingBalanceDepositsLimit() { - return pendingBalanceDepositsLimit; + public int getPendingDepositsLimit() { + return pendingDepositsLimit; } @Override @@ -176,7 +176,7 @@ public boolean equals(final Object o) { && Objects.equals(minPerEpochChurnLimitElectra, that.minPerEpochChurnLimitElectra) && Objects.equals(minActivationBalance, that.minActivationBalance) && Objects.equals(maxEffectiveBalanceElectra, that.maxEffectiveBalanceElectra) - && pendingBalanceDepositsLimit == that.pendingBalanceDepositsLimit + && pendingDepositsLimit == that.pendingDepositsLimit && pendingPartialWithdrawalsLimit == that.pendingPartialWithdrawalsLimit && pendingConsolidationsLimit == that.pendingConsolidationsLimit && minSlashingPenaltyQuotientElectra == that.minSlashingPenaltyQuotientElectra @@ -198,7 +198,7 @@ public int hashCode() { minPerEpochChurnLimitElectra, minActivationBalance, maxEffectiveBalanceElectra, - pendingBalanceDepositsLimit, + pendingDepositsLimit, pendingPartialWithdrawalsLimit, pendingConsolidationsLimit, minSlashingPenaltyQuotientElectra, diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/ElectraBuilder.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/ElectraBuilder.java index e4b68df534b..fa987abed4b 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/ElectraBuilder.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/ElectraBuilder.java @@ -34,7 +34,7 @@ public class ElectraBuilder implements ForkConfigBuilder getValidationMap() { constants.put("minPerEpochChurnLimitElectra", minPerEpochChurnLimitElectra); constants.put("minActivationBalance", minActivationBalance); constants.put("maxEffectiveBalanceElectra", maxEffectiveBalanceElectra); - constants.put("pendingBalanceDepositsLimit", pendingBalanceDepositsLimit); + constants.put("pendingDepositsLimit", pendingDepositsLimit); constants.put("pendingPartialWithdrawalsLimit", pendingPartialWithdrawalsLimit); constants.put("pendingConsolidationsLimit", pendingConsolidationsLimit); constants.put("minSlashingPenaltyQuotientElectra", minSlashingPenaltyQuotientElectra); diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java index 258e13c0e0c..5b1bd4aa780 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/state/beaconstate/versions/electra/BeaconStateSchemaElectra.java @@ -128,8 +128,7 @@ private static List getUniqueFields(final SpecConfig specConfig) { BeaconStateFields.PENDING_BALANCE_DEPOSITS, () -> SszListSchema.create( - pendingBalanceDepositSchema, - specConfigElectra.getPendingBalanceDepositsLimit())); + pendingBalanceDepositSchema, specConfigElectra.getPendingDepositsLimit())); final SszField pendingPartialWithdrawalsField = new SszField( PENDING_PARTIAL_WITHDRAWALS_INDEX, diff --git a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/mainnet/electra.yaml b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/mainnet/electra.yaml index ca41f21fc04..0b594ff3404 100644 --- a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/mainnet/electra.yaml +++ b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/mainnet/electra.yaml @@ -10,7 +10,7 @@ MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000 # State list lengths # --------------------------------------------------------------- # `uint64(2**27)` (= 134,217,728) -PENDING_BALANCE_DEPOSITS_LIMIT: 134217728 +PENDING_DEPOSITS_LIMIT: 134217728 # `uint64(2**27)` (= 134,217,728) PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728 # `uint64(2**18)` (= 262,144) @@ -42,4 +42,9 @@ MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 16 # Withdrawals processing # --------------------------------------------------------------- # 2**3 ( = 8) pending withdrawals -MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8 \ No newline at end of file +MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 8 + +# Pending deposits processing +# --------------------------------------------------------------- +# 2**4 ( = 4) pending deposits +MAX_PENDING_DEPOSITS_PER_EPOCH: 16 \ No newline at end of file diff --git a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/minimal/electra.yaml b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/minimal/electra.yaml index 16bc5fdbc1d..126c84727c9 100644 --- a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/minimal/electra.yaml +++ b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/minimal/electra.yaml @@ -10,7 +10,7 @@ MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000 # State list lengths # --------------------------------------------------------------- # `uint64(2**27)` (= 134,217,728) -PENDING_BALANCE_DEPOSITS_LIMIT: 134217728 +PENDING_DEPOSITS_LIMIT: 134217728 # [customized] `uint64(2**6)` (= 64) PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64 # [customized] `uint64(2**6)` (= 64) @@ -42,4 +42,9 @@ MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 2 # Withdrawals processing # --------------------------------------------------------------- # 2**0 ( = 1) pending withdrawals -MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 1 \ No newline at end of file +MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 1 + +# Pending deposits processing +# --------------------------------------------------------------- +# 2**4 ( = 4) pending deposits +MAX_PENDING_DEPOSITS_PER_EPOCH: 16 \ No newline at end of file diff --git a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/swift/electra.yaml b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/swift/electra.yaml index 16bc5fdbc1d..126c84727c9 100644 --- a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/swift/electra.yaml +++ b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/presets/swift/electra.yaml @@ -10,7 +10,7 @@ MAX_EFFECTIVE_BALANCE_ELECTRA: 2048000000000 # State list lengths # --------------------------------------------------------------- # `uint64(2**27)` (= 134,217,728) -PENDING_BALANCE_DEPOSITS_LIMIT: 134217728 +PENDING_DEPOSITS_LIMIT: 134217728 # [customized] `uint64(2**6)` (= 64) PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64 # [customized] `uint64(2**6)` (= 64) @@ -42,4 +42,9 @@ MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD: 2 # Withdrawals processing # --------------------------------------------------------------- # 2**0 ( = 1) pending withdrawals -MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 1 \ No newline at end of file +MAX_PENDING_PARTIALS_PER_WITHDRAWALS_SWEEP: 1 + +# Pending deposits processing +# --------------------------------------------------------------- +# 2**4 ( = 4) pending deposits +MAX_PENDING_DEPOSITS_PER_EPOCH: 16 \ No newline at end of file