Skip to content

Commit ea032df

Browse files
committed
Merge branch 'master' into sync-committee-duties
2 parents 10922d7 + 70b7980 commit ea032df

File tree

78 files changed

+2993
-2151
lines changed

Some content is hidden

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

78 files changed

+2993
-2151
lines changed

Diff for: .github/workflows/codeql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
uses: actions/checkout@v4
4444

4545
- name: Set up Java
46-
uses: actions/setup-java@v3
46+
uses: actions/setup-java@v4
4747
with:
4848
distribution: adopt
4949
java-version: 17

Diff for: CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ the [releases page](https://github.com/Consensys/teku/releases).
1010
## Unreleased Changes
1111

1212
### Breaking Changes
13+
- When a lock file is unable to be cleaned up, the (BN or VC) will now exit code 2 in preference to being 'up' but not able to perform duties. This will not self recover and will need intervention from the node operator.
1314

1415
### Additions and Improvements
1516
- Improve block rewards calculation performance for `/eth/v3/validator/blocks/{slot}` block production beacon node API.
1617
- Updated Javalin to v.6 (used by rest-api and keymanager-api).
18+
- Docker image tags now default to jdk21 images unless a jdk-specific tag is used.
1719

1820
### Bug Fixes
21+
- Fixed an issue where stale lock files weren't able to be cleaned up and would effectively park the service (BN or VC) with no user errors or any indication that the service was in a bad state.

Diff for: acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/AddValidatorsAcceptanceTest.java

+9-8
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import org.junit.jupiter.api.Test;
1717
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
1818
import tech.pegasys.teku.test.acceptance.dsl.GenesisGenerator.InitialStateData;
19-
import tech.pegasys.teku.test.acceptance.dsl.TekuNode;
19+
import tech.pegasys.teku.test.acceptance.dsl.TekuBeaconNode;
20+
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
2021
import tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores;
2122

2223
public class AddValidatorsAcceptanceTest extends AcceptanceTestBase {
@@ -37,13 +38,13 @@ void shouldLoadAdditionalValidatorsWithoutRestart() throws Exception {
3738
.validatorKeys(initialKeystores, additionalKeystores)
3839
.generate();
3940

40-
final TekuNode node =
41-
createTekuNode(
42-
config ->
43-
config
44-
.withNetwork(networkName)
45-
.withInitialState(genesis)
46-
.withValidatorKeystores(initialKeystores));
41+
final TekuBeaconNode node =
42+
createTekuBeaconNode(
43+
TekuNodeConfigBuilder.createBeaconNode()
44+
.withNetwork(networkName)
45+
.withInitialState(genesis)
46+
.withReadOnlyKeystorePath(initialKeystores)
47+
.build());
4748
node.start();
4849

4950
node.waitForOwnedValidatorCount(2);

Diff for: acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/AttestationGossipAcceptanceTest.java

+16-13
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,30 @@
1616
import org.junit.jupiter.api.Test;
1717
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
1818
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
19-
import tech.pegasys.teku.test.acceptance.dsl.TekuNode;
19+
import tech.pegasys.teku.test.acceptance.dsl.TekuBeaconNode;
20+
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
2021

2122
public class AttestationGossipAcceptanceTest extends AcceptanceTestBase {
2223
@Test
2324
public void shouldFinalizeWithTwoNodes() throws Exception {
24-
final TekuNode node1 =
25-
createTekuNode(
26-
config -> config.withRealNetwork().withNetwork("minimal").withInteropValidators(0, 32));
25+
final TekuBeaconNode node1 =
26+
createTekuBeaconNode(
27+
TekuNodeConfigBuilder.createBeaconNode()
28+
.withRealNetwork()
29+
.withInteropValidators(0, 32)
30+
.build());
2731

2832
node1.start();
2933
final UInt64 genesisTime = node1.getGenesisTime();
3034

31-
final TekuNode node2 =
32-
createTekuNode(
33-
config ->
34-
config
35-
.withNetwork("minimal")
36-
.withGenesisTime(genesisTime.intValue())
37-
.withRealNetwork()
38-
.withPeers(node1)
39-
.withInteropValidators(32, 32));
35+
final TekuBeaconNode node2 =
36+
createTekuBeaconNode(
37+
TekuNodeConfigBuilder.createBeaconNode()
38+
.withGenesisTime(genesisTime.intValue())
39+
.withRealNetwork()
40+
.withPeers(node1)
41+
.withInteropValidators(32, 32)
42+
.build());
4043
node2.start();
4144

4245
node2.waitForAttestationBeingGossiped(32, 64);

Diff for: acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/BellatrixMergeTransitionAcceptanceTest.java

+16-14
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
package tech.pegasys.teku.test.acceptance;
1515

1616
import com.google.common.io.Resources;
17+
import java.io.IOException;
1718
import java.net.URL;
1819
import org.junit.jupiter.api.BeforeEach;
1920
import org.junit.jupiter.api.Test;
2021
import tech.pegasys.teku.infrastructure.time.SystemTimeProvider;
2122
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
2223
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
2324
import tech.pegasys.teku.test.acceptance.dsl.BesuNode;
24-
import tech.pegasys.teku.test.acceptance.dsl.TekuNode;
25+
import tech.pegasys.teku.test.acceptance.dsl.TekuBeaconNode;
26+
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
2527
import tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores;
2628

2729
public class BellatrixMergeTransitionAcceptanceTest extends AcceptanceTestBase {
@@ -31,7 +33,7 @@ public class BellatrixMergeTransitionAcceptanceTest extends AcceptanceTestBase {
3133

3234
private final SystemTimeProvider timeProvider = new SystemTimeProvider();
3335
private BesuNode eth1Node;
34-
private TekuNode tekuNode;
36+
private TekuBeaconNode tekuNode;
3537

3638
@BeforeEach
3739
void setup() throws Exception {
@@ -50,16 +52,16 @@ void setup() throws Exception {
5052
final ValidatorKeystores validatorKeystores =
5153
createTekuDepositSender(NETWORK_NAME).sendValidatorDeposits(eth1Node, totalValidators);
5254
tekuNode =
53-
createTekuNode(
54-
config ->
55-
configureTekuNode(config, genesisTime)
56-
.withDepositsFrom(eth1Node)
57-
.withStartupTargetPeerCount(0)
58-
.withValidatorKeystores(validatorKeystores)
59-
.withValidatorProposerDefaultFeeRecipient(
60-
"0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73")
61-
.withExecutionEngine(eth1Node)
62-
.withJwtSecretFile(JWT_FILE));
55+
createTekuBeaconNode(
56+
configureTekuNode(genesisTime)
57+
.withDepositsFrom(eth1Node)
58+
.withExecutionEngine(eth1Node)
59+
.withStartupTargetPeerCount(0)
60+
.withReadOnlyKeystorePath(validatorKeystores)
61+
.withValidatorProposerDefaultFeeRecipient(
62+
"0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73")
63+
.withJwtSecretFile(JWT_FILE)
64+
.build());
6365
tekuNode.start();
6466
}
6567

@@ -71,8 +73,8 @@ void shouldHaveNonDefaultExecutionPayloadAndFinalizeAfterMergeTransition() {
7173
tekuNode.waitForNewFinalization();
7274
}
7375

74-
private TekuNode.Config configureTekuNode(final TekuNode.Config node, final int genesisTime) {
75-
return node.withNetwork(NETWORK_NAME)
76+
private TekuNodeConfigBuilder configureTekuNode(final int genesisTime) throws IOException {
77+
return TekuNodeConfigBuilder.createBeaconNode()
7678
.withBellatrixEpoch(UInt64.ONE)
7779
.withTotalTerminalDifficulty(10001)
7880
.withGenesisTime(genesisTime);

Diff for: acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/BlsToExecutionChangeAcceptanceTest.java

+33-33
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
package tech.pegasys.teku.test.acceptance;
1515

16+
import java.io.IOException;
1617
import java.util.List;
1718
import org.junit.jupiter.api.Test;
1819
import tech.pegasys.teku.api.response.v1.EventType;
@@ -21,13 +22,11 @@
2122
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
2223
import tech.pegasys.teku.spec.datastructures.interop.MockStartValidatorKeyPairFactory;
2324
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
24-
import tech.pegasys.teku.test.acceptance.dsl.TekuNode;
25-
import tech.pegasys.teku.test.acceptance.dsl.TekuNode.Config;
25+
import tech.pegasys.teku.test.acceptance.dsl.TekuBeaconNode;
26+
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
2627

2728
public class BlsToExecutionChangeAcceptanceTest extends AcceptanceTestBase {
2829

29-
private static final String NETWORK_NAME = "swift";
30-
3130
@Test
3231
void shouldUpdateWithdrawalCredentials() throws Exception {
3332
final int validatorIndex = 0;
@@ -39,12 +38,12 @@ void shouldUpdateWithdrawalCredentials() throws Exception {
3938
Eth1Address.fromHexString("0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73");
4039
final UInt64 capellaActivationEpoch = UInt64.ONE;
4140

42-
final TekuNode primaryNode = createPrimaryNode(executionAddress, capellaActivationEpoch);
41+
final TekuBeaconNode primaryNode = createPrimaryNode(executionAddress, capellaActivationEpoch);
4342
primaryNode.start();
4443
primaryNode.waitForNextEpoch();
4544
primaryNode.startEventListener(EventType.bls_to_execution_change);
4645

47-
final TekuNode lateJoiningNode =
46+
final TekuBeaconNode lateJoiningNode =
4847
createLateJoiningNode(capellaActivationEpoch, primaryNode, primaryNode.getGenesisTime());
4948
lateJoiningNode.start();
5049
lateJoiningNode.waitUntilInSyncWith(primaryNode);
@@ -57,36 +56,37 @@ void shouldUpdateWithdrawalCredentials() throws Exception {
5756
lateJoiningNode.waitForBlsToExecutionChangeEventForValidator(0);
5857
}
5958

60-
private TekuNode createPrimaryNode(
61-
final Eth1Address executionAddress, final UInt64 capellaActivationEpoch) {
62-
return createTekuNode(
63-
c -> {
64-
c.withNetwork(NETWORK_NAME)
65-
.withRealNetwork()
66-
.withStartupTargetPeerCount(0)
67-
.withValidatorProposerDefaultFeeRecipient(executionAddress.toHexString());
68-
applyMilestoneConfig(c, capellaActivationEpoch);
69-
});
59+
private TekuBeaconNode createPrimaryNode(
60+
final Eth1Address executionAddress, final UInt64 capellaActivationEpoch) throws IOException {
61+
return createTekuBeaconNode(
62+
beaconNodeWithMilestones(capellaActivationEpoch)
63+
.withStartupTargetPeerCount(0)
64+
.withValidatorProposerDefaultFeeRecipient(executionAddress.toHexString())
65+
.build());
7066
}
7167

72-
private TekuNode createLateJoiningNode(
73-
final UInt64 capellaActivationEpoch, final TekuNode primaryNode, final UInt64 genesisTime) {
74-
return createTekuNode(
75-
c -> {
76-
c.withGenesisTime(genesisTime.intValue())
77-
.withNetwork(NETWORK_NAME)
78-
.withRealNetwork()
79-
.withPeers(primaryNode)
80-
.withInteropValidators(0, 0);
81-
applyMilestoneConfig(c, capellaActivationEpoch);
82-
});
68+
private TekuBeaconNode createLateJoiningNode(
69+
final UInt64 capellaActivationEpoch,
70+
final TekuBeaconNode primaryNode,
71+
final UInt64 genesisTime)
72+
throws IOException {
73+
return createTekuBeaconNode(
74+
beaconNodeWithMilestones(capellaActivationEpoch)
75+
.withPeers(primaryNode)
76+
.withGenesisTime(genesisTime.intValue())
77+
.withInteropValidators(0, 0)
78+
.build());
8379
}
8480

85-
private static void applyMilestoneConfig(final Config c, final UInt64 capellaForkEpoch) {
86-
c.withAltairEpoch(UInt64.ZERO);
87-
c.withBellatrixEpoch(UInt64.ZERO);
88-
c.withCapellaEpoch(capellaForkEpoch);
89-
c.withTotalTerminalDifficulty(0);
90-
c.withStubExecutionEngine("0x14e88057b0b7538a8205cb07726a0de03dd69d9a70e88bcffae15ca3fc6b5215");
81+
private static TekuNodeConfigBuilder beaconNodeWithMilestones(final UInt64 capellaActivationEpoch)
82+
throws IOException {
83+
return TekuNodeConfigBuilder.createBeaconNode()
84+
.withRealNetwork()
85+
.withAltairEpoch(UInt64.ZERO)
86+
.withBellatrixEpoch(UInt64.ZERO)
87+
.withCapellaEpoch(capellaActivationEpoch)
88+
.withTotalTerminalDifficulty(0)
89+
.withStubExecutionEngine(
90+
"0x14e88057b0b7538a8205cb07726a0de03dd69d9a70e88bcffae15ca3fc6b5215");
9191
}
9292
}

Diff for: acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/CapellaUpgradeAcceptanceTest.java

+21-27
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
2525
import tech.pegasys.teku.test.acceptance.dsl.BesuDockerVersion;
2626
import tech.pegasys.teku.test.acceptance.dsl.BesuNode;
27-
import tech.pegasys.teku.test.acceptance.dsl.TekuNode;
28-
import tech.pegasys.teku.test.acceptance.dsl.TekuNode.Config;
27+
import tech.pegasys.teku.test.acceptance.dsl.TekuBeaconNode;
28+
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
2929

3030
/**
3131
* The test is based on `shanghaiTime` in Besu EL genesis config as the only option to start
@@ -72,46 +72,40 @@ void shouldUpgradeToCapella() throws Exception {
7272
secondaryEL.start();
7373
secondaryEL.addPeer(primaryEL);
7474

75-
TekuNode primaryNode =
76-
createTekuNode(
77-
config -> {
78-
config
79-
.withGenesisTime(genesisTime)
80-
.withRealNetwork()
81-
.withStartupTargetPeerCount(0)
82-
.withExecutionEngine(primaryEL)
83-
.withJwtSecretFile(JWT_FILE);
84-
applyMilestoneConfig(config);
85-
});
75+
TekuBeaconNode primaryNode =
76+
createTekuBeaconNode(
77+
beaconNodeConfigWithForks(genesisTime, primaryEL)
78+
.withStartupTargetPeerCount(0)
79+
.build());
8680

8781
primaryNode.start();
8882
primaryNode.waitForMilestone(SpecMilestone.CAPELLA);
8983

9084
final int primaryNodeGenesisTime = primaryNode.getGenesisTime().intValue();
9185

92-
TekuNode lateJoiningNode =
93-
createTekuNode(
94-
c -> {
95-
c.withGenesisTime(primaryNodeGenesisTime)
96-
.withRealNetwork()
97-
.withPeers(primaryNode)
98-
.withInteropValidators(0, 0)
99-
.withExecutionEngine(secondaryEL)
100-
.withJwtSecretFile(JWT_FILE);
101-
applyMilestoneConfig(c);
102-
});
86+
TekuBeaconNode lateJoiningNode =
87+
createTekuBeaconNode(
88+
beaconNodeConfigWithForks(primaryNodeGenesisTime, secondaryEL)
89+
.withPeers(primaryNode)
90+
.withInteropValidators(0, 0)
91+
.build());
10392

10493
lateJoiningNode.start();
10594
lateJoiningNode.waitUntilInSyncWith(primaryNode);
10695

10796
primaryNode.waitForNewBlock();
10897
}
10998

110-
private static void applyMilestoneConfig(final Config config) {
111-
config
99+
private static TekuNodeConfigBuilder beaconNodeConfigWithForks(
100+
final int genesisTime, final BesuNode besuNode) throws Exception {
101+
return TekuNodeConfigBuilder.createBeaconNode()
112102
.withAltairEpoch(UInt64.ZERO)
113103
.withBellatrixEpoch(UInt64.ZERO)
114104
.withCapellaEpoch(UInt64.ONE)
115-
.withTotalTerminalDifficulty(0);
105+
.withTotalTerminalDifficulty(0)
106+
.withGenesisTime(genesisTime)
107+
.withExecutionEngine(besuNode)
108+
.withJwtSecretFile(JWT_FILE)
109+
.withRealNetwork();
116110
}
117111
}

0 commit comments

Comments
 (0)