YOLOv2 configuration (#1386)

* YOLOv2 configuration

* deprecate old yoloV1 options
* replace with  yoloV2 options
* clear the yolo bootnode
* expose experimental EIPs flag to EVM Tool

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
pull/1413/head
Danno Ferrin 4 years ago committed by GitHub
parent 3fd0e49b23
commit dc77f99cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      CHANGELOG.md
  2. 10
      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. 8
      config/src/main/java/org/hyperledger/besu/config/JsonGenesisConfigOptions.java
  5. 2
      config/src/main/resources/yolo.json
  6. 4
      config/src/test/java/org/hyperledger/besu/config/GenesisConfigOptionsTest.java
  7. 3
      ethereum/evmtool/src/main/java/org/hyperledger/besu/evmtool/EvmToolCommand.java
  8. 9
      ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/config/DiscoveryConfiguration.java

@ -1,9 +1,23 @@
# Changelog
## 1.6.0-RC1
### Additions and Improvements
* Added support for the upcoming YOLOv2 ephemeral testnet and removed the flag for the deprecated YOLOv1 ephemeral testnet.
### Bug Fixes
#### Previously identified known issues
- [Eth/65 loses peers](KNOWN_ISSUES.md#eth65-loses-peers)
- [Fast sync when running Besu on cloud providers](KNOWN_ISSUES.md#fast-sync-when-running-besu-on-cloud-providers)
- [Privacy users with private transactions created using v1.3.4 or earlier](KNOWN_ISSUES.md#privacy-users-with-private-transactions-created-using-v134-or-earlier)
- [Changes not saved to database correctly causing inconsistent private states](KNOWN_ISSUES.md#Changes-not-saved-to-database-correctly-causing-inconsistent-private-states)
## 1.5.5
### Additions and Improvements
* The new version of the [web3js-eea library (v0.10)](https://github.com/PegaSysEng/web3js-eea) supports the onchain privacy group management changes made in Besu v1.5.3.
* The new version of the [web3js-eea library (v0.10)](https://github.com/PegaSysEng/web3js-eea) supports the onchain privacy group management changes made in Besu v1.5.3.
### Bug Fixes
* Added `debug_getBadBlocks` JSON-RPC API to analyze and detect consensus flaws. Even if a block is rejected it will be returned by this method [\#1378](https://github.com/hyperledger/besu/pull/1378)

@ -22,7 +22,7 @@ import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.MA
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.MORDOR_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.RINKEBY_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.ROPSTEN_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.YOLO_V1_BOOTSTRAP_NODES;
import static org.hyperledger.besu.ethereum.p2p.config.DiscoveryConfiguration.YOLO_V2_BOOTSTRAP_NODES;
import org.hyperledger.besu.ethereum.p2p.peers.EnodeURL;
@ -46,7 +46,7 @@ public class EthNetworkConfig {
public static final BigInteger CLASSIC_NETWORK_ID = BigInteger.valueOf(1);
public static final BigInteger KOTTI_NETWORK_ID = BigInteger.valueOf(6);
public static final BigInteger MORDOR_NETWORK_ID = BigInteger.valueOf(7);
private static final BigInteger YOLO_V1_NETWORK_ID = BigInteger.valueOf(133519467574833L);
private static final BigInteger YOLO_V2_NETWORK_ID = BigInteger.valueOf(133519467574833L);
private static final String MAINNET_GENESIS = "/mainnet.json";
private static final String ROPSTEN_GENESIS = "/ropsten.json";
private static final String RINKEBY_GENESIS = "/rinkeby.json";
@ -134,9 +134,9 @@ public class EthNetworkConfig {
case MORDOR:
return new EthNetworkConfig(
jsonConfig(MORDOR_GENESIS), MORDOR_NETWORK_ID, MORDOR_BOOTSTRAP_NODES);
case YOLO_V1:
case YOLO_V2:
return new EthNetworkConfig(
jsonConfig(YOLO_GENESIS), YOLO_V1_NETWORK_ID, YOLO_V1_BOOTSTRAP_NODES);
jsonConfig(YOLO_GENESIS), YOLO_V2_NETWORK_ID, YOLO_V2_BOOTSTRAP_NODES);
case MAINNET:
default:
return new EthNetworkConfig(
@ -171,7 +171,7 @@ public class EthNetworkConfig {
return jsonConfig(KOTTI_GENESIS);
case MORDOR:
return jsonConfig(MORDOR_GENESIS);
case YOLO_V1:
case YOLO_V2:
return jsonConfig(YOLO_GENESIS);
default:
throw new IllegalArgumentException("Unknown network:" + network);

@ -23,5 +23,5 @@ public enum NetworkName {
CLASSIC,
KOTTI,
MORDOR,
YOLO_V1
YOLO_V2
}

@ -215,13 +215,13 @@ public class JsonGenesisConfigOptions implements GenesisConfigOptions {
public OptionalLong getBerlinBlockNumber() {
if (ExperimentalEIPs.berlinEnabled) {
final OptionalLong berlinBlock = getOptionalLong("berlinblock");
final OptionalLong yolov1Block = getOptionalLong("yolov1block");
if (yolov1Block.isPresent()) {
final OptionalLong yolov2Block = getOptionalLong("yolov2block");
if (yolov2Block.isPresent()) {
if (berlinBlock.isPresent()) {
throw new RuntimeException(
"Genesis files cannot specify both berlinblock and yoloV1Block.");
"Genesis files cannot specify both berlinblock and yoloV2Block.");
}
return yolov1Block;
return yolov2Block;
}
return berlinBlock;
}

@ -10,7 +10,7 @@
"constantinopleBlock":0,
"petersburgBlock":0,
"istanbulBlock":0,
"yoloV1Block":0,
"yoloV2Block":0,
"clique":{
"period":15,
"epoch":30000

@ -173,10 +173,10 @@ public class GenesisConfigOptionsTest {
}
@Test
public void shouldGetYoloV1BlockNumber() {
public void shouldGetYoloV2BlockNumber() {
try {
ExperimentalEIPs.berlinEnabled = true;
final GenesisConfigOptions config = fromConfigOptions(singletonMap("yoloV1Block", 1000));
final GenesisConfigOptions config = fromConfigOptions(singletonMap("yoloV2Block", 1000));
assertThat(config.getBerlinBlockNumber()).hasValue(1000);
} finally {
ExperimentalEIPs.berlinEnabled = ExperimentalEIPs.BERLIN_ENABLED_DEFAULT_VALUE;

@ -18,6 +18,7 @@ package org.hyperledger.besu.evmtool;
import static picocli.CommandLine.ScopeType.INHERIT;
import org.hyperledger.besu.cli.config.NetworkName;
import org.hyperledger.besu.config.experimental.ExperimentalEIPs;
import org.hyperledger.besu.ethereum.core.Account;
import org.hyperledger.besu.ethereum.core.Address;
import org.hyperledger.besu.ethereum.core.BlockHeader;
@ -156,6 +157,8 @@ public class EvmToolCommand implements Runnable {
out = resultHandler.out();
final CommandLine commandLine = new CommandLine(this);
commandLine.addMixin("Dagger Options", daggerOptions);
// Usage of static command line flags is strictly reserved for experimental EIPs
commandLine.addMixin("Experimental EIPs", ExperimentalEIPs.class);
// add sub commands here

@ -156,12 +156,9 @@ public class DiscoveryConfiguration {
.map(EnodeURL::fromString)
.collect(toList()));
public static List<EnodeURL> YOLO_V1_BOOTSTRAP_NODES =
Collections.unmodifiableList(
Stream.of(
"enode://9e1096aa59862a6f164994cb5cb16f5124d6c992cdbf4535ff7dea43ea1512afe5448dca9df1b7ab0726129603f1a3336b631e4d7a1a44c94daddd03241587f9@52.56.120.77:30303")
.map(EnodeURL::fromString)
.collect(toList()));
// yoloV2 currently does not have a live network
public static List<EnodeURL> YOLO_V2_BOOTSTRAP_NODES =
Collections.unmodifiableList(Stream.<String>of().map(EnodeURL::fromString).collect(toList()));
private boolean active = true;
private String bindHost = NetworkUtility.INADDR_ANY;

Loading…
Cancel
Save