From c48a2ceba9c6964a04a6c95907605c178435bb0a Mon Sep 17 00:00:00 2001 From: Gabriel Fukushima Date: Tue, 24 Sep 2024 11:14:44 +1000 Subject: [PATCH 1/4] Upgrade acceptance tests flakiness fix (#8635) * start EL and CL pair together to avoid delay * give and extra 30 secs to genesis Signed-off-by: Gabriel Fukushima --------- Signed-off-by: Gabriel Fukushima --- .../CapellaUpgradeAcceptanceTest.java | 20 +++++++++---------- .../DenebUpgradeAcceptanceTest.java | 20 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/CapellaUpgradeAcceptanceTest.java b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/CapellaUpgradeAcceptanceTest.java index c38d394a984..0c0f9c2d00a 100644 --- a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/CapellaUpgradeAcceptanceTest.java +++ b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/CapellaUpgradeAcceptanceTest.java @@ -34,7 +34,7 @@ public class CapellaUpgradeAcceptanceTest extends AcceptanceTestBase { @Test void shouldUpgradeToCapella() throws Exception { final UInt64 currentTime = timeProvider.getTimeInSeconds(); - final int genesisTime = currentTime.plus(30).intValue(); // magic node startup time + final int genesisTime = currentTime.plus(60).intValue(); // magic node startup time final int shanghaiTime = genesisTime + 4 * 2; // 4 slots, 2 seconds each final Map genesisOverrides = Map.of("shanghaiTime", String.valueOf(shanghaiTime)); @@ -51,6 +51,15 @@ void shouldUpgradeToCapella() throws Exception { genesisOverrides); primaryEL.start(); + TekuBeaconNode primaryNode = + createTekuBeaconNode( + beaconNodeConfigWithForks(genesisTime, primaryEL) + .withStartupTargetPeerCount(0) + .build()); + + primaryNode.start(); + primaryNode.waitForMilestone(SpecMilestone.CAPELLA); + BesuNode secondaryEL = createBesuNode( BesuDockerVersion.STABLE, @@ -64,15 +73,6 @@ void shouldUpgradeToCapella() throws Exception { secondaryEL.start(); secondaryEL.addPeer(primaryEL); - TekuBeaconNode primaryNode = - createTekuBeaconNode( - beaconNodeConfigWithForks(genesisTime, primaryEL) - .withStartupTargetPeerCount(0) - .build()); - - primaryNode.start(); - primaryNode.waitForMilestone(SpecMilestone.CAPELLA); - final int primaryNodeGenesisTime = primaryNode.getGenesisTime().intValue(); TekuBeaconNode lateJoiningNode = diff --git a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/DenebUpgradeAcceptanceTest.java b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/DenebUpgradeAcceptanceTest.java index dba6033a322..a9c0e1f80e8 100644 --- a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/DenebUpgradeAcceptanceTest.java +++ b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/DenebUpgradeAcceptanceTest.java @@ -34,7 +34,7 @@ public class DenebUpgradeAcceptanceTest extends AcceptanceTestBase { @Test void shouldUpgradeToDeneb() throws Exception { final UInt64 currentTime = timeProvider.getTimeInSeconds(); - final int genesisTime = currentTime.plus(30).intValue(); // magic node startup time + final int genesisTime = currentTime.plus(60).intValue(); // magic node startup time final int epochDuration = 4 * 2; // 4 slots, 2 seconds each for swift final int shanghaiTime = genesisTime + epochDuration; final Map genesisOverrides = @@ -56,6 +56,15 @@ void shouldUpgradeToDeneb() throws Exception { genesisOverrides); primaryEL.start(); + TekuBeaconNode primaryNode = + createTekuBeaconNode( + beaconNodeWithTrustedSetup(genesisTime, primaryEL) + .withStartupTargetPeerCount(0) + .build()); + + primaryNode.start(); + primaryNode.waitForMilestone(SpecMilestone.DENEB); + BesuNode secondaryEL = createBesuNode( BesuDockerVersion.STABLE, @@ -69,15 +78,6 @@ void shouldUpgradeToDeneb() throws Exception { secondaryEL.start(); secondaryEL.addPeer(primaryEL); - TekuBeaconNode primaryNode = - createTekuBeaconNode( - beaconNodeWithTrustedSetup(genesisTime, primaryEL) - .withStartupTargetPeerCount(0) - .build()); - - primaryNode.start(); - primaryNode.waitForMilestone(SpecMilestone.DENEB); - final int primaryNodeGenesisTime = primaryNode.getGenesisTime().intValue(); TekuBeaconNode lateJoiningNode = From 2cd7bc1802ef04ce7869d9bc435a30c6d20fc2f7 Mon Sep 17 00:00:00 2001 From: Paul Harris Date: Tue, 24 Sep 2024 11:51:07 +1000 Subject: [PATCH 2/4] removed consolidations signing domain for electra (#8638) This is no longer required, cleaning up. fixes #8636 Signed-off-by: Paul Harris --- .../src/main/java/tech/pegasys/teku/spec/constants/Domain.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/Domain.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/Domain.java index 9666cb38f7e..28c40afc6e5 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/Domain.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/constants/Domain.java @@ -33,7 +33,4 @@ public class Domain { // Capella public static final Bytes4 DOMAIN_BLS_TO_EXECUTION_CHANGE = Bytes4.fromHexString("0x0A000000"); - - // Electra - public static final Bytes4 DOMAIN_CONSOLIDATION = Bytes4.fromHexString("0x0B000000"); } From cef41e3933d77041c20bebe938698ccb1dfb7fea Mon Sep 17 00:00:00 2001 From: Glory Agatevure Date: Tue, 24 Sep 2024 04:17:49 +0100 Subject: [PATCH 3/4] Update network file (#8631) Signed-off-by: gconnect Co-authored-by: Paul Harris Co-authored-by: Gabriel Fukushima --- .../server/network/DatabaseNetwork.java | 24 ++++-- .../server/network/DatabaseNetworkTest.java | 86 ++++++++++++++++++- 2 files changed, 101 insertions(+), 9 deletions(-) diff --git a/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java b/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java index edd4a5cc99a..65be9163ce0 100644 --- a/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java +++ b/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; @@ -29,22 +30,34 @@ import tech.pegasys.teku.infrastructure.bytes.Bytes4; import tech.pegasys.teku.storage.server.DatabaseStorageException; +@JsonInclude(JsonInclude.Include.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class DatabaseNetwork { - @JsonProperty("fork_version") + @JsonProperty(value = "fork_version", required = true) @VisibleForTesting final String forkVersion; - @JsonProperty("deposit_contract") + @JsonProperty(value = "deposit_contract", required = true) @VisibleForTesting final String depositContract; + @JsonProperty("deposit_chain_id") + @VisibleForTesting + final Long depositChainId; + @JsonCreator DatabaseNetwork( - @JsonProperty("fork_version") final String forkVersion, - @JsonProperty("deposit_contract") final String depositContract) { + @JsonProperty(value = "fork_version") final String forkVersion, + @JsonProperty(value = "deposit_contract") final String depositContract, + @JsonProperty("deposit_chain_id") final Long depositChainId) { this.forkVersion = forkVersion; this.depositContract = depositContract; + this.depositChainId = depositChainId; + } + + @VisibleForTesting + DatabaseNetwork(final String forkVersion, final String depositContract) { + this(forkVersion, depositContract, null); } public static DatabaseNetwork init( @@ -95,7 +108,8 @@ public boolean equals(final Object o) { } final DatabaseNetwork that = (DatabaseNetwork) o; return Objects.equals(forkVersion, that.forkVersion) - && Objects.equals(depositContract, that.depositContract); + && Objects.equals(depositContract, that.depositContract) + && Objects.equals(depositChainId, that.depositChainId); } @Override diff --git a/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java b/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java index d2ffefe2636..19a622f0933 100644 --- a/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java +++ b/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java @@ -13,13 +13,21 @@ package tech.pegasys.teku.storage.server.network; +import static com.fasterxml.jackson.dataformat.yaml.YAMLGenerator.Feature.WRITE_DOC_START_MARKER; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import java.io.File; import java.io.IOException; +import java.nio.file.Files; import java.util.Locale; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; import tech.pegasys.teku.ethereum.execution.types.Eth1Address; @@ -30,10 +38,17 @@ public class DatabaseNetworkTest { DataStructureUtil dataStructureUtil = new DataStructureUtil(TestSpecFactory.createDefault()); + private ObjectMapper objectMapper; + private static final String NETWORK_FILENAME = "network.yml"; + + @BeforeEach + void setUp() { + objectMapper = new ObjectMapper(new YAMLFactory().disable(WRITE_DOC_START_MARKER)); + } @Test public void shouldCreateNetworkFile(@TempDir final File tempDir) throws IOException { - final File networkFile = new File(tempDir, "network.yml"); + final File networkFile = new File(tempDir, NETWORK_FILENAME); assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); @@ -47,7 +62,7 @@ public void shouldCreateNetworkFile(@TempDir final File tempDir) throws IOExcept @Test public void shouldThrowIfForkDiffers(@TempDir final File tempDir) throws IOException { - final File networkFile = new File(tempDir, "network.yml"); + final File networkFile = new File(tempDir, NETWORK_FILENAME); assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); @@ -61,7 +76,7 @@ public void shouldThrowIfForkDiffers(@TempDir final File tempDir) throws IOExcep @Test public void shouldThrowIfDepositContractDiffers(@TempDir final File tempDir) throws IOException { - final File networkFile = new File(tempDir, "network.yml"); + final File networkFile = new File(tempDir, NETWORK_FILENAME); assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); @@ -74,7 +89,7 @@ public void shouldThrowIfDepositContractDiffers(@TempDir final File tempDir) thr @Test public void shouldNotThrowIfForkAndContractMatch(@TempDir final File tempDir) throws IOException { - final File networkFile = new File(tempDir, "network.yml"); + final File networkFile = new File(tempDir, NETWORK_FILENAME); assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); @@ -82,4 +97,67 @@ public void shouldNotThrowIfForkAndContractMatch(@TempDir final File tempDir) th assertDoesNotThrow(() -> DatabaseNetwork.init(networkFile, fork, eth1Address)); } + + @Test + void shouldWriteAndReadDatabaseNetworkWithDepositChainId(@TempDir final File tempDir) + throws IOException { + final File networkFile = new File(tempDir, NETWORK_FILENAME); + + final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); + final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); + final Long depositChainId = dataStructureUtil.randomLong(); + final DatabaseNetwork databaseNetwork = + new DatabaseNetwork(fork.toHexString(), eth1Address.toHexString(), depositChainId); + + objectMapper.writerFor(DatabaseNetwork.class).writeValue(networkFile, databaseNetwork); + final DatabaseNetwork readDatabaseNetwork = + objectMapper.readerFor(DatabaseNetwork.class).readValue(networkFile); + + assertEquals(fork.toHexString(), readDatabaseNetwork.forkVersion); + assertEquals(eth1Address.toHexString(), readDatabaseNetwork.depositContract); + assertEquals(depositChainId, readDatabaseNetwork.depositChainId); + } + + @Test + void shouldWriteAndReadDatabaseNetworkWithoutDepositChainId(@TempDir final File tempDir) + throws IOException { + final File networkFile = new File(tempDir, NETWORK_FILENAME); + + final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); + final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); + + final DatabaseNetwork databaseNetwork = + new DatabaseNetwork(fork.toHexString(), eth1Address.toHexString()); + + objectMapper.writerFor(DatabaseNetwork.class).writeValue(networkFile, databaseNetwork); + String networkContent = Files.readString(networkFile.toPath()); + + final DatabaseNetwork readDatabaseNetwork = + objectMapper.readerFor(DatabaseNetwork.class).readValue(networkFile); + + assertFalse(networkContent.contains("deposit_chain_id")); + assertEquals(fork.toHexString(), readDatabaseNetwork.forkVersion); + assertEquals(eth1Address.toHexString(), readDatabaseNetwork.depositContract); + assertNull(readDatabaseNetwork.depositChainId); + } + + @Test + void shouldNotIncludeDepositChainIdWhenNull(@TempDir final File tempDir) throws IOException { + final File networkFile = new File(tempDir, NETWORK_FILENAME); + + final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); + final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); + + final DatabaseNetwork databaseNetwork = + new DatabaseNetwork(fork.toHexString(), eth1Address.toHexString(), null); + + objectMapper.writerFor(DatabaseNetwork.class).writeValue(networkFile, databaseNetwork); + String networkContent = Files.readString(networkFile.toPath()); + + final DatabaseNetwork readDatabaseNetwork = + objectMapper.readerFor(DatabaseNetwork.class).readValue(networkFile); + + assertFalse(networkContent.contains("deposit_chain_id")); + assertNull(readDatabaseNetwork.depositChainId); + } } From ae367d8e4880b90290217382f8bcc5a19690c054 Mon Sep 17 00:00:00 2001 From: Glory Agatevure Date: Tue, 24 Sep 2024 06:05:25 +0100 Subject: [PATCH 4/4] Add deposit chainId to network file on start (#8639) --- .../server/VersionedDatabaseFactory.java | 20 +++++++++++--- .../server/network/DatabaseNetwork.java | 7 +++-- .../server/network/DatabaseNetworkTest.java | 26 +++++++++++++------ 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/storage/src/main/java/tech/pegasys/teku/storage/server/VersionedDatabaseFactory.java b/storage/src/main/java/tech/pegasys/teku/storage/server/VersionedDatabaseFactory.java index 16cac554b7a..4505e1c3cd5 100644 --- a/storage/src/main/java/tech/pegasys/teku/storage/server/VersionedDatabaseFactory.java +++ b/storage/src/main/java/tech/pegasys/teku/storage/server/VersionedDatabaseFactory.java @@ -166,7 +166,10 @@ public StateStorageMode getStateStorageMode() { private Database createV4Database() { try { DatabaseNetwork.init( - getNetworkFile(), spec.getGenesisSpecConfig().getGenesisForkVersion(), eth1Address); + getNetworkFile(), + spec.getGenesisSpecConfig().getGenesisForkVersion(), + eth1Address, + spec.getGenesisSpecConfig().getDepositChainId()); return RocksDbDatabaseFactory.createV4( metricsSystem, KvStoreConfiguration.v4Settings(dbDirectory.toPath()), @@ -190,7 +193,10 @@ private Database createV5Database() { final V5DatabaseMetadata metaData = V5DatabaseMetadata.init(getMetadataFile(), V5DatabaseMetadata.v5Defaults()); DatabaseNetwork.init( - getNetworkFile(), spec.getGenesisSpecConfig().getGenesisForkVersion(), eth1Address); + getNetworkFile(), + spec.getGenesisSpecConfig().getGenesisForkVersion(), + eth1Address, + spec.getGenesisSpecConfig().getDepositChainId()); return RocksDbDatabaseFactory.createV4( metricsSystem, metaData.getHotDbConfiguration().withDatabaseDir(dbDirectory.toPath()), @@ -233,7 +239,10 @@ private Database createLevelDbV1Database() { final V5DatabaseMetadata metaData = V5DatabaseMetadata.init(getMetadataFile(), V5DatabaseMetadata.v5Defaults()); DatabaseNetwork.init( - getNetworkFile(), spec.getGenesisSpecConfig().getGenesisForkVersion(), eth1Address); + getNetworkFile(), + spec.getGenesisSpecConfig().getGenesisForkVersion(), + eth1Address, + spec.getGenesisSpecConfig().getDepositChainId()); return LevelDbDatabaseFactory.createLevelDb( metricsSystem, metaData.getHotDbConfiguration().withDatabaseDir(dbDirectory.toPath()), @@ -284,7 +293,10 @@ private KvStoreConfiguration initV6Configuration() throws IOException { V6DatabaseMetadata.init(getMetadataFile(), V6DatabaseMetadata.singleDBDefault()); DatabaseNetwork.init( - getNetworkFile(), spec.getGenesisSpecConfig().getGenesisForkVersion(), eth1Address); + getNetworkFile(), + spec.getGenesisSpecConfig().getGenesisForkVersion(), + eth1Address, + spec.getGenesisSpecConfig().getDepositChainId()); return metaData.getSingleDbConfiguration().getConfiguration(); } diff --git a/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java b/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java index 65be9163ce0..ea35a55855e 100644 --- a/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java +++ b/storage/src/main/java/tech/pegasys/teku/storage/server/network/DatabaseNetwork.java @@ -61,7 +61,10 @@ public class DatabaseNetwork { } public static DatabaseNetwork init( - final File source, final Bytes4 forkVersion, final Eth1Address depositContract) + final File source, + final Bytes4 forkVersion, + final Eth1Address depositContract, + final Long depositChainId) throws IOException { final String forkVersionString = forkVersion.toHexString().toLowerCase(Locale.ROOT); final String depositContractString = depositContract.toHexString().toLowerCase(Locale.ROOT); @@ -84,7 +87,7 @@ public static DatabaseNetwork init( return databaseNetwork; } else { DatabaseNetwork databaseNetwork = - new DatabaseNetwork(forkVersionString, depositContractString); + new DatabaseNetwork(forkVersionString, depositContractString, depositChainId); objectMapper.writerFor(DatabaseNetwork.class).writeValue(source, databaseNetwork); return databaseNetwork; } diff --git a/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java b/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java index 19a622f0933..e52f529df75 100644 --- a/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java +++ b/storage/src/test/java/tech/pegasys/teku/storage/server/network/DatabaseNetworkTest.java @@ -52,11 +52,13 @@ public void shouldCreateNetworkFile(@TempDir final File tempDir) throws IOExcept assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); - assertThat(DatabaseNetwork.init(networkFile, fork, eth1Address)) + final Long depositChainId = dataStructureUtil.randomLong(); + assertThat(DatabaseNetwork.init(networkFile, fork, eth1Address, depositChainId)) .isEqualTo( new DatabaseNetwork( fork.toHexString().toLowerCase(Locale.ROOT), - eth1Address.toHexString().toLowerCase(Locale.ROOT))); + eth1Address.toHexString().toLowerCase(Locale.ROOT), + depositChainId)); assertThat(networkFile).exists(); } @@ -66,10 +68,14 @@ public void shouldThrowIfForkDiffers(@TempDir final File tempDir) throws IOExcep assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); + final Long depositChainId = dataStructureUtil.randomLong(); DatabaseNetwork.init( - networkFile, dataStructureUtil.randomFork().getCurrentVersion(), eth1Address); + networkFile, + dataStructureUtil.randomFork().getCurrentVersion(), + eth1Address, + depositChainId); - assertThatThrownBy(() -> DatabaseNetwork.init(networkFile, fork, eth1Address)) + assertThatThrownBy(() -> DatabaseNetwork.init(networkFile, fork, eth1Address, depositChainId)) .isInstanceOf(DatabaseStorageException.class) .hasMessageStartingWith("Supplied fork version"); } @@ -80,9 +86,11 @@ public void shouldThrowIfDepositContractDiffers(@TempDir final File tempDir) thr assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); - DatabaseNetwork.init(networkFile, fork, dataStructureUtil.randomEth1Address()); + final Long depositChainId = dataStructureUtil.randomLong(); - assertThatThrownBy(() -> DatabaseNetwork.init(networkFile, fork, eth1Address)) + DatabaseNetwork.init(networkFile, fork, dataStructureUtil.randomEth1Address(), depositChainId); + + assertThatThrownBy(() -> DatabaseNetwork.init(networkFile, fork, eth1Address, depositChainId)) .isInstanceOf(DatabaseStorageException.class) .hasMessageStartingWith("Supplied deposit contract"); } @@ -93,9 +101,11 @@ public void shouldNotThrowIfForkAndContractMatch(@TempDir final File tempDir) th assertThat(networkFile).doesNotExist(); final Bytes4 fork = dataStructureUtil.randomFork().getCurrentVersion(); final Eth1Address eth1Address = dataStructureUtil.randomEth1Address(); - DatabaseNetwork.init(networkFile, fork, eth1Address); + final Long depositChainId = dataStructureUtil.randomLong(); + + DatabaseNetwork.init(networkFile, fork, eth1Address, depositChainId); - assertDoesNotThrow(() -> DatabaseNetwork.init(networkFile, fork, eth1Address)); + assertDoesNotThrow(() -> DatabaseNetwork.init(networkFile, fork, eth1Address, depositChainId)); } @Test