Skip to content

Commit d64303f

Browse files
committed
Merge branch 'master' into graffiti-management
2 parents 2e2740d + 92996d3 commit d64303f

File tree

136 files changed

+1363
-358
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1363
-358
lines changed

Diff for: .circleci/config.yml

+16-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ commands:
148148
name: "Publish Docker Images"
149149
command: |
150150
docker login --username "${DOCKER_USER_RW}" --password "${DOCKER_PASSWORD_RW}"
151-
./gradlew --no-daemon --parallel "-Pbranch=${CIRCLE_BRANCH}" uploadDocker
151+
./gradlew --no-daemon --parallel "-Pbranch=${CIRCLE_BRANCH} -PincludeCommitHash=<< pipeline.parameters.include_commit_hash >>" uploadDocker
152152
153153
notify:
154154
description: "Notify Slack"
@@ -157,6 +157,12 @@ commands:
157157
mentions: "team-centaur"
158158
fail_only: true
159159
only_for_branches: 'master'
160+
161+
parameters:
162+
include_commit_hash:
163+
type: boolean
164+
default: false
165+
160166
jobs:
161167
assemble:
162168
executor: large_executor
@@ -431,6 +437,10 @@ jobs:
431437
- notify
432438

433439
publishDockerAmd64:
440+
parameters:
441+
include_commit_hash:
442+
type: boolean
443+
default: false
434444
executor: machine_executor_amd64
435445
steps:
436446
- prepare
@@ -441,6 +451,10 @@ jobs:
441451
- notify
442452

443453
publishDockerArm64:
454+
parameters:
455+
include_commit_hash:
456+
type: boolean
457+
default: false
444458
executor: machine_executor_arm64
445459
steps:
446460
- prepare
@@ -497,7 +511,7 @@ jobs:
497511
paths:
498512
- .openapidoc/spec/teku.json
499513

500-
# longish story here: we store the openapi json spec in the `gh-pages` branch of teku on Github
514+
# longish story here: we store the openapi json spec in the `gh-pages` branch of teku on Github
501515
# The reason we don't use GHA and instead use Circle to push to GHA is:
502516
# 1. We need assemble -> extractAPISpec -> publishAPISpec and this takes circa 10 mins to build in GHA,
503517
# 2. We publish artifacts (openapi, docker, binaries etc) only after ALL tests and we can't check for all the jobs passing to kick this one off

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ the [releases page](https://github.com/Consensys/teku/releases).
1717
- Deposit tree snapshots will be loaded from database as a default unless custom snapshot has been provided.
1818
- Added hidden option `--Xdeposit-contract-logs-syncing-enabled` to allow disabling the syncing of the deposit contract logs from the EL. This is useful when running a non-validating node. It is advisable to be used alongside with `--Xeth1-missing-deposits-event-logging-enabled=false` to avoid unnecessary logging of missing deposits.
1919
- Updated the bootnodes for Chiado and Gnosis networks
20+
- Added hidden option `--Xp2p-dumps-to-file-enabled` to enable saving p2p dumps to file.
2021

2122
### Bug Fixes

Diff for: build.gradle

+10
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,16 @@ def executableAndArg = System.getProperty('os.name').toLowerCase().contains('win
532532
task distDocker {
533533
dependsOn dockerDistUntar
534534
def dockerBuildVersion = 'develop'
535+
536+
if (project.hasProperty('includeCommitHash') && project.property('includeCommitHash').toBoolean()) {
537+
def commitHash = new ByteArrayOutputStream()
538+
exec {
539+
commandLine 'git', 'rev-parse', '--short', 'HEAD'
540+
standardOutput = commitHash
541+
}
542+
dockerBuildVersion += '-' + commitHash
543+
}
544+
535545
doLast {
536546
for (def variant in dockerJdkVariants) {
537547
copy {

Diff for: eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/forkchoice/ForkChoiceTestExecutor.java

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import static org.assertj.core.api.Assertions.assertThat;
1717
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
18+
import static org.mockito.Mockito.mock;
1819
import static tech.pegasys.teku.infrastructure.async.SafeFutureAssert.safeJoin;
1920
import static tech.pegasys.teku.infrastructure.time.TimeUtilities.secondsToMillis;
2021

@@ -69,6 +70,7 @@
6970
import tech.pegasys.teku.statetransition.forkchoice.MergeTransitionBlockValidator;
7071
import tech.pegasys.teku.statetransition.forkchoice.NoopForkChoiceNotifier;
7172
import tech.pegasys.teku.statetransition.forkchoice.TickProcessor;
73+
import tech.pegasys.teku.statetransition.util.DebugDataDumper;
7274
import tech.pegasys.teku.statetransition.validation.BlockBroadcastValidator;
7375
import tech.pegasys.teku.statetransition.validation.InternalValidationResult;
7476
import tech.pegasys.teku.storage.client.RecentChainData;
@@ -139,6 +141,7 @@ spec, new SignedBlockAndState(anchorBlock, anchorState)),
139141
new TickProcessor(spec, recentChainData),
140142
transitionBlockValidator,
141143
true,
144+
mock(DebugDataDumper.class),
142145
storageSystem.getMetricsSystem());
143146
final ExecutionLayerChannelStub executionLayer =
144147
new ExecutionLayerChannelStub(spec, false, Optional.empty());

Diff for: eth-reference-tests/src/referenceTest/java/tech/pegasys/teku/reference/phase0/ssz_generic/containers/SszUInt16.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import tech.pegasys.teku.infrastructure.ssz.impl.AbstractSszPrimitive;
1717

18-
public class SszUInt16 extends AbstractSszPrimitive<Integer, SszUInt16> {
18+
public class SszUInt16 extends AbstractSszPrimitive<Integer> {
1919

2020
public static SszUInt16 of(Integer val) {
2121
return new SszUInt16(val);

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/DelegatingSpecConfig.java

+5
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ public int getMinPerEpochChurnLimit() {
7171
return specConfig.getMinPerEpochChurnLimit();
7272
}
7373

74+
@Override
75+
public UInt64 getMaxPerEpochActivationExitChurnLimit() {
76+
return specConfig.getMaxPerEpochActivationExitChurnLimit();
77+
}
78+
7479
@Override
7580
public int getChurnLimitQuotient() {
7681
return specConfig.getChurnLimitQuotient();

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfig.java

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ default int getMillisPerSlot() {
6262

6363
int getMinPerEpochChurnLimit();
6464

65+
UInt64 getMaxPerEpochActivationExitChurnLimit();
66+
6567
int getChurnLimitQuotient();
6668

6769
// Config: Fork choice

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectra.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ static SpecConfigElectra required(final SpecConfig specConfig) {
5353

5454
int getMaxPartialWithdrawalsPerPayload();
5555

56-
UInt64 getMinPerEpochChurnLimitElectra();
56+
int getMaxWithdrawalRequestsPerPayload();
5757

58-
UInt64 getMaxPerEpochActivationExitChurnLimit();
58+
UInt64 getMinPerEpochChurnLimitElectra();
5959

6060
Bytes4 getElectraForkVersion();
6161

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigElectraImpl.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public class SpecConfigElectraImpl extends DelegatingSpecConfigDeneb implements
2323
private final Bytes4 electraForkVersion;
2424
private final UInt64 electraForkEpoch;
2525
private final UInt64 minPerEpochChurnLimitElectra;
26-
private final UInt64 maxPerEpochActivationExitChurnLimit;
2726

2827
private final int maxDepositReceiptsPerPayload;
2928
private final int maxExecutionLayerExits;
@@ -39,14 +38,15 @@ public class SpecConfigElectraImpl extends DelegatingSpecConfigDeneb implements
3938
private final int maxAttestationsElectra;
4039
private final int maxConsolidations;
4140

41+
private final int maxWithdrawalRequestsPerPayload;
42+
4243
public SpecConfigElectraImpl(
4344
final SpecConfigDeneb specConfig,
4445
final Bytes4 electraForkVersion,
4546
final UInt64 electraForkEpoch,
4647
final int maxDepositReceiptsPerPayload,
4748
final int maxExecutionLayerExits,
4849
final UInt64 minPerEpochChurnLimitElectra,
49-
final UInt64 maxPerEpochActivationExitChurnLimit,
5050
final UInt64 minActivationBalance,
5151
final UInt64 maxEffectiveBalanceElectra,
5252
final int pendingBalanceDepositsLimit,
@@ -57,14 +57,14 @@ public SpecConfigElectraImpl(
5757
final int maxPartialWithdrawalsPerPayload,
5858
final int maxAttesterSlashingsElectra,
5959
final int maxAttestationsElectra,
60-
final int maxConsolidations) {
60+
final int maxConsolidations,
61+
final int maxWithdrawalRequestsPerPayload) {
6162
super(specConfig);
6263
this.electraForkVersion = electraForkVersion;
6364
this.electraForkEpoch = electraForkEpoch;
6465
this.maxDepositReceiptsPerPayload = maxDepositReceiptsPerPayload;
6566
this.maxExecutionLayerExits = maxExecutionLayerExits;
6667
this.minPerEpochChurnLimitElectra = minPerEpochChurnLimitElectra;
67-
this.maxPerEpochActivationExitChurnLimit = maxPerEpochActivationExitChurnLimit;
6868
this.minActivationBalance = minActivationBalance;
6969
this.maxEffectiveBalanceElectra = maxEffectiveBalanceElectra;
7070
this.pendingBalanceDepositsLimit = pendingBalanceDepositsLimit;
@@ -76,6 +76,7 @@ public SpecConfigElectraImpl(
7676
this.maxAttesterSlashingsElectra = maxAttesterSlashingsElectra;
7777
this.maxAttestationsElectra = maxAttestationsElectra;
7878
this.maxConsolidations = maxConsolidations;
79+
this.maxWithdrawalRequestsPerPayload = maxWithdrawalRequestsPerPayload;
7980
}
8081

8182
@Override
@@ -159,13 +160,13 @@ public UInt64 getMinPerEpochChurnLimitElectra() {
159160
}
160161

161162
@Override
162-
public UInt64 getMaxPerEpochActivationExitChurnLimit() {
163-
return maxPerEpochActivationExitChurnLimit;
163+
public Optional<SpecConfigElectra> toVersionElectra() {
164+
return Optional.of(this);
164165
}
165166

166167
@Override
167-
public Optional<SpecConfigElectra> toVersionElectra() {
168-
return Optional.of(this);
168+
public int getMaxWithdrawalRequestsPerPayload() {
169+
return maxWithdrawalRequestsPerPayload;
169170
}
170171

171172
@Override

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/SpecConfigPhase0.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ public class SpecConfigPhase0 implements SpecConfig {
120120
private final int reorgHeadWeightThreshold;
121121
private final int reorgParentWeightThreshold;
122122

123+
private final UInt64 maxPerEpochActivationExitChurnLimit;
124+
123125
public SpecConfigPhase0(
124126
final Map<String, Object> rawConfig,
125127
final UInt64 eth1FollowDistance,
@@ -188,7 +190,8 @@ public SpecConfigPhase0(
188190
final int attestationSubnetPrefixBits,
189191
final int reorgMaxEpochsSinceFinalization,
190192
final int reorgHeadWeightThreshold,
191-
final int reorgParentWeightThreshold) {
193+
final int reorgParentWeightThreshold,
194+
final UInt64 maxPerEpochActivationExitChurnLimit) {
192195
this.rawConfig = rawConfig;
193196
this.eth1FollowDistance = eth1FollowDistance;
194197
this.maxCommitteesPerSlot = maxCommitteesPerSlot;
@@ -258,6 +261,7 @@ public SpecConfigPhase0(
258261
this.reorgMaxEpochsSinceFinalization = reorgMaxEpochsSinceFinalization;
259262
this.reorgHeadWeightThreshold = reorgHeadWeightThreshold;
260263
this.reorgParentWeightThreshold = reorgParentWeightThreshold;
264+
this.maxPerEpochActivationExitChurnLimit = maxPerEpochActivationExitChurnLimit;
261265
}
262266

263267
@Override
@@ -305,6 +309,11 @@ public int getMinPerEpochChurnLimit() {
305309
return minPerEpochChurnLimit;
306310
}
307311

312+
@Override
313+
public UInt64 getMaxPerEpochActivationExitChurnLimit() {
314+
return maxPerEpochActivationExitChurnLimit;
315+
}
316+
308317
@Override
309318
public int getChurnLimitQuotient() {
310319
return churnLimitQuotient;

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/ElectraBuilder.java

+10-11
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ public class ElectraBuilder implements ForkConfigBuilder<SpecConfigDeneb, SpecCo
3232
private UInt64 electraForkEpoch;
3333
// TODO: remove default when EIP-7251 become part of the Electra
3434
private UInt64 minPerEpochChurnLimitElectra = UInt64.ZERO;
35-
// TODO: remove default when EIP-7251 become part of the Electra
36-
private UInt64 maxPerEpochActivationExitChurnLimit = UInt64.ZERO;
3735
private Integer maxDepositReceiptsPerPayload;
3836
private Integer maxExecutionLayerExits;
3937
private UInt64 minActivationBalance;
@@ -44,6 +42,7 @@ public class ElectraBuilder implements ForkConfigBuilder<SpecConfigDeneb, SpecCo
4442
private Integer whistleblowerRewardQuotientElectra;
4543
private Integer minSlashingPenaltyQuotientElectra;
4644
private Integer maxPartialWithdrawalsPerPayload;
45+
private Integer maxWithdrawalRequestsPerPayload;
4746
private Integer maxAttesterSlashingsElectra;
4847
private Integer maxAttestationsElectra;
4948
private Integer maxConsolidations;
@@ -59,7 +58,6 @@ public SpecConfigElectra build(final SpecConfigDeneb specConfig) {
5958
maxDepositReceiptsPerPayload,
6059
maxExecutionLayerExits,
6160
minPerEpochChurnLimitElectra,
62-
maxPerEpochActivationExitChurnLimit,
6361
minActivationBalance,
6462
maxEffectiveBalanceElectra,
6563
pendingBalanceDepositsLimit,
@@ -70,7 +68,8 @@ public SpecConfigElectra build(final SpecConfigDeneb specConfig) {
7068
maxPartialWithdrawalsPerPayload,
7169
maxAttesterSlashingsElectra,
7270
maxAttestationsElectra,
73-
maxConsolidations);
71+
maxConsolidations,
72+
maxWithdrawalRequestsPerPayload);
7473
}
7574

7675
public ElectraBuilder electraForkEpoch(final UInt64 electraForkEpoch) {
@@ -103,13 +102,6 @@ public ElectraBuilder minPerEpochChurnLimitElectra(final UInt64 minPerEpochChurn
103102
return this;
104103
}
105104

106-
public ElectraBuilder maxPerEpochActivationExitChurnLimit(
107-
final UInt64 maxPerEpochActivationExitChurnLimit) {
108-
checkNotNull(maxPerEpochActivationExitChurnLimit);
109-
this.maxPerEpochActivationExitChurnLimit = maxPerEpochActivationExitChurnLimit;
110-
return this;
111-
}
112-
113105
public ElectraBuilder minActivationBalance(final UInt64 minActivationBalance) {
114106
checkNotNull(minActivationBalance);
115107
this.minActivationBalance = minActivationBalance;
@@ -162,6 +154,13 @@ public ElectraBuilder maxPartialWithdrawalsPerPayload(
162154
return this;
163155
}
164156

157+
public ElectraBuilder maxWithdrawalRequestsPerPayload(
158+
final Integer maxWithdrawalRequestsPerPayload) {
159+
checkNotNull(maxWithdrawalRequestsPerPayload);
160+
this.maxWithdrawalRequestsPerPayload = maxWithdrawalRequestsPerPayload;
161+
return this;
162+
}
163+
165164
public ElectraBuilder maxAttesterSlashingsElectra(final Integer maxAttesterSlashingsElectra) {
166165
checkNotNull(maxAttesterSlashingsElectra);
167166
this.maxAttesterSlashingsElectra = maxAttesterSlashingsElectra;

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/SpecConfigBuilder.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ public class SpecConfigBuilder {
130130

131131
private Integer reorgParentWeightThreshold = 160;
132132

133+
private UInt64 maxPerEpochActivationExitChurnLimit = UInt64.valueOf(256000000000L);
133134
private final BuilderChain<SpecConfig, SpecConfigElectra> builderChain =
134135
BuilderChain.create(new AltairBuilder())
135136
.appendBuilder(new BellatrixBuilder())
@@ -214,7 +215,8 @@ public SpecConfig build() {
214215
attestationSubnetPrefixBits,
215216
reorgMaxEpochsSinceFinalization,
216217
reorgHeadWeightThreshold,
217-
reorgParentWeightThreshold);
218+
reorgParentWeightThreshold,
219+
maxPerEpochActivationExitChurnLimit);
218220

219221
return builderChain.build(config);
220222
}
@@ -537,6 +539,13 @@ public SpecConfigBuilder proposerRewardQuotient(final UInt64 proposerRewardQuoti
537539
return this;
538540
}
539541

542+
public SpecConfigBuilder maxPerEpochActivationExitChurnLimit(
543+
final UInt64 maxPerEpochActivationExitChurnLimit) {
544+
checkNotNull(maxPerEpochActivationExitChurnLimit);
545+
this.maxPerEpochActivationExitChurnLimit = maxPerEpochActivationExitChurnLimit;
546+
return this;
547+
}
548+
540549
public SpecConfigBuilder inactivityPenaltyQuotient(final UInt64 inactivityPenaltyQuotient) {
541550
checkNotNull(inactivityPenaltyQuotient);
542551
this.inactivityPenaltyQuotient = inactivityPenaltyQuotient;

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/helpers/Predicates.java

+6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616
import static tech.pegasys.teku.infrastructure.crypto.Hash.getSha256Instance;
1717
import static tech.pegasys.teku.spec.constants.WithdrawalPrefixes.ETH1_ADDRESS_WITHDRAWAL_BYTE;
1818

19+
import java.util.Optional;
1920
import org.apache.tuweni.bytes.Bytes32;
2021
import tech.pegasys.teku.infrastructure.crypto.Sha256;
2122
import tech.pegasys.teku.infrastructure.ssz.collections.SszBytes32Vector;
2223
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
2324
import tech.pegasys.teku.spec.config.SpecConfig;
2425
import tech.pegasys.teku.spec.datastructures.state.Validator;
26+
import tech.pegasys.teku.spec.logic.versions.electra.helpers.PredicatesElectra;
2527

2628
public class Predicates {
2729

@@ -133,4 +135,8 @@ public boolean isPartiallyWithdrawableValidatorEth1CredentialsChecked(
133135

134136
return hasMaxEffectiveBalance && hasExcessBalance;
135137
}
138+
139+
public Optional<PredicatesElectra> toVersionElectra() {
140+
return Optional.empty();
141+
}
136142
}

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/AbstractEpochProcessor.java

+2
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ protected void processEpoch(final BeaconState preState, final MutableBeaconState
118118
processRegistryUpdates(state, validatorStatuses.getStatuses());
119119
processSlashings(state, validatorStatuses);
120120
processEth1DataReset(state);
121+
processPendingBalanceDeposits(state);
122+
processPendingConsolidations(state);
121123
processEffectiveBalanceUpdates(state, validatorStatuses.getStatuses());
122124
processSlashingsReset(state);
123125
processRandaoMixesReset(state);

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/common/statetransition/epoch/EpochProcessor.java

+4
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,8 @@ void processRegistryUpdates(MutableBeaconState state, List<ValidatorStatus> stat
9999
void processHistoricalSummariesUpdate(MutableBeaconState state);
100100

101101
void processSyncCommitteeUpdates(MutableBeaconState state);
102+
103+
void processPendingBalanceDeposits(MutableBeaconState state);
104+
105+
void processPendingConsolidations(MutableBeaconState state);
102106
}

Diff for: ethereum/spec/src/main/java/tech/pegasys/teku/spec/logic/versions/altair/statetransition/epoch/EpochProcessorAltair.java

+6
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ public void processSyncCommitteeUpdates(final MutableBeaconState genericState) {
129129
}
130130
}
131131

132+
@Override
133+
public void processPendingBalanceDeposits(final MutableBeaconState state) {}
134+
135+
@Override
136+
public void processPendingConsolidations(final MutableBeaconState state) {}
137+
132138
/**
133139
* Replaces the progressive total balances in the state transition caches with an altair one if
134140
* not already in use. This handles both upgrading on milestone transition and switching from the

0 commit comments

Comments
 (0)