Skip to content

Commit

Permalink
Fix acceptance tests + remove outdated bellatrix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
zilm13 committed Jan 8, 2025
1 parent 64c0fdf commit b586aeb
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void shouldHaveCorrectFeeRecipientAndGraffiti(final boolean useSszBlocks) throws
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withCapellaEpoch(UInt64.ZERO)
.validatorKeys(validatorKeystores, validatorKeystores)
.validatorKeys(validatorKeystores)
.generate();

final String defaultFeeRecipient = "0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ private static TekuNodeConfigBuilder beaconNodeWithMilestones(final UInt64 capel
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withCapellaEpoch(capellaActivationEpoch)
.withTotalTerminalDifficulty(0)
.withStubExecutionEngine(
"0x14e88057b0b7538a8205cb07726a0de03dd69d9a70e88bcffae15ca3fc6b5215");
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0)
.withStubExecutionEngine(DEFAULT_EL_GENESIS_HASH);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ private static TekuNodeConfigBuilder beaconNodeConfigWithForks(
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withCapellaEpoch(UInt64.ONE)
.withTerminalBlockHash(
"0x14e88057b0b7538a8205cb07726a0de03dd69d9a70e88bcffae15ca3fc6b5215", 0)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0)
.withGenesisTime(genesisTime)
.withExecutionEngine(besuNode)
.withJwtSecretFile(JWT_FILE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ private static TekuNodeConfigBuilder beaconNodeWithTrustedSetup(
.withRealNetwork()
.withJwtSecretFile(JWT_FILE)
.withDenebEpoch(UInt64.valueOf(2))
.withTotalTerminalDifficulty(0);
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ void setUp() {
createBesuNode(
config ->
config
.withMiningEnabled(true)
.withMergeSupport()
.withGenesisFile("besu/preMergeGenesis.json")
.withJwtTokenAuthorization(JWT_FILE));
Expand All @@ -54,7 +53,7 @@ void shouldDetectDoppelgangersViaKeyManagerAPI() throws Exception {
eth1Node.start();

final ValidatorKeystores validatorKeystores =
createTekuDepositSender(networkName).sendValidatorDeposits(eth1Node, 2);
createTekuDepositSender(networkName).generateValidatorKeys(2);

final GenesisGenerator.InitialStateData genesis =
createGenesisGenerator().network(networkName).validatorKeys(validatorKeystores).generate();
Expand All @@ -66,7 +65,7 @@ void shouldDetectDoppelgangersViaKeyManagerAPI() throws Exception {
.withValidatorLivenessTracking()
.withJwtSecretFile(JWT_FILE)
.withBellatrixEpoch(UInt64.ONE)
.withTotalTerminalDifficulty(10001)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0)
.withValidatorProposerDefaultFeeRecipient(defaultFeeRecipient)
.withInitialState(genesis)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void shouldMaintainValidatorsInMutableClient() throws Exception {
.withInitialState(genesis)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0)
.withValidatorProposerDefaultFeeRecipient(defaultFeeRecipient)
.build());
final TekuValidatorNode validatorClient =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void setup() throws Exception {
.withNetwork(NETWORK_NAME)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withTotalTerminalDifficulty(0)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0)
.withInitialState(initialStateData)
.withStartupTargetPeerCount(0)
.withReadOnlyKeystorePath(validatorKeys)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private static TekuNodeConfigBuilder createTekuNodeBuilderForMilestone(
.withNetwork("minimal")
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ZERO)
.withTotalTerminalDifficulty(0)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0)
.withStartupTargetPeerCount(0)
.withInteropNumberOfValidators(64)
.withValidatorProposerDefaultFeeRecipient("0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private TekuNodeConfigBuilder createBeaconNode(
final BesuNode executionEngine, final int genesisTime) throws Exception {
return TekuNodeConfigBuilder.createBeaconNode()
.withBellatrixEpoch(UInt64.ZERO)
.withTotalTerminalDifficulty(10001)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 1)
.withGenesisTime(genesisTime)
.withRealNetwork()
.withStartupTargetPeerCount(0)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ void shouldRespondSyncingWhenExecutionLayerIsDown() throws Exception {
createBesuNode(
config ->
config
.withMiningEnabled(true)
.withMergeSupport()
.withGenesisFile("besu/preMergeGenesis.json")
.withJwtTokenAuthorization(JWT_FILE));
eth1Node.start();

final ValidatorKeystores validatorKeystores =
createTekuDepositSender(networkName).sendValidatorDeposits(eth1Node, 8);
createTekuDepositSender(networkName).generateValidatorKeys(8);

final GenesisGenerator.InitialStateData genesis =
createGenesisGenerator().network(networkName).validatorKeys(validatorKeystores).generate();
Expand All @@ -55,7 +54,7 @@ void shouldRespondSyncingWhenExecutionLayerIsDown() throws Exception {
.withNetwork(networkName)
.withDepositsFrom(eth1Node)
.withBellatrixEpoch(UInt64.ONE)
.withTotalTerminalDifficulty(10001)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 0)
.withValidatorProposerDefaultFeeRecipient(defaultFeeRecipient)
.withExecutionEngine(eth1Node)
.withInitialState(genesis)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.test.acceptance.dsl.AcceptanceTestBase;
import tech.pegasys.teku.test.acceptance.dsl.BesuNode;
import tech.pegasys.teku.test.acceptance.dsl.GenesisGenerator;
import tech.pegasys.teku.test.acceptance.dsl.TekuBeaconNode;
import tech.pegasys.teku.test.acceptance.dsl.TekuNodeConfigBuilder;
import tech.pegasys.teku.test.acceptance.dsl.tools.deposits.ValidatorKeystores;
Expand All @@ -41,24 +42,31 @@ void setup() throws Exception {
createBesuNode(
config ->
config
.withMiningEnabled(true)
.withMergeSupport()
.withGenesisFile("besu/preMergeGenesis.json")
.withJwtTokenAuthorization(jwtFile));
eth1Node.start();

final int totalValidators = 4;
final ValidatorKeystores validatorKeystores =
createTekuDepositSender(NETWORK_NAME).sendValidatorDeposits(eth1Node, totalValidators);
createTekuDepositSender(NETWORK_NAME).generateValidatorKeys(totalValidators);
final GenesisGenerator.InitialStateData genesis =
createGenesisGenerator()
.network(NETWORK_NAME)
.withAltairEpoch(UInt64.ZERO)
.withBellatrixEpoch(UInt64.ONE)
.validatorKeys(validatorKeystores)
.generate();
tekuNode =
createTekuBeaconNode(
configureTekuNode(genesisTime)
.withDepositsFrom(eth1Node)
.withStartupTargetPeerCount(0)
.withValidatorProposerDefaultFeeRecipient(
"0xFE3B557E8Fb62b89F4916B721be55cEb828dBd73")
.withExecutionEngine(eth1Node)
.withExecutionEngineEndpoint(eth1Node.getInternalEngineWebsocketsRpcUrl())
.withJwtSecretFile(jwtFile)
.withInitialState(genesis)
.withReadOnlyKeystorePath(validatorKeystores)
.build());
tekuNode.start();
Expand All @@ -74,7 +82,7 @@ void shouldPassMergeTransitionUsingWebsocketsEngine() {

private TekuNodeConfigBuilder configureTekuNode(final int genesisTime) throws IOException {
return TekuNodeConfigBuilder.createBeaconNode()
.withTotalTerminalDifficulty(10001)
.withTerminalBlockHash(DEFAULT_EL_GENESIS_HASH, 1)
.withBellatrixEpoch(UInt64.ONE)
.withGenesisTime(genesisTime);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ public class AcceptanceTestBase {
System.setProperty("org.apache.tuweni.crypto.useSodium", "false");
}

public static final String DEFAULT_EL_GENESIS_HASH =
"0x14e88057b0b7538a8205cb07726a0de03dd69d9a70e88bcffae15ca3fc6b5215";

private final List<Node> nodes = new ArrayList<>();
private final Network network = Network.newNetwork();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ public String getInternalEngineJsonRpcUrl() {
return "http://" + nodeAlias + ":" + ENGINE_JSON_RPC_PORT;
}

public String getInternalEngineWebsocketsRpcUrl() {
return "ws://" + nodeAlias + ":" + ENGINE_JSON_RPC_PORT;
}

private String getInternalP2pUrl(final String nodeId) {
return "enode://" + nodeId + "@" + getInternalIpAddress() + ":" + P2P_PORT;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,12 @@ public TekuNodeConfigBuilder withTrustedSetupFromClasspath(final String trustedS

public TekuNodeConfigBuilder withExecutionEngine(final BesuNode node) {
mustBe(NodeType.BEACON_NODE);
LOG.debug("ee-endpoint={}", node.getInternalEngineJsonRpcUrl());
configMap.put("ee-endpoint", node.getInternalEngineJsonRpcUrl());
return withExecutionEngineEndpoint(node.getInternalEngineJsonRpcUrl());
}

public TekuNodeConfigBuilder withExecutionEngineEndpoint(final String engineEndpointUrl) {
LOG.debug("ee-endpoint={}", engineEndpointUrl);
configMap.put("ee-endpoint", engineEndpointUrl);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"londonBlock": 0,
"parisBlock": 0,
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"contractSizeLimit": 2147483647,
"ethash": {
"fixeddifficulty": 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"berlinBlock": 0,
"londonBlock": 0,
"preMergeForkBlock": 0,
"terminalTotalDifficulty": 10001,
"terminalTotalDifficulty": 0,
"contractSizeLimit": 2147483647,
"ethash": {
"fixeddifficulty": 100
Expand Down

0 comments on commit b586aeb

Please sign in to comment.