Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
Actually use the network ID is MainnetPantheonController (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajsutton authored Feb 20, 2019
1 parent 1286ad3 commit b3dc4d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
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;
Expand Down Expand Up @@ -92,6 +91,7 @@ public static PantheonController<Void> init(
final ProtocolSchedule<Void> protocolSchedule,
final SynchronizerConfiguration syncConfig,
final MiningParameters miningParams,
final int networkId,
final KeyPair nodeKeys,
final PrivacyParameters privacyParameters,
final Path dataDirectory,
Expand All @@ -108,10 +108,7 @@ public static PantheonController<Void> init(
new EthProtocolManager(
blockchain,
protocolContext.getWorldStateArchive(),
genesisConfig
.getConfigOptions()
.getChainId()
.orElse(MainnetProtocolSchedule.DEFAULT_CHAIN_ID),
networkId,
fastSyncEnabled,
syncConfig.downloaderParallelism(),
syncConfig.transactionsParallelism(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static PantheonController<?> fromConfig(
MainnetProtocolSchedule.fromConfig(configOptions, privacyParameters),
syncConfig,
miningParameters,
networkId,
nodeKeys,
privacyParameters,
dataDirectory,
Expand Down
4 changes: 4 additions & 0 deletions pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
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 =
Expand All @@ -103,6 +104,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
MainnetProtocolSchedule.create(),
syncConfigAhead,
new MiningParametersTestBuilder().enabled(false).build(),
networkId,
aheadDbNodeKeys,
PrivacyParameters.noPrivacy(),
dataDirAhead,
Expand All @@ -118,6 +120,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
MainnetProtocolSchedule.create(),
syncConfigAhead,
new MiningParametersTestBuilder().enabled(false).build(),
networkId,
aheadDbNodeKeys,
PrivacyParameters.noPrivacy(),
dataDirAhead,
Expand Down Expand Up @@ -171,6 +174,7 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {
MainnetProtocolSchedule.create(),
syncConfigBehind,
new MiningParametersTestBuilder().enabled(false).build(),
networkId,
KeyPair.generate(),
PrivacyParameters.noPrivacy(),
dataDirBehind,
Expand Down

0 comments on commit b3dc4d2

Please sign in to comment.