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

Re-enable Quorum Synchronisation #1056

Merged
merged 1 commit into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void startNode(final PantheonNode node) {
.synchronizerConfiguration(new SynchronizerConfiguration.Builder().build())
.homePath(node.homeDirectory())
.ethNetworkConfig(ethNetworkConfig)
.syncWithOttoman(false)
.miningParameters(node.getMiningParameters())
.privacyParameters(node.getPrivacyParameters())
.devMode(node.isDevMode())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,6 @@ PantheonController<?> buildController() {
.synchronizerConfiguration(buildSyncConfig())
.homePath(dataDir())
.ethNetworkConfig(updateNetworkConfig(getNetwork()))
.syncWithOttoman(false) // ottoman feature is still there but it's now removed from CLI
.miningParameters(
new MiningParameters(coinbase, minTransactionGasPrice, extraData, isMiningEnabled))
.devMode(NetworkName.DEV.equals(getNetwork()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class PantheonControllerBuilder {
private SynchronizerConfiguration synchronizerConfiguration;
private Path homePath;
private EthNetworkConfig ethNetworkConfig;
private boolean syncWithOttoman;
private MiningParameters miningParameters;
private boolean devMode;
private File nodePrivateKeyFile;
Expand All @@ -57,11 +56,6 @@ public PantheonControllerBuilder ethNetworkConfig(final EthNetworkConfig ethNetw
return this;
}

public PantheonControllerBuilder syncWithOttoman(final boolean syncWithOttoman) {
this.syncWithOttoman = syncWithOttoman;
return this;
}

public PantheonControllerBuilder miningParameters(final MiningParameters miningParameters) {
this.miningParameters = miningParameters;
return this;
Expand Down Expand Up @@ -107,7 +101,6 @@ public PantheonController<?> build() throws IOException {
genesisConfigFile,
synchronizerConfiguration,
storageProvider,
syncWithOttoman,
ethNetworkConfig.getNetworkId(),
miningParameters,
nodeKeys,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import tech.pegasys.pantheon.ethereum.core.PrivacyParameters;
import tech.pegasys.pantheon.ethereum.core.Synchronizer;
import tech.pegasys.pantheon.ethereum.core.TransactionPool;
import tech.pegasys.pantheon.ethereum.eth.EthProtocol;
import tech.pegasys.pantheon.ethereum.eth.manager.EthProtocolManager;
import tech.pegasys.pantheon.ethereum.eth.sync.DefaultSynchronizer;
import tech.pegasys.pantheon.ethereum.eth.sync.SyncMode;
Expand Down Expand Up @@ -97,7 +96,6 @@ static PantheonController<IbftContext> init(
final StorageProvider storageProvider,
final GenesisConfigFile genesisConfig,
final SynchronizerConfiguration syncConfig,
final boolean ottomanTestnetOperation,
final int networkId,
final KeyPair nodeKeys,
final Path dataDirectory,
Expand Down Expand Up @@ -131,32 +129,18 @@ static PantheonController<IbftContext> init(
final boolean fastSyncEnabled = syncConfig.syncMode().equals(SyncMode.FAST);
final EthProtocolManager ethProtocolManager;
final SubProtocol ethSubProtocol;
if (ottomanTestnetOperation) {
LOG.info("Operating on Ottoman testnet.");
ethSubProtocol = Istanbul64Protocol.get();
ethProtocolManager =
new Istanbul64ProtocolManager(
blockchain,
protocolContext.getWorldStateArchive(),
networkId,
fastSyncEnabled,
syncConfig.downloaderParallelism(),
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem);
} else {
ethSubProtocol = EthProtocol.get();
ethProtocolManager =
new EthProtocolManager(
blockchain,
protocolContext.getWorldStateArchive(),
networkId,
fastSyncEnabled,
syncConfig.downloaderParallelism(),
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem);
}
LOG.info("Operating on IBFT-1.0 network.");
ethSubProtocol = Istanbul64Protocol.get();
ethProtocolManager =
new Istanbul64ProtocolManager(
blockchain,
protocolContext.getWorldStateArchive(),
networkId,
fastSyncEnabled,
syncConfig.downloaderParallelism(),
syncConfig.transactionsParallelism(),
syncConfig.computationParallelism(),
metricsSystem);

final SyncState syncState =
new SyncState(blockchain, ethProtocolManager.ethContext().getEthPeers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ static PantheonController<?> fromConfig(
final GenesisConfigFile genesisConfigFile,
final SynchronizerConfiguration syncConfig,
final StorageProvider storageProvider,
final boolean ottomanTestnetOperation,
final int networkId,
final MiningParameters miningParameters,
final KeyPair nodeKeys,
Expand Down Expand Up @@ -82,7 +81,6 @@ static PantheonController<?> fromConfig(
storageProvider,
genesisConfigFile,
syncConfig,
ottomanTestnetOperation,
networkId,
nodeKeys,
dataDirectory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public void privacyPrecompiled() throws IOException {
GenesisConfigFile.mainnet(),
SynchronizerConfiguration.builder().build(),
new InMemoryStorageProvider(),
false,
1,
new MiningParametersTestBuilder().enabled(false).build(),
SECP256K1.KeyPair.generate(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ public void initMocks() throws Exception {
when(mockControllerBuilder.synchronizerConfiguration(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.homePath(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.ethNetworkConfig(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.syncWithOttoman(anyBoolean())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.miningParameters(any())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.devMode(anyBoolean())).thenReturn(mockControllerBuilder);
when(mockControllerBuilder.nodePrivateKeyFile(any())).thenReturn(mockControllerBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ public void callingPantheonCommandWithoutOptionsMustSyncWithDefaultValues() thro
verify(mockControllerBuilder).synchronizerConfiguration(isNotNull());
verify(mockControllerBuilder).homePath(isNotNull());
verify(mockControllerBuilder).ethNetworkConfig(networkArg.capture());
verify(mockControllerBuilder).syncWithOttoman(eq(false));
verify(mockControllerBuilder).miningParameters(miningArg.capture());
verify(mockControllerBuilder).devMode(eq(false));
verify(mockControllerBuilder).nodePrivateKeyFile(isNotNull());
Expand Down Expand Up @@ -298,7 +297,6 @@ public void overrideDefaultValuesIfKeyIsPresentInConfigFile() throws IOException
.build();
verify(mockControllerBuilder).homePath(eq(Paths.get("~/pantheondata").toAbsolutePath()));
verify(mockControllerBuilder).ethNetworkConfig(eq(networkConfig));
verify(mockControllerBuilder).syncWithOttoman(eq(false));

// TODO: Re-enable as per NC-1057/NC-1681
// verify(mockSyncConfBuilder).syncMode(ArgumentMatchers.eq(SyncMode.FAST));
Expand Down Expand Up @@ -445,7 +443,6 @@ public void noOverrideDefaultValuesIfKeyIsNotPresentInConfigFile() throws IOExce
verify(mockRunnerBuilder).metricsConfiguration(eq(metricsConfiguration));
verify(mockRunnerBuilder).build();

verify(mockControllerBuilder).syncWithOttoman(eq(false));
verify(mockControllerBuilder).devMode(eq(false));
verify(mockControllerBuilder).build();

Expand Down Expand Up @@ -478,7 +475,6 @@ public void nodekeyOptionMustBeUsed() throws Exception {
parseCommand("--node-private-key-file", file.getPath());

verify(mockControllerBuilder).homePath(isNotNull());
verify(mockControllerBuilder).syncWithOttoman(eq(false));
verify(mockControllerBuilder).nodePrivateKeyFile(fileArgumentCaptor.capture());
verify(mockControllerBuilder).build();

Expand Down Expand Up @@ -525,7 +521,6 @@ public void dataDirOptionMustBeUsed() throws Exception {
parseCommand("--data-path", path.toString());

verify(mockControllerBuilder).homePath(pathArgumentCaptor.capture());
verify(mockControllerBuilder).syncWithOttoman(eq(false));
verify(mockControllerBuilder)
.nodePrivateKeyFile(eq(path.resolve("key").toAbsolutePath().toFile()));
verify(mockControllerBuilder).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public void blockImport() throws IOException {
GenesisConfigFile.mainnet(),
SynchronizerConfiguration.builder().build(),
new InMemoryStorageProvider(),
false,
1,
new MiningParametersTestBuilder().enabled(false).build(),
KeyPair.generate(),
Expand Down Expand Up @@ -89,7 +88,6 @@ public void ibftImport() throws IOException {
GenesisConfigFile.fromConfig(config),
SynchronizerConfiguration.builder().build(),
new InMemoryStorageProvider(),
false,
10,
new MiningParametersTestBuilder().enabled(false).build(),
KeyPair.generate(),
Expand Down