ropsten TTD config (#3871)

* ropsten TTD config

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/3876/head
garyschulte 3 years ago committed by GitHub
parent f89db6843f
commit 40a6ca2c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 20
      config/src/main/java/org/hyperledger/besu/config/GenesisConfigFile.java
  3. 1
      config/src/main/resources/ropsten.json
  4. 21
      config/src/test/java/org/hyperledger/besu/config/GenesisConfigFileTest.java

@ -6,6 +6,7 @@
- GraphQL - allow null log topics in queries which match any topic [#3662](https://github.com/hyperledger/besu/pull/3662)
- multi-arch docker builds for amd64 and arm64 [#2954](https://github.com/hyperledger/besu/pull/2954)
- Filter Netty native lib errors likewise the pure Java implementation [#3807](https://github.com/hyperledger/besu/pull/3807)
- Add ropsten terminal total difficulty config [#3871](https://github.com/hyperledger/besu/pull/3871)
### Bug Fixes
- Stop the BlockPropagationManager when it receives the TTD reached event [#3809](https://github.com/hyperledger/besu/pull/3809)

@ -45,12 +45,7 @@ public class GenesisConfigFile {
}
public static GenesisConfigFile mainnet() {
try {
return fromConfig(
Resources.toString(GenesisConfigFile.class.getResource("/mainnet.json"), UTF_8));
} catch (final IOException e) {
throw new IllegalStateException(e);
}
return genesisFileFromResources("/mainnet.json");
}
public static ObjectNode mainnetJsonNode() {
@ -64,18 +59,17 @@ public class GenesisConfigFile {
}
public static GenesisConfigFile development() {
try {
return fromConfig(
Resources.toString(GenesisConfigFile.class.getResource("/dev.json"), UTF_8));
} catch (final IOException e) {
throw new IllegalStateException(e);
}
return genesisFileFromResources("/dev.json");
}
public static GenesisConfigFile ecip1049dev() {
return genesisFileFromResources("/ecip1049_dev.json");
}
public static GenesisConfigFile genesisFileFromResources(final String resourceName) {
try {
return fromConfig(
Resources.toString(GenesisConfigFile.class.getResource("/ecip1049_dev.json"), UTF_8));
Resources.toString(GenesisConfigFile.class.getResource(resourceName), UTF_8));
} catch (final IOException e) {
throw new IllegalStateException(e);
}

@ -10,6 +10,7 @@
"muirGlacierBlock": 7117117,
"berlinBlock": 9812189,
"londonBlock": 10499401,
"terminalTotalDifficulty": 43531756765713534,
"ethash": {
},
"discovery": {

@ -198,6 +198,27 @@ public class GenesisConfigFileTest {
assertThat(EMPTY_CONFIG.getConfigOptions().getTerminalTotalDifficulty()).isNotPresent();
}
@Test
public void assertRopstenTerminalTotalDifficulty() {
GenesisConfigOptions ropstenOptions =
GenesisConfigFile.genesisFileFromResources("/ropsten.json").getConfigOptions();
assertThat(ropstenOptions.getTerminalTotalDifficulty()).isPresent();
assertThat(ropstenOptions.getTerminalTotalDifficulty().get())
.isEqualTo(UInt256.valueOf(43531756765713534L));
}
@Test
public void assertTerminalTotalDifficultyOverride() {
GenesisConfigOptions ropstenOverrideOptions =
GenesisConfigFile.genesisFileFromResources("/ropsten.json")
.getConfigOptions(Map.of("terminalTotalDifficulty", String.valueOf(Long.MAX_VALUE)));
assertThat(ropstenOverrideOptions.getTerminalTotalDifficulty()).isPresent();
assertThat(ropstenOverrideOptions.getTerminalTotalDifficulty().get())
.isEqualTo(UInt256.valueOf(Long.MAX_VALUE));
}
@Test
public void shouldFindParisForkAndAlias() {
GenesisConfigFile parisGenesis =

Loading…
Cancel
Save