From 2c2249ab922d7912b945e0dd81cbed36fb1129a3 Mon Sep 17 00:00:00 2001 From: Enrico Del Fante Date: Wed, 10 Apr 2024 12:54:10 +0200 Subject: [PATCH 1/2] Cleanup on block performance (#8184) --- .../java/tech/pegasys/teku/spec/Spec.java | 51 +++++++++---------- .../beaconchain/BeaconChainController.java | 3 +- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java index ee2add97ad5..2638f8b21f7 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/Spec.java @@ -292,10 +292,10 @@ public int getSyncCommitteeSize(final UInt64 slot) { // Genesis public BeaconState initializeBeaconStateFromEth1( - Bytes32 eth1BlockHash, - UInt64 eth1Timestamp, - List deposits, - Optional payloadHeader) { + final Bytes32 eth1BlockHash, + final UInt64 eth1Timestamp, + final List deposits, + final Optional payloadHeader) { final GenesisGenerator genesisGenerator = createGenesisGenerator(); genesisGenerator.updateCandidateState(eth1BlockHash, eth1Timestamp, deposits); payloadHeader.ifPresent(genesisGenerator::updateExecutionPayloadHeader); @@ -415,7 +415,7 @@ public UInt64 getPreviousEpoch(final BeaconState state) { return atState(state).beaconStateAccessors().getPreviousEpoch(state); } - public Bytes32 getSeed(BeaconState state, UInt64 epoch, Bytes4 domainType) + public Bytes32 getSeed(final BeaconState state, final UInt64 epoch, final Bytes4 domainType) throws IllegalArgumentException { return atState(state).beaconStateAccessors().getSeed(state, epoch, domainType); } @@ -429,38 +429,35 @@ public UInt64 computeEpochAtSlot(final UInt64 slot) { } public UInt64 computeTimeAtSlot(final BeaconState state, final UInt64 slot) { - return computeTimeAtSlot(state.getGenesisTime(), slot); + return atSlot(slot).miscHelpers().computeTimeAtSlot(state.getGenesisTime(), slot); } - public UInt64 computeTimeAtSlot(final UInt64 genesisTime, final UInt64 slot) { - return atSlot(slot).miscHelpers().computeTimeAtSlot(genesisTime, slot); - } - - public Bytes computeSigningRoot(BeaconBlock block, Bytes32 domain) { + public Bytes computeSigningRoot(final BeaconBlock block, final Bytes32 domain) { return atBlock(block).miscHelpers().computeSigningRoot(block, domain); } - public Bytes computeSigningRoot(BeaconBlockHeader blockHeader, Bytes32 domain) { + public Bytes computeSigningRoot(final BeaconBlockHeader blockHeader, final Bytes32 domain) { return atSlot(blockHeader.getSlot()).miscHelpers().computeSigningRoot(blockHeader, domain); } - public Bytes computeSigningRoot(AggregateAndProof proof, Bytes32 domain) { + public Bytes computeSigningRoot(final AggregateAndProof proof, final Bytes32 domain) { return atSlot(proof.getAggregate().getData().getSlot()) .miscHelpers() .computeSigningRoot(proof, domain); } - public Bytes computeSigningRoot(UInt64 slot, Bytes32 domain) { + public Bytes computeSigningRoot(final UInt64 slot, final Bytes32 domain) { return atSlot(slot).miscHelpers().computeSigningRoot(slot, domain); } - public Bytes computeBuilderApplicationSigningRoot(UInt64 slot, Merkleizable object) { + public Bytes computeBuilderApplicationSigningRoot(final UInt64 slot, final Merkleizable object) { final MiscHelpers miscHelpers = atSlot(slot).miscHelpers(); return miscHelpers.computeSigningRoot( object, miscHelpers.computeDomain(Domain.APPLICATION_BUILDER)); } - public Bytes4 computeForkDigest(Bytes4 currentVersion, Bytes32 genesisValidatorsRoot) { + public Bytes4 computeForkDigest( + final Bytes4 currentVersion, final Bytes32 genesisValidatorsRoot) { return atForkVersion(currentVersion) .miscHelpers() .computeForkDigest(currentVersion, genesisValidatorsRoot); @@ -564,7 +561,7 @@ public UInt64 getCurrentSlotForMillis(UInt64 currentTimeMillis, UInt64 genesisTi .getCurrentSlotForMillis(currentTimeMillis, genesisTimeMillis); } - public UInt64 getCurrentSlot(ReadOnlyStore store) { + public UInt64 getCurrentSlot(final ReadOnlyStore store) { return atTime(store.getGenesisTime(), store.getTimeSeconds()) .getForkChoiceUtil() .getCurrentSlot(store); @@ -574,36 +571,38 @@ public UInt64 getCurrentEpoch(final ReadOnlyStore store) { return computeEpochAtSlot(getCurrentSlot(store)); } - public UInt64 getSlotStartTime(UInt64 slotNumber, UInt64 genesisTime) { + public UInt64 getSlotStartTime(final UInt64 slotNumber, final UInt64 genesisTime) { return atSlot(slotNumber).getForkChoiceUtil().getSlotStartTime(slotNumber, genesisTime); } - public UInt64 getSlotStartTimeMillis(UInt64 slotNumber, UInt64 genesisTimeMillis) { + public UInt64 getSlotStartTimeMillis(final UInt64 slotNumber, final UInt64 genesisTimeMillis) { return atSlot(slotNumber) .getForkChoiceUtil() .getSlotStartTimeMillis(slotNumber, genesisTimeMillis); } public Optional getAncestor( - ReadOnlyForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 slot) { + final ReadOnlyForkChoiceStrategy forkChoiceStrategy, final Bytes32 root, final UInt64 slot) { return forGetAncestor(forkChoiceStrategy, root, slot) .getForkChoiceUtil() .getAncestor(forkChoiceStrategy, root, slot); } public NavigableMap getAncestors( - ReadOnlyForkChoiceStrategy forkChoiceStrategy, - Bytes32 root, - UInt64 startSlot, - UInt64 step, - UInt64 count) { + final ReadOnlyForkChoiceStrategy forkChoiceStrategy, + final Bytes32 root, + final UInt64 startSlot, + final UInt64 step, + final UInt64 count) { return forGetAncestor(forkChoiceStrategy, root, startSlot) .getForkChoiceUtil() .getAncestors(forkChoiceStrategy, root, startSlot, step, count); } public NavigableMap getAncestorsOnFork( - ReadOnlyForkChoiceStrategy forkChoiceStrategy, Bytes32 root, UInt64 startSlot) { + final ReadOnlyForkChoiceStrategy forkChoiceStrategy, + final Bytes32 root, + final UInt64 startSlot) { return forGetAncestor(forkChoiceStrategy, root, startSlot) .getForkChoiceUtil() .getAncestorsOnFork(forkChoiceStrategy, root, startSlot); diff --git a/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainController.java b/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainController.java index 243b0e28801..3ae8b310fb9 100644 --- a/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainController.java +++ b/services/beaconchain/src/main/java/tech/pegasys/teku/services/beaconchain/BeaconChainController.java @@ -929,8 +929,7 @@ public void initValidatorApiHandler() { final BlockProductionAndPublishingPerformanceFactory blockProductionPerformanceFactory = new BlockProductionAndPublishingPerformanceFactory( timeProvider, - (slot) -> - secondsToMillis(spec.computeTimeAtSlot(recentChainData.getGenesisTime(), slot)), + (slot) -> secondsToMillis(recentChainData.computeTimeAtSlot(slot)), beaconConfig.getMetricsConfig().isBlockProductionAndPublishingPerformanceEnabled(), beaconConfig.getMetricsConfig().getBlockProductionPerformanceWarningThreshold(), beaconConfig.getMetricsConfig().getBlockPublishingPerformanceWarningThreshold()); From 91b4e3d121cedfe2df059dc58b8f46f1d011a8eb Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Thu, 11 Apr 2024 08:02:59 +1000 Subject: [PATCH 2/2] Electra spec config and builder (#8183) * Electra spec config and builder There were fields missing for EIP-7251, and also some of the attestation fields. I added the entire diff from consensus-specs while I was going, it seemed easiest... Signed-off-by: Paul Harris --- .../teku/spec/config/SpecConfigElectra.java | 26 ++++ .../spec/config/SpecConfigElectraImpl.java | 106 ++++++++++++++- .../spec/config/builder/ElectraBuilder.java | 124 +++++++++++++++++- .../teku/spec/config/configs/mainnet.yaml | 6 +- .../teku/spec/config/configs/minimal.yaml | 6 +- .../spec/config/presets/mainnet/electra.yaml | 30 ++++- .../spec/config/presets/minimal/electra.yaml | 32 ++++- .../spec/config/presets/swift/electra.yaml | 35 ++++- .../spec/config/SpecConfigElectraTest.java | 15 ++- 9 files changed, 369 insertions(+), 11 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 73fd3e8c364..88f93843e2a 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 @@ -31,6 +31,32 @@ static SpecConfigElectra required(final SpecConfig specConfig) { + specConfig.getClass().getSimpleName())); } + UInt64 getMinActivationBalance(); + + UInt64 getMaxEffectiveBalanceElectra(); + + UInt64 getPendingBalanceDepositsLimit(); + + UInt64 getPendingPartialWithdrawalsLimit(); + + UInt64 getPendingConsolidationsLimit(); + + int getWhistleblowerRewardQuotientElectra(); + + int getMinSlashingPenaltyQuotientElectra(); + + int getMaxAttesterSlashingsElectra(); + + int getMaxAttestationsElectra(); + + int getMaxConsolidations(); + + int getMaxPartialWithdrawalsPerPayload(); + + UInt64 getMinPerEpochChurnLimitElectra(); + + UInt64 getMaxPerEpochActivationExitChurnLimit(); + Bytes4 getElectraForkVersion(); UInt64 getElectraForkEpoch(); 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 3d0ba197b03..5bb79a1249f 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 @@ -22,21 +22,60 @@ public class SpecConfigElectraImpl extends DelegatingSpecConfigDeneb implements private final Bytes4 electraForkVersion; private final UInt64 electraForkEpoch; + private final UInt64 minPerEpochChurnLimitElectra; + private final UInt64 maxPerEpochActivationExitChurnLimit; private final int maxDepositReceiptsPerPayload; private final int maxExecutionLayerExits; + private final UInt64 minActivationBalance; + private final UInt64 maxEffectiveBalanceElectra; + private final UInt64 pendingBalanceDepositsLimit; + private final UInt64 pendingPartialWithdrawalsLimit; + private final UInt64 pendingConsolidationsLimit; + private final int whistleblowerRewardQuotientElectra; + private final int minSlashingPenaltyQuotientElectra; + private final int maxPartialWithdrawalsPerPayload; + private final int maxAttesterSlashingsElectra; + private final int maxAttestationsElectra; + private final int maxConsolidations; public SpecConfigElectraImpl( final SpecConfigDeneb specConfig, final Bytes4 electraForkVersion, final UInt64 electraForkEpoch, final int maxDepositReceiptsPerPayload, - final int maxExecutionLayerExits) { + final int maxExecutionLayerExits, + final UInt64 minPerEpochChurnLimitElectra, + final UInt64 maxPerEpochActivationExitChurnLimit, + final UInt64 minActivationBalance, + final UInt64 maxEffectiveBalanceElectra, + final UInt64 pendingBalanceDepositsLimit, + final UInt64 pendingPartialWithdrawalsLimit, + final UInt64 pendingConsolidationsLimit, + final int whistleblowerRewardQuotientElectra, + final int minSlashingPenaltyQuotientElectra, + final int maxPartialWithdrawalsPerPayload, + final int maxAttesterSlashingsElectra, + final int maxAttestationsElectra, + final int maxConsolidations) { super(specConfig); this.electraForkVersion = electraForkVersion; this.electraForkEpoch = electraForkEpoch; this.maxDepositReceiptsPerPayload = maxDepositReceiptsPerPayload; this.maxExecutionLayerExits = maxExecutionLayerExits; + this.minPerEpochChurnLimitElectra = minPerEpochChurnLimitElectra; + this.maxPerEpochActivationExitChurnLimit = maxPerEpochActivationExitChurnLimit; + this.minActivationBalance = minActivationBalance; + this.maxEffectiveBalanceElectra = maxEffectiveBalanceElectra; + this.pendingBalanceDepositsLimit = pendingBalanceDepositsLimit; + this.pendingPartialWithdrawalsLimit = pendingPartialWithdrawalsLimit; + this.pendingConsolidationsLimit = pendingConsolidationsLimit; + this.whistleblowerRewardQuotientElectra = whistleblowerRewardQuotientElectra; + this.minSlashingPenaltyQuotientElectra = minSlashingPenaltyQuotientElectra; + this.maxPartialWithdrawalsPerPayload = maxPartialWithdrawalsPerPayload; + this.maxAttesterSlashingsElectra = maxAttesterSlashingsElectra; + this.maxAttestationsElectra = maxAttestationsElectra; + this.maxConsolidations = maxConsolidations; } @Override @@ -59,6 +98,71 @@ public int getMaxExecutionLayerExits() { return maxExecutionLayerExits; } + @Override + public UInt64 getMinActivationBalance() { + return minActivationBalance; + } + + @Override + public UInt64 getMaxEffectiveBalanceElectra() { + return maxEffectiveBalanceElectra; + } + + @Override + public UInt64 getPendingBalanceDepositsLimit() { + return pendingBalanceDepositsLimit; + } + + @Override + public UInt64 getPendingPartialWithdrawalsLimit() { + return pendingPartialWithdrawalsLimit; + } + + @Override + public UInt64 getPendingConsolidationsLimit() { + return pendingConsolidationsLimit; + } + + @Override + public int getWhistleblowerRewardQuotientElectra() { + return whistleblowerRewardQuotientElectra; + } + + @Override + public int getMinSlashingPenaltyQuotientElectra() { + return minSlashingPenaltyQuotientElectra; + } + + @Override + public int getMaxAttesterSlashingsElectra() { + return maxAttesterSlashingsElectra; + } + + @Override + public int getMaxAttestationsElectra() { + return maxAttestationsElectra; + } + + @Override + public int getMaxConsolidations() { + return maxConsolidations; + } + + @Override + public int getMaxPartialWithdrawalsPerPayload() { + return maxPartialWithdrawalsPerPayload; + } + + @Override + public UInt64 getMinPerEpochChurnLimitElectra() { + return minPerEpochChurnLimitElectra; + } + + @Override + public UInt64 getMaxPerEpochActivationExitChurnLimit() { + return maxPerEpochActivationExitChurnLimit; + } + @Override public Optional toVersionElectra() { return Optional.of(this); 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 f1ab10bf21b..dc9924dd9c7 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 @@ -30,8 +30,21 @@ public class ElectraBuilder implements ForkConfigBuilder getValidationMap() { constants.put("electraForkEpoch", electraForkEpoch); constants.put("electraForkVersion", electraForkVersion); constants.put("maxDepositReceiptsPerPayload", maxDepositReceiptsPerPayload); + constants.put("minPerEpochChurnLimitElectra", minPerEpochChurnLimitElectra); + constants.put("maxExecutionLayerExits", maxExecutionLayerExits); + constants.put("minActivationBalance", minActivationBalance); + constants.put("maxEffectiveBalanceElectra", maxEffectiveBalanceElectra); + constants.put("pendingBalanceDepositsLimit", pendingBalanceDepositsLimit); + constants.put("pendingPartialWithdrawalsLimit", pendingPartialWithdrawalsLimit); + constants.put("pendingConsolidationsLimit", pendingConsolidationsLimit); + constants.put("whistleblowerRewardQuotientElectra", whistleblowerRewardQuotientElectra); + constants.put("minSlashingPenaltyQuotientElectra", minSlashingPenaltyQuotientElectra); + constants.put("maxPartialWithdrawalsPerPayload", maxPartialWithdrawalsPerPayload); + constants.put("maxAttesterSlashingsElectra", maxAttesterSlashingsElectra); + constants.put("maxAttestationsElectra", maxAttestationsElectra); + constants.put("maxConsolidations", maxConsolidations); return constants; } diff --git a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/mainnet.yaml b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/mainnet.yaml index a706330f635..1def514bbf2 100644 --- a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/mainnet.yaml +++ b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/mainnet.yaml @@ -141,4 +141,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768 # `2**12` (= 4096 epochs, ~18 days) MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 # `6` -BLOB_SIDECAR_SUBNET_COUNT: 6 \ No newline at end of file +BLOB_SIDECAR_SUBNET_COUNT: 6 + +# [New in Electra:EIP7251] +MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 128000000000 # 2**7 * 10**9 (= 128,000,000,000) +MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000) \ No newline at end of file diff --git a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/minimal.yaml b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/minimal.yaml index 87b928277bb..d913bb3b9cb 100644 --- a/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/minimal.yaml +++ b/ethereum/spec/src/main/resources/tech/pegasys/teku/spec/config/configs/minimal.yaml @@ -141,4 +141,8 @@ MAX_REQUEST_BLOB_SIDECARS: 768 # `2**12` (= 4096 epochs, ~18 days) MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 # `6` -BLOB_SIDECAR_SUBNET_COUNT: 6 \ No newline at end of file +BLOB_SIDECAR_SUBNET_COUNT: 6 + +# [New in Electra:EIP7251] +MIN_PER_EPOCH_CHURN_LIMIT_ELECTRA: 64000000000 # 2**6 * 10**9 (= 64,000,000,000) +MAX_PER_EPOCH_ACTIVATION_EXIT_CHURN_LIMIT: 256000000000 # 2**8 * 10**9 (= 256,000,000,000) \ No newline at end of file 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 b920664fff2..adac3d4f85b 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 @@ -1,8 +1,36 @@ # 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 +# --------------------------------------------------------------- +PENDING_BALANCE_DEPOSITS_LIMIT: 134217728 +PENDING_PARTIAL_WITHDRAWALS_LIMIT: 134217728 +PENDING_CONSOLIDATIONS_LIMIT: 262144 + +# Reward and penalty quotients +# --------------------------------------------------------------- +MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096 +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 +MAX_CONSOLIDATIONS: 1 + # Execution # --------------------------------------------------------------- # 2**13 (= 8192) receipts MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD: 8192 # 2**4 (= 16) exits -MAX_EXECUTION_LAYER_EXITS: 16 \ No newline at end of file +MAX_EXECUTION_LAYER_EXITS: 16 +# 2**3 (= 8) partial withdrawals +MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD: 8 \ 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 ff5bd201834..f36e5a80041 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 @@ -1,8 +1,38 @@ # Minimal 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 +# --------------------------------------------------------------- +PENDING_BALANCE_DEPOSITS_LIMIT: 134217728 +# [customized] smaller queue +PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64 +# [customized] smaller queue +PENDING_CONSOLIDATIONS_LIMIT: 64 + +# Reward and penalty quotients +# --------------------------------------------------------------- +MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096 +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 +MAX_CONSOLIDATIONS: 1 + # Execution # --------------------------------------------------------------- # [customized] MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD: 4 # 2**4 (= 16) exits -MAX_EXECUTION_LAYER_EXITS: 16 \ No newline at end of file +MAX_EXECUTION_LAYER_EXITS: 16 +# [customized] 2**1 (= 2) +MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD: 2 \ 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 d8a8b77dd38..f36e5a80041 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 @@ -1,11 +1,38 @@ # Minimal preset - Electra -# Max operations per block +# Gwei values # --------------------------------------------------------------- -# 2**4 (= 16) -MAX_EXECUTION_LAYER_EXITS: 16 +# 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 +# --------------------------------------------------------------- +PENDING_BALANCE_DEPOSITS_LIMIT: 134217728 +# [customized] smaller queue +PENDING_PARTIAL_WITHDRAWALS_LIMIT: 64 +# [customized] smaller queue +PENDING_CONSOLIDATIONS_LIMIT: 64 + +# Reward and penalty quotients +# --------------------------------------------------------------- +MIN_SLASHING_PENALTY_QUOTIENT_ELECTRA: 4096 +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 +MAX_CONSOLIDATIONS: 1 # Execution # --------------------------------------------------------------- # [customized] -MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD: 4 \ No newline at end of file +MAX_DEPOSIT_RECEIPTS_PER_PAYLOAD: 4 +# 2**4 (= 16) exits +MAX_EXECUTION_LAYER_EXITS: 16 +# [customized] 2**1 (= 2) +MAX_PARTIAL_WITHDRAWALS_PER_PAYLOAD: 2 \ No newline at end of file diff --git a/ethereum/spec/src/test/java/tech/pegasys/teku/spec/config/SpecConfigElectraTest.java b/ethereum/spec/src/test/java/tech/pegasys/teku/spec/config/SpecConfigElectraTest.java index fce8ab80718..e0b79f22f73 100644 --- a/ethereum/spec/src/test/java/tech/pegasys/teku/spec/config/SpecConfigElectraTest.java +++ b/ethereum/spec/src/test/java/tech/pegasys/teku/spec/config/SpecConfigElectraTest.java @@ -83,6 +83,19 @@ private SpecConfigElectra createRandomElectraConfig( dataStructureUtil.randomBytes4(), dataStructureUtil.randomUInt64(999_999), dataStructureUtil.randomPositiveInt(16), - dataStructureUtil.randomPositiveInt(16)) {}; + dataStructureUtil.randomPositiveInt(16), + dataStructureUtil.randomUInt64(128000000000L), + dataStructureUtil.randomUInt64(256000000000L), + dataStructureUtil.randomUInt64(32000000000L), + dataStructureUtil.randomUInt64(2048000000000L), + dataStructureUtil.randomUInt64(134217728L), + dataStructureUtil.randomUInt64(134217728L), + dataStructureUtil.randomUInt64(262144L), + dataStructureUtil.randomPositiveInt(4096), + dataStructureUtil.randomPositiveInt(4096), + dataStructureUtil.randomPositiveInt(8), + dataStructureUtil.randomPositiveInt(8), + dataStructureUtil.randomPositiveInt(8), + dataStructureUtil.randomPositiveInt(8)) {}; } }