Skip to content

Commit

Permalink
Change order of electra presets to match spec (#8762)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Saldanha <[email protected]>
  • Loading branch information
jtraglia and lucassaldanha authored Oct 21, 2024
1 parent 6e113aa commit 07e59f9
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ public class SpecConfigElectraImpl extends DelegatingSpecConfigDeneb implements

private final UInt64 minActivationBalance;
private final UInt64 maxEffectiveBalanceElectra;
private final int minSlashingPenaltyQuotientElectra;
private final int whistleblowerRewardQuotientElectra;
private final int pendingDepositsLimit;
private final int pendingPartialWithdrawalsLimit;
private final int pendingConsolidationsLimit;
private final int minSlashingPenaltyQuotientElectra;
private final int whistleblowerRewardQuotientElectra;
private final int maxAttesterSlashingsElectra;
private final int maxAttestationsElectra;
private final int maxConsolidationRequestsPerPayload;
private final int maxDepositRequestsPerPayload;
private final int maxWithdrawalRequestsPerPayload;
private final int maxConsolidationRequestsPerPayload;
private final int maxPendingPartialsPerWithdrawalsSweep;
private final int maxPendingDepositsPerEpoch;

Expand All @@ -47,16 +47,16 @@ public SpecConfigElectraImpl(
final UInt64 minPerEpochChurnLimitElectra,
final UInt64 minActivationBalance,
final UInt64 maxEffectiveBalanceElectra,
final int minSlashingPenaltyQuotientElectra,
final int whistleblowerRewardQuotientElectra,
final int pendingDepositsLimit,
final int pendingPartialWithdrawalsLimit,
final int pendingConsolidationsLimit,
final int minSlashingPenaltyQuotientElectra,
final int whistleblowerRewardQuotientElectra,
final int maxAttesterSlashingsElectra,
final int maxAttestationsElectra,
final int maxConsolidationRequestsPerPayload,
final int maxDepositRequestsPerPayload,
final int maxWithdrawalRequestsPerPayload,
final int maxConsolidationRequestsPerPayload,
final int maxPendingPartialsPerWithdrawalsSweep,
final int maxPendingDepositsPerEpoch) {
super(specConfig);
Expand All @@ -65,16 +65,16 @@ public SpecConfigElectraImpl(
this.minPerEpochChurnLimitElectra = minPerEpochChurnLimitElectra;
this.minActivationBalance = minActivationBalance;
this.maxEffectiveBalanceElectra = maxEffectiveBalanceElectra;
this.minSlashingPenaltyQuotientElectra = minSlashingPenaltyQuotientElectra;
this.whistleblowerRewardQuotientElectra = whistleblowerRewardQuotientElectra;
this.pendingDepositsLimit = pendingDepositsLimit;
this.pendingPartialWithdrawalsLimit = pendingPartialWithdrawalsLimit;
this.pendingConsolidationsLimit = pendingConsolidationsLimit;
this.minSlashingPenaltyQuotientElectra = minSlashingPenaltyQuotientElectra;
this.whistleblowerRewardQuotientElectra = whistleblowerRewardQuotientElectra;
this.maxAttesterSlashingsElectra = maxAttesterSlashingsElectra;
this.maxAttestationsElectra = maxAttestationsElectra;
this.maxConsolidationRequestsPerPayload = maxConsolidationRequestsPerPayload;
this.maxDepositRequestsPerPayload = maxDepositRequestsPerPayload;
this.maxWithdrawalRequestsPerPayload = maxWithdrawalRequestsPerPayload;
this.maxConsolidationRequestsPerPayload = maxConsolidationRequestsPerPayload;
this.maxPendingPartialsPerWithdrawalsSweep = maxPendingPartialsPerWithdrawalsSweep;
this.maxPendingDepositsPerEpoch = maxPendingDepositsPerEpoch;
}
Expand Down Expand Up @@ -105,28 +105,28 @@ public UInt64 getMaxEffectiveBalanceElectra() {
}

@Override
public int getPendingDepositsLimit() {
return pendingDepositsLimit;
public int getMinSlashingPenaltyQuotientElectra() {
return minSlashingPenaltyQuotientElectra;
}

@Override
public int getPendingPartialWithdrawalsLimit() {
return pendingPartialWithdrawalsLimit;
public int getWhistleblowerRewardQuotientElectra() {
return whistleblowerRewardQuotientElectra;
}

@Override
public int getPendingConsolidationsLimit() {
return pendingConsolidationsLimit;
public int getPendingDepositsLimit() {
return pendingDepositsLimit;
}

@Override
public int getMinSlashingPenaltyQuotientElectra() {
return minSlashingPenaltyQuotientElectra;
public int getPendingPartialWithdrawalsLimit() {
return pendingPartialWithdrawalsLimit;
}

@Override
public int getWhistleblowerRewardQuotientElectra() {
return whistleblowerRewardQuotientElectra;
public int getPendingConsolidationsLimit() {
return pendingConsolidationsLimit;
}

@Override
Expand All @@ -139,11 +139,6 @@ public int getMaxAttestationsElectra() {
return maxAttestationsElectra;
}

@Override
public int getMaxConsolidationRequestsPerPayload() {
return maxConsolidationRequestsPerPayload;
}

@Override
public int getMaxDepositRequestsPerPayload() {
return maxDepositRequestsPerPayload;
Expand All @@ -154,6 +149,11 @@ public int getMaxWithdrawalRequestsPerPayload() {
return maxWithdrawalRequestsPerPayload;
}

@Override
public int getMaxConsolidationRequestsPerPayload() {
return maxConsolidationRequestsPerPayload;
}

@Override
public int getMaxPendingPartialsPerWithdrawalsSweep() {
return maxPendingPartialsPerWithdrawalsSweep;
Expand Down Expand Up @@ -184,16 +184,16 @@ public boolean equals(final Object o) {
&& Objects.equals(minPerEpochChurnLimitElectra, that.minPerEpochChurnLimitElectra)
&& Objects.equals(minActivationBalance, that.minActivationBalance)
&& Objects.equals(maxEffectiveBalanceElectra, that.maxEffectiveBalanceElectra)
&& minSlashingPenaltyQuotientElectra == that.minSlashingPenaltyQuotientElectra
&& whistleblowerRewardQuotientElectra == that.whistleblowerRewardQuotientElectra
&& pendingDepositsLimit == that.pendingDepositsLimit
&& pendingPartialWithdrawalsLimit == that.pendingPartialWithdrawalsLimit
&& pendingConsolidationsLimit == that.pendingConsolidationsLimit
&& minSlashingPenaltyQuotientElectra == that.minSlashingPenaltyQuotientElectra
&& whistleblowerRewardQuotientElectra == that.whistleblowerRewardQuotientElectra
&& maxAttesterSlashingsElectra == that.maxAttesterSlashingsElectra
&& maxAttestationsElectra == that.maxAttestationsElectra
&& maxConsolidationRequestsPerPayload == that.maxConsolidationRequestsPerPayload
&& maxDepositRequestsPerPayload == that.maxDepositRequestsPerPayload
&& maxWithdrawalRequestsPerPayload == that.maxWithdrawalRequestsPerPayload
&& maxConsolidationRequestsPerPayload == that.maxConsolidationRequestsPerPayload
&& maxPendingPartialsPerWithdrawalsSweep == that.maxPendingPartialsPerWithdrawalsSweep
&& maxPendingDepositsPerEpoch == that.maxPendingDepositsPerEpoch;
}
Expand All @@ -207,16 +207,16 @@ public int hashCode() {
minPerEpochChurnLimitElectra,
minActivationBalance,
maxEffectiveBalanceElectra,
minSlashingPenaltyQuotientElectra,
whistleblowerRewardQuotientElectra,
pendingDepositsLimit,
pendingPartialWithdrawalsLimit,
pendingConsolidationsLimit,
minSlashingPenaltyQuotientElectra,
whistleblowerRewardQuotientElectra,
maxAttesterSlashingsElectra,
maxAttestationsElectra,
maxConsolidationRequestsPerPayload,
maxDepositRequestsPerPayload,
maxWithdrawalRequestsPerPayload,
maxConsolidationRequestsPerPayload,
maxPendingPartialsPerWithdrawalsSweep,
maxPendingDepositsPerEpoch);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@ public class ElectraBuilder implements ForkConfigBuilder<SpecConfigDeneb, SpecCo
private UInt64 electraForkEpoch;

private UInt64 minPerEpochChurnLimitElectra;

private UInt64 minActivationBalance;
private UInt64 maxEffectiveBalanceElectra;
private Integer minSlashingPenaltyQuotientElectra;
private Integer whistleblowerRewardQuotientElectra;
private Integer pendingDepositsLimit;
private Integer pendingPartialWithdrawalsLimit;
private Integer pendingConsolidationsLimit;
private Integer minSlashingPenaltyQuotientElectra;
private Integer whistleblowerRewardQuotientElectra;
private Integer maxAttesterSlashingsElectra;
private Integer maxAttestationsElectra;
private Integer maxConsolidationRequestsPerPayload;
private Integer maxDepositRequestsPerPayload;
private Integer maxWithdrawalRequestsPerPayload;
private Integer maxConsolidationRequestsPerPayload;
private Integer maxPendingPartialsPerWithdrawalsSweep;
private Integer maxPendingDepositsPerEpoch;

Expand All @@ -58,32 +59,32 @@ public SpecConfigElectra build(final SpecConfigDeneb specConfig) {
minPerEpochChurnLimitElectra,
minActivationBalance,
maxEffectiveBalanceElectra,
minSlashingPenaltyQuotientElectra,
whistleblowerRewardQuotientElectra,
pendingDepositsLimit,
pendingPartialWithdrawalsLimit,
pendingConsolidationsLimit,
minSlashingPenaltyQuotientElectra,
whistleblowerRewardQuotientElectra,
maxAttesterSlashingsElectra,
maxAttestationsElectra,
maxConsolidationRequestsPerPayload,
maxDepositRequestsPerPayload,
maxWithdrawalRequestsPerPayload,
maxConsolidationRequestsPerPayload,
maxPendingPartialsPerWithdrawalsSweep,
maxPendingDepositsPerEpoch);
}

public ElectraBuilder electraForkEpoch(final UInt64 electraForkEpoch) {
checkNotNull(electraForkEpoch);
this.electraForkEpoch = electraForkEpoch;
return this;
}

public ElectraBuilder electraForkVersion(final Bytes4 electraForkVersion) {
checkNotNull(electraForkVersion);
this.electraForkVersion = electraForkVersion;
return this;
}

public ElectraBuilder electraForkEpoch(final UInt64 electraForkEpoch) {
checkNotNull(electraForkEpoch);
this.electraForkEpoch = electraForkEpoch;
return this;
}

public ElectraBuilder minPerEpochChurnLimitElectra(final UInt64 minPerEpochChurnLimitElectra) {
checkNotNull(minPerEpochChurnLimitElectra);
this.minPerEpochChurnLimitElectra = minPerEpochChurnLimitElectra;
Expand All @@ -102,6 +103,20 @@ public ElectraBuilder maxEffectiveBalanceElectra(final UInt64 maxEffectiveBalanc
return this;
}

public ElectraBuilder minSlashingPenaltyQuotientElectra(
final Integer minSlashingPenaltyQuotientElectra) {
checkNotNull(minSlashingPenaltyQuotientElectra);
this.minSlashingPenaltyQuotientElectra = minSlashingPenaltyQuotientElectra;
return this;
}

public ElectraBuilder whistleblowerRewardQuotientElectra(
final Integer whistleblowerRewardQuotientElectra) {
checkNotNull(whistleblowerRewardQuotientElectra);
this.whistleblowerRewardQuotientElectra = whistleblowerRewardQuotientElectra;
return this;
}

public ElectraBuilder pendingDepositsLimit(final Integer pendingDepositsLimit) {
checkNotNull(pendingDepositsLimit);
this.pendingDepositsLimit = pendingDepositsLimit;
Expand All @@ -121,20 +136,6 @@ public ElectraBuilder pendingConsolidationsLimit(final Integer pendingConsolidat
return this;
}

public ElectraBuilder minSlashingPenaltyQuotientElectra(
final Integer minSlashingPenaltyQuotientElectra) {
checkNotNull(minSlashingPenaltyQuotientElectra);
this.minSlashingPenaltyQuotientElectra = minSlashingPenaltyQuotientElectra;
return this;
}

public ElectraBuilder whistleblowerRewardQuotientElectra(
final Integer whistleblowerRewardQuotientElectra) {
checkNotNull(whistleblowerRewardQuotientElectra);
this.whistleblowerRewardQuotientElectra = whistleblowerRewardQuotientElectra;
return this;
}

public ElectraBuilder maxAttesterSlashingsElectra(final Integer maxAttesterSlashingsElectra) {
checkNotNull(maxAttesterSlashingsElectra);
this.maxAttesterSlashingsElectra = maxAttesterSlashingsElectra;
Expand All @@ -147,13 +148,6 @@ public ElectraBuilder maxAttestationsElectra(final Integer maxAttestationsElectr
return this;
}

public ElectraBuilder maxConsolidationRequestsPerPayload(
final Integer maxConsolidationsRequestPerPayload) {
checkNotNull(maxConsolidationsRequestPerPayload);
this.maxConsolidationRequestsPerPayload = maxConsolidationsRequestPerPayload;
return this;
}

public ElectraBuilder maxDepositRequestsPerPayload(final Integer maxDepositRequestsPerPayload) {
checkNotNull(maxDepositRequestsPerPayload);
this.maxDepositRequestsPerPayload = maxDepositRequestsPerPayload;
Expand All @@ -167,6 +161,13 @@ public ElectraBuilder maxWithdrawalRequestsPerPayload(
return this;
}

public ElectraBuilder maxConsolidationRequestsPerPayload(
final Integer maxConsolidationsRequestPerPayload) {
checkNotNull(maxConsolidationsRequestPerPayload);
this.maxConsolidationRequestsPerPayload = maxConsolidationsRequestPerPayload;
return this;
}

public ElectraBuilder maxPendingPartialsPerWithdrawalsSweep(
final Integer maxPendingPartialsPerWithdrawalsSweep) {
checkNotNull(maxPendingPartialsPerWithdrawalsSweep);
Expand Down

0 comments on commit 07e59f9

Please sign in to comment.