Actually use the network ID is MainnetPantheonController (#929)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Adrian Sutton 6 years ago committed by GitHub
parent eb3fca256c
commit 942b430744
  1. 7
      pantheon/src/main/java/tech/pegasys/pantheon/controller/MainnetPantheonController.java
  2. 1
      pantheon/src/main/java/tech/pegasys/pantheon/controller/PantheonController.java
  3. 4
      pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java

@ -33,7 +33,6 @@ import tech.pegasys.pantheon.ethereum.eth.sync.SynchronizerConfiguration;
import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncState; import tech.pegasys.pantheon.ethereum.eth.sync.state.SyncState;
import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPoolFactory; import tech.pegasys.pantheon.ethereum.eth.transactions.TransactionPoolFactory;
import tech.pegasys.pantheon.ethereum.mainnet.MainnetBlockHeaderValidator; import tech.pegasys.pantheon.ethereum.mainnet.MainnetBlockHeaderValidator;
import tech.pegasys.pantheon.ethereum.mainnet.MainnetProtocolSchedule;
import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule; import tech.pegasys.pantheon.ethereum.mainnet.ProtocolSchedule;
import tech.pegasys.pantheon.ethereum.p2p.api.ProtocolManager; import tech.pegasys.pantheon.ethereum.p2p.api.ProtocolManager;
import tech.pegasys.pantheon.ethereum.p2p.config.SubProtocolConfiguration; import tech.pegasys.pantheon.ethereum.p2p.config.SubProtocolConfiguration;
@ -92,6 +91,7 @@ public class MainnetPantheonController implements PantheonController<Void> {
final ProtocolSchedule<Void> protocolSchedule, final ProtocolSchedule<Void> protocolSchedule,
final SynchronizerConfiguration syncConfig, final SynchronizerConfiguration syncConfig,
final MiningParameters miningParams, final MiningParameters miningParams,
final int networkId,
final KeyPair nodeKeys, final KeyPair nodeKeys,
final PrivacyParameters privacyParameters, final PrivacyParameters privacyParameters,
final Path dataDirectory, final Path dataDirectory,
@ -108,10 +108,7 @@ public class MainnetPantheonController implements PantheonController<Void> {
new EthProtocolManager( new EthProtocolManager(
blockchain, blockchain,
protocolContext.getWorldStateArchive(), protocolContext.getWorldStateArchive(),
genesisConfig networkId,
.getConfigOptions()
.getChainId()
.orElse(MainnetProtocolSchedule.DEFAULT_CHAIN_ID),
fastSyncEnabled, fastSyncEnabled,
syncConfig.downloaderParallelism(), syncConfig.downloaderParallelism(),
syncConfig.transactionsParallelism(), syncConfig.transactionsParallelism(),

@ -62,6 +62,7 @@ public interface PantheonController<C> extends Closeable {
MainnetProtocolSchedule.fromConfig(configOptions, privacyParameters), MainnetProtocolSchedule.fromConfig(configOptions, privacyParameters),
syncConfig, syncConfig,
miningParameters, miningParameters,
networkId,
nodeKeys, nodeKeys,
privacyParameters, privacyParameters,
dataDirectory, dataDirectory,

@ -94,6 +94,7 @@ public final class RunnerTest {
final SynchronizerConfiguration syncConfigAhead = final SynchronizerConfiguration syncConfigAhead =
SynchronizerConfiguration.builder().syncMode(SyncMode.FULL).build(); SynchronizerConfiguration.builder().syncMode(SyncMode.FULL).build();
final MetricsSystem noOpMetricsSystem = new NoOpMetricsSystem(); final MetricsSystem noOpMetricsSystem = new NoOpMetricsSystem();
final int networkId = 2929;
// Setup state with block data // Setup state with block data
try (final PantheonController<Void> controller = try (final PantheonController<Void> controller =
@ -103,6 +104,7 @@ public final class RunnerTest {
MainnetProtocolSchedule.create(), MainnetProtocolSchedule.create(),
syncConfigAhead, syncConfigAhead,
new MiningParametersTestBuilder().enabled(false).build(), new MiningParametersTestBuilder().enabled(false).build(),
networkId,
aheadDbNodeKeys, aheadDbNodeKeys,
PrivacyParameters.noPrivacy(), PrivacyParameters.noPrivacy(),
dataDirAhead, dataDirAhead,
@ -118,6 +120,7 @@ public final class RunnerTest {
MainnetProtocolSchedule.create(), MainnetProtocolSchedule.create(),
syncConfigAhead, syncConfigAhead,
new MiningParametersTestBuilder().enabled(false).build(), new MiningParametersTestBuilder().enabled(false).build(),
networkId,
aheadDbNodeKeys, aheadDbNodeKeys,
PrivacyParameters.noPrivacy(), PrivacyParameters.noPrivacy(),
dataDirAhead, dataDirAhead,
@ -171,6 +174,7 @@ public final class RunnerTest {
MainnetProtocolSchedule.create(), MainnetProtocolSchedule.create(),
syncConfigBehind, syncConfigBehind,
new MiningParametersTestBuilder().enabled(false).build(), new MiningParametersTestBuilder().enabled(false).build(),
networkId,
KeyPair.generate(), KeyPair.generate(),
PrivacyParameters.noPrivacy(), PrivacyParameters.noPrivacy(),
dataDirBehind, dataDirBehind,

Loading…
Cancel
Save