Add calaveras testnet and remove baikal (#2343)

Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
pull/2345/head
matkt 4 years ago committed by GitHub
parent 3ac621233a
commit 9a43227587
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 9
      besu/src/main/java/org/hyperledger/besu/cli/config/EthNetworkConfig.java
  3. 2
      besu/src/main/java/org/hyperledger/besu/cli/config/NetworkName.java
  4. 5
      besu/src/main/resources/org/hyperledger/besu/cli/launcher.json
  5. 8
      config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java
  6. 19
      config/src/main/resources/calaveras.json
  7. 2
      config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java
  8. 7
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/DiscoveryConfiguration.java
  9. 2
      ethereum/retesteth/src/main/java/org/hyperledger/besu/ethereum/retesteth/methods/TestSetChainParams.java

@ -19,6 +19,8 @@ concerns, please reach out to the ConsenSys protocol engineering team in the
* Ethereum Classic Magneto Hard Fork [\#2315](https://github.com/hyperledger/besu/pull/2315)
* Added support for the upcoming CALAVERAS ephemeral testnet and removed the configuration for the deprecated BAIKAL ephemeral testnet. [\#2343](https://github.com/hyperledger/besu/pull/2343)
### Bug Fixes
* Fix invalid transfer values with the tracing API specifically for CALL operation [\#2319](https://github.com/hyperledger/besu/pull/2319)

@ -16,6 +16,7 @@ package org.hyperledger.besu.cli.config;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.ASTOR_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.CALAVERAS_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.CLASSIC_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.GOERLI_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.GOERLI_DISCOVERY_URL;
@ -46,7 +47,7 @@ public class EthNetworkConfig {
public static final BigInteger ROPSTEN_NETWORK_ID = BigInteger.valueOf(3);
public static final BigInteger RINKEBY_NETWORK_ID = BigInteger.valueOf(4);
public static final BigInteger GOERLI_NETWORK_ID = BigInteger.valueOf(5);
public static final BigInteger BAIKAL_NETWORK_ID = BigInteger.valueOf(1642);
public static final BigInteger CALAVERAS_NETWORK_ID = BigInteger.valueOf(123);
public static final BigInteger DEV_NETWORK_ID = BigInteger.valueOf(2018);
public static final BigInteger ECIP1049_DEV_NETWORK_ID = BigInteger.valueOf(2021);
public static final BigInteger CLASSIC_NETWORK_ID = BigInteger.valueOf(1);
@ -57,7 +58,7 @@ public class EthNetworkConfig {
private static final String ROPSTEN_GENESIS = "/ropsten.json";
private static final String RINKEBY_GENESIS = "/rinkeby.json";
private static final String GOERLI_GENESIS = "/goerli.json";
private static final String BAIKAL_GENESIS = "/baikal.json";
private static final String CALAVERAS_GENESIS = "/calaveras.json";
private static final String DEV_GENESIS = "/dev.json";
private static final String DEV_ECIP1049_GENESIS = "/ecip1049_dev.json";
private static final String CLASSIC_GENESIS = "/classic.json";
@ -153,9 +154,9 @@ public class EthNetworkConfig {
GOERLI_NETWORK_ID,
GOERLI_BOOTSTRAP_NODES,
GOERLI_DISCOVERY_URL);
case BAIKAL:
case CALAVERAS:
return new EthNetworkConfig(
jsonConfig(BAIKAL_GENESIS), BAIKAL_NETWORK_ID, new ArrayList<>(), null);
jsonConfig(CALAVERAS_GENESIS), CALAVERAS_NETWORK_ID, CALAVERAS_BOOTSTRAP_NODES, null);
case DEV:
return new EthNetworkConfig(
jsonConfig(DEV_GENESIS), DEV_NETWORK_ID, new ArrayList<>(), null);

@ -19,7 +19,7 @@ public enum NetworkName {
RINKEBY,
ROPSTEN,
GOERLI,
BAIKAL,
CALAVERAS,
DEV,
CLASSIC,
KOTTI,

@ -5,10 +5,7 @@
"prompt-type": "LIST",
"question": "Which Ethereum network would you like to use ?",
"config-key": "network",
"available-options": "org.hyperledger.besu.cli.config.NetworkName",
"additional-flag": {
"yolo_v3": "Xberlin-enabled"
}
"available-options": "org.hyperledger.besu.cli.config.NetworkName"
},
{
"prompt-type": "LIST",

@ -246,13 +246,13 @@ public class JsonGenesisConfigOptions implements GenesisConfigOptions {
@Override
public OptionalLong getLondonBlockNumber() {
final OptionalLong londonBlock = getOptionalLong("londonblock");
final OptionalLong baikalblock = getOptionalLong("baikalblock");
if (baikalblock.isPresent()) {
final OptionalLong calaverasblock = getOptionalLong("calaverasblock");
if (calaverasblock.isPresent()) {
if (londonBlock.isPresent()) {
throw new RuntimeException(
"Genesis files cannot specify both londonblock and baikalblock.");
"Genesis files cannot specify both londonblock and calaverasblock.");
}
return baikalblock;
return calaverasblock;
}
return londonBlock;
}

@ -1,6 +1,6 @@
{
"config": {
"chainId": 1642,
"chainId": 123,
"homesteadBlock": 0,
"daoForkBlock": 0,
"eip150Block": 0,
@ -16,7 +16,7 @@
}
},
"nonce": "0x0",
"timestamp": "0x6092ca7f",
"timestamp": "0x60b3877f",
"extraData": "0x00000000000000000000000000000000000000000000000000000000000000005211cea3870c7ba7c6c44b185e62eecdb864cd8c560228ce57d31efbf64c200b2c200aacec78cf17a7148e784fe95a7a750335f8b9572ee28d72e7650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit": "0x47b760",
"difficulty": "0x1",
@ -794,6 +794,12 @@
"0e89e2aedb1cfcdb9424d41a1f218f4132738172": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"1041afbcb359d5a8dc58c15b2ff51354ff8a217d": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"236ff1e97419ae93ad80cafbaa21220c5d78fb7d": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"60adc0f89a41af237ce73554ede170d733ec14e0": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
@ -811,6 +817,15 @@
},
"b02a2eda1b317fbd16760128836b0ac59b560e9d": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"badc0de9e0794b049b5ea63c3e1e698a3476c172": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"f0300bee898ae272eb347e8369ac0c76df42c93f": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
},
"fe3b557e8fb62b89f4916b721be55ceb828dbd73": {
"balance": "0x200000000000000000000000000000000000000000000000000000000000000"
}
},
"number": "0x0",

@ -190,7 +190,7 @@ public class GenesisConfigOptionsTest {
@Test
public void shouldGetBaikalBlockNumber() {
final GenesisConfigOptions config = fromConfigOptions(singletonMap("baikalblock", 1000));
final GenesisConfigOptions config = fromConfigOptions(singletonMap("calaverasblock", 1000));
assertThat(config.getEIP1559BlockNumber()).hasValue(1000);
assertThat(config.getLondonBlockNumber()).hasValue(1000);
assertThat(config.getGenesisBaseFeePerGas()).isEmpty();

@ -99,6 +99,13 @@ public class DiscoveryConfiguration {
.map(EnodeURLImpl::fromString)
.collect(toList()));
public static final List<EnodeURL> CALAVERAS_BOOTSTRAP_NODES =
Collections.unmodifiableList(
Stream.of(
"enode://9e1096aa59862a6f164994cb5cb16f5124d6c992cdbf4535ff7dea43ea1512afe5448dca9df1b7ab0726129603f1a3336b631e4d7a1a44c94daddd03241587f9@3.9.20.133:30303")
.map(EnodeURLImpl::fromString)
.collect(toList()));
public static final List<EnodeURL> CLASSIC_BOOTSTRAP_NODES =
Collections.unmodifiableList(
Stream.of(

@ -144,7 +144,7 @@ public class TestSetChainParams implements JsonRpcMethod {
}
maybeMoveToNumber(params, "londonForkBlock", config, "aleutBlock");
maybeMoveToNumber(params, "londonForkBlock", config, "baikalBlock");
maybeMoveToNumber(params, "londonForkBlock", config, "calaverasBlock");
maybeMoveToNumber(params, "londonForkBlock", config, "londonBlock");
// strip out precompiles with zero balance

Loading…
Cancel
Save