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

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

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

Loading…
Cancel
Save