Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
e28c563
Add validations of new experimental flag
gfukushima Nov 25, 2022
7ca71f9
Add check to call MergeController without the using the TransitionCon…
gfukushima Nov 25, 2022
d926c17
Use new flag to skip latestValidAncestorDescendsFromTerminal check
gfukushima Nov 25, 2022
737af27
Add experimental flag
gfukushima Nov 25, 2022
5a6afd4
Add parser
gfukushima Nov 25, 2022
c00c0c4
Add isNearHeadCheckpointSync method to interface
gfukushima Nov 25, 2022
c17c354
Add isNearHeadCheckpointSync implementations
gfukushima Nov 25, 2022
d74f9cb
Add attribute for the new flag
gfukushima Nov 25, 2022
cd8bbd3
Pass value to MergeContext
gfukushima Nov 25, 2022
a8026e1
Add unit tests
gfukushima Nov 25, 2022
0038b37
Add resource for unit test
gfukushima Nov 25, 2022
11d73af
Add check for optional
gfukushima Nov 25, 2022
ed0c55a
Spotless apply
gfukushima Nov 25, 2022
428f2ef
Merge branch 'near-head-checkpoint-sync' into main-gfukushima
gfukushima Nov 25, 2022
216d3bd
Use Default
gfukushima Nov 25, 2022
6d514b9
Add new field to be ignored
gfukushima Nov 25, 2022
6ee5296
Fix params order
gfukushima Nov 25, 2022
ee19889
Change validation order
gfukushima Nov 25, 2022
6eec853
Refactor validation
gfukushima Nov 25, 2022
2ff6786
Spotless
gfukushima Nov 25, 2022
4b9028d
Add extra unit test
gfukushima Nov 25, 2022
afeda6c
Rename variable
gfukushima Nov 27, 2022
af7f0d5
Remove parser
gfukushima Nov 29, 2022
d207c47
Remove parser
gfukushima Nov 29, 2022
7b2e85b
Merge branch 'main' into nearhead-checkpoint-sync
gfukushima Nov 29, 2022
6b454ba
Change validation to use total difficulty
gfukushima Nov 30, 2022
3a00e41
Merge remote-tracking branch 'origin/nearhead-checkpoint-sync' into n…
gfukushima Nov 30, 2022
b11ab44
Change validation to use total difficulty
gfukushima Nov 30, 2022
d7eb1c2
Merge branch 'main' into nearhead-checkpoint-sync
gfukushima Dec 1, 2022
cb5ebb7
Merge branch 'main' into nearhead-checkpoint-sync
gfukushima Dec 1, 2022
cebc22b
Add validation for checkpoint config
gfukushima Dec 1, 2022
f9b7d95
Merge remote-tracking branch 'origin/nearhead-checkpoint-sync' into n…
gfukushima Dec 1, 2022
05e9c30
Merge branch 'main' into nearhead-checkpoint-sync
gfukushima Dec 1, 2022
43ac009
Refactor code to reflect current state of the feature.
gfukushima Dec 8, 2022
0937714
Add unit test
gfukushima Dec 8, 2022
19e2a15
Merge remote-tracking branch 'origin/nearhead-checkpoint-sync' into n…
gfukushima Dec 8, 2022
43ae7b3
Merge branch 'main_hyperledger' into nearhead-checkpoint-sync
gfukushima Dec 8, 2022
54f603a
spotless
gfukushima Dec 8, 2022
288ed54
Merge remote-tracking branch 'origin/nearhead-checkpoint-sync' into n…
gfukushima Dec 8, 2022
2979bb0
Fix logic for isSyncing method covering possible NPE
gfukushima Dec 9, 2022
34b3f90
Add cover for TTD = TD of the checkpoint block (merge at genesis)
gfukushima Dec 9, 2022
4b26c76
Remove field from test
gfukushima Dec 9, 2022
f824ff4
Fix unit test
gfukushima Dec 9, 2022
d2720e8
Add build method and set syncState
gfukushima Dec 13, 2022
6cad478
Fix possible NUll Reference Exception and unit test to validate that
gfukushima Dec 13, 2022
42e5f4c
Add edge case for merge at genesis and unit tests
gfukushima Dec 13, 2022
32a047c
Merge branch 'main_hyperledger' into nearhead-checkpoint-sync
gfukushima Dec 13, 2022
cbd9d1a
Merge main into branch
gfukushima Dec 13, 2022
3ae9e25
Add accessList field to Transaction Call Object (#4802)
Gabriel-Trintinalia Dec 13, 2022
406a069
Docker release task for latest tags (#4810)
jframe Dec 14, 2022
8521822
Fix docker release workflow login (#4826)
jframe Dec 14, 2022
bd467a1
Add download sha sums for 22.10.3 release (#4827)
jframe Dec 15, 2022
928f008
Pass syncMode to BesuController.Builder to allow checkpointsync PoS
gfukushima Dec 20, 2022
6810c3c
Fix difficulty of invalid genesis
gfukushima Dec 20, 2022
18d29ca
Add static method
gfukushima Dec 20, 2022
34f0b9d
Pass syncMode to BesuController builder
gfukushima Dec 20, 2022
8c7411b
spotless
gfukushima Dec 20, 2022
3ccfec0
Merge remote-tracking branch 'hyperledge/main'
gfukushima Dec 20, 2022
7b56639
Merge branch 'main' into nearhead-checkpoint-sync
gfukushima Dec 20, 2022
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog
## 23.1

### Additions and Improvements
- Add access list to Transaction Call Object [#4802](https://github.com/hyperledger/besu/issues/4801)

### Breaking Changes
- GoQuorum-compatible privacy is deprecated and will be removed in 23.4
- IBFT 1.0 is deprecated and will be removed in 23.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.io.File;
import java.nio.file.Path;
import java.time.Clock;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -147,8 +148,12 @@ public void startNode(final BesuNode node) {
.setBootNodes(bootnodes);
node.getConfiguration().getGenesisConfig().ifPresent(networkConfigBuilder::setGenesisConfig);
final EthNetworkConfig ethNetworkConfig = networkConfigBuilder.build();
final SynchronizerConfiguration synchronizerConfiguration =
new SynchronizerConfiguration.Builder().build();
final BesuControllerBuilder builder =
new BesuController.Builder().fromEthNetworkConfig(ethNetworkConfig);
new BesuController.Builder()
.fromEthNetworkConfig(
ethNetworkConfig, Collections.emptyMap(), synchronizerConfiguration.getSyncMode());

final KeyValueStorageProvider storageProvider =
new KeyValueStorageProviderBuilder()
Expand Down
43 changes: 42 additions & 1 deletion besu/src/main/java/org/hyperledger/besu/cli/BesuCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import org.hyperledger.besu.cli.util.CommandLineUtils;
import org.hyperledger.besu.cli.util.ConfigOptionSearchAndRunHandler;
import org.hyperledger.besu.cli.util.VersionProvider;
import org.hyperledger.besu.config.CheckpointConfigOptions;
import org.hyperledger.besu.config.GenesisConfigFile;
import org.hyperledger.besu.config.GenesisConfigOptions;
import org.hyperledger.besu.config.GoQuorumOptions;
Expand Down Expand Up @@ -1779,6 +1780,7 @@ private void validateOptions() {
validateDnsOptionsParams();
ensureValidPeerBoundParams();
validateRpcOptionsParams();
validatePostMergeCheckpointBlockRequirements();
validateChainDataPruningParams();
p2pTLSConfigOptions.checkP2PTLSOptionsDependencies(logger, commandLine);
pkiBlockCreationOptions.checkPkiBlockCreationOptionsDependencies(logger, commandLine);
Expand Down Expand Up @@ -2003,6 +2005,12 @@ private void issueOptionWarnings() {
!SyncMode.isFullSync(getDefaultSyncModeIfNotSet(syncMode)),
singletonList("--fast-sync-min-peers"));

CommandLineUtils.failIfOptionDoesntMeetRequirement(
commandLine,
"--Xcheckpoint-post-merge-enabled can only be used with X_CHECKPOINT sync-mode",
SyncMode.X_CHECKPOINT.equals(getDefaultSyncModeIfNotSet(syncMode)),
singletonList("--Xcheckpoint-post-merge-enabled"));

if (!securityModuleName.equals(DEFAULT_SECURITY_MODULE)
&& nodePrivateKeyFileOption.getNodePrivateKeyFile() != null) {
logger.warn(
Expand Down Expand Up @@ -2156,7 +2164,7 @@ public BesuController buildController() {
public BesuControllerBuilder getControllerBuilder() {
final KeyValueStorageProvider storageProvider = keyValueStorageProvider(keyValueStorageName);
return controllerBuilderFactory
.fromEthNetworkConfig(updateNetworkConfig(network), genesisConfigOverrides)
.fromEthNetworkConfig(updateNetworkConfig(network), genesisConfigOverrides, syncMode)
.synchronizerConfiguration(buildSyncConfig())
.ethProtocolConfiguration(unstableEthProtocolOptions.toDomainObject())
.dataDirectory(dataDir())
Expand Down Expand Up @@ -3344,6 +3352,39 @@ private void setMergeConfigOptions() {
.isPresent());
}

private void validatePostMergeCheckpointBlockRequirements() {
final GenesisConfigOptions genesisOptions =
Optional.ofNullable(genesisConfigOptions)
.orElseGet(
() ->
GenesisConfigFile.fromConfig(
genesisConfig(Optional.ofNullable(network).orElse(MAINNET)))
.getConfigOptions(genesisConfigOverrides));
final SynchronizerConfiguration synchronizerConfiguration =
unstableSynchronizerOptions.toDomainObject().build();
final Optional<UInt256> terminalTotalDifficulty = genesisOptions.getTerminalTotalDifficulty();
final CheckpointConfigOptions checkpointConfigOptions = genesisOptions.getCheckpointOptions();
if (synchronizerConfiguration.isCheckpointPostMergeEnabled()) {
if (!checkpointConfigOptions.isValid()) {
throw new InvalidConfigurationException(
"Near head checkpoint sync requires a checkpoint block configured in the genesis file");
}
terminalTotalDifficulty.ifPresentOrElse(
value -> {
if (UInt256.fromHexString(
genesisOptions.getCheckpointOptions().getTotalDifficulty().orElse("0x0"))
.lessOrEqualThan(value)) {
throw new InvalidConfigurationException(
"Near head checkpoint sync requires a block with total difficulty greater than the TTD");
}
Comment on lines +3376 to +3379

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a special case here as well for genesisTD = 0 = TTD?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you successfully tested a post-merge genesis with this code?

},
() -> {
throw new InvalidConfigurationException(
"Near head checkpoint sync requires TTD in the genesis file");
});
}
}

private boolean isMergeEnabled() {
return MergeConfigOptions.isMergeEnabled();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public class SynchronizerOptions implements CLIOptions<SynchronizerConfiguration
private static final String SNAP_TRIENODE_COUNT_PER_REQUEST_FLAG =
"--Xsnapsync-synchronizer-trienode-count-per-request";

private static final String CHECKPOINT_POST_MERGE_FLAG = "--Xcheckpoint-post-merge-enabled";

@CommandLine.Option(
names = BLOCK_PROPAGATION_RANGE_FLAG,
hidden = true,
Expand Down Expand Up @@ -272,6 +274,13 @@ public void parseBlockPropagationRange(final String arg) {
private int snapsyncTrieNodeCountPerRequest =
SnapSyncConfiguration.DEFAULT_TRIENODE_COUNT_PER_REQUEST;

@CommandLine.Option(
names = {CHECKPOINT_POST_MERGE_FLAG},
hidden = true,
description = "Enable the sync to start from a post-merge block.")
private Boolean checkpointPostMergeSyncEnabled =
SynchronizerConfiguration.DEFAULT_CHECKPOINT_POST_MERGE_ENABLED;

private SynchronizerOptions() {}

public static SynchronizerOptions create() {
Expand Down Expand Up @@ -308,6 +317,7 @@ public static SynchronizerOptions fromConfig(final SynchronizerConfiguration con
config.getSnapSyncConfiguration().getBytecodeCountPerRequest();
options.snapsyncTrieNodeCountPerRequest =
config.getSnapSyncConfiguration().getTrienodeCountPerRequest();
options.checkpointPostMergeSyncEnabled = config.isCheckpointPostMergeEnabled();
return options;
}

Expand Down Expand Up @@ -338,6 +348,7 @@ public SynchronizerConfiguration.Builder toDomainObject() {
.bytecodeCountPerRequest(snapsyncBytecodeCountPerRequest)
.trienodeCountPerRequest(snapsyncTrieNodeCountPerRequest)
.build());
builder.checkpointPostMergeEnabled(checkpointPostMergeSyncEnabled);

return builder;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package org.hyperledger.besu.controller;

import static org.hyperledger.besu.ethereum.eth.sync.SyncMode.isCheckpointSync;

import org.hyperledger.besu.cli.config.EthNetworkConfig;
import org.hyperledger.besu.config.GenesisConfigFile;
import org.hyperledger.besu.config.GenesisConfigOptions;
Expand All @@ -28,10 +30,12 @@
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Synchronizer;
import org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.state.SyncState;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPool;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
import org.hyperledger.besu.ethereum.p2p.config.SubProtocolConfiguration;
import org.hyperledger.besu.util.InvalidConfigurationException;

import java.io.Closeable;
import java.io.IOException;
Expand All @@ -41,6 +45,7 @@
import java.util.List;
import java.util.Map;

import org.apache.tuweni.units.bigints.UInt256;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -171,24 +176,26 @@ public PluginServiceFactory getAdditionalPluginServices() {

public static class Builder {

public BesuControllerBuilder fromEthNetworkConfig(final EthNetworkConfig ethNetworkConfig) {
return fromEthNetworkConfig(ethNetworkConfig, Collections.emptyMap());
}

public BesuControllerBuilder fromEthNetworkConfig(
final EthNetworkConfig ethNetworkConfig, final Map<String, String> genesisConfigOverrides) {
final EthNetworkConfig ethNetworkConfig,
final Map<String, String> genesisConfigOverrides,
final SyncMode syncMode) {
return fromGenesisConfig(
GenesisConfigFile.fromConfig(ethNetworkConfig.getGenesisConfig()),
genesisConfigOverrides)
genesisConfigOverrides,
syncMode)
.networkId(ethNetworkConfig.getNetworkId());
}

public BesuControllerBuilder fromGenesisConfig(final GenesisConfigFile genesisConfig) {
return fromGenesisConfig(genesisConfig, Collections.emptyMap());
public BesuControllerBuilder fromGenesisConfig(
final GenesisConfigFile genesisConfig, final SyncMode syncMode) {
return fromGenesisConfig(genesisConfig, Collections.emptyMap(), syncMode);
}

BesuControllerBuilder fromGenesisConfig(
final GenesisConfigFile genesisConfig, final Map<String, String> genesisConfigOverrides) {
final GenesisConfigFile genesisConfig,
final Map<String, String> genesisConfigOverrides,
final SyncMode syncMode) {
final GenesisConfigOptions configOptions =
genesisConfig.getConfigOptions(genesisConfigOverrides);
final BesuControllerBuilder builder;
Expand All @@ -213,11 +220,17 @@ BesuControllerBuilder fromGenesisConfig(

// wrap with TransitionBesuControllerBuilder if we have a terminal total difficulty:
if (configOptions.getTerminalTotalDifficulty().isPresent()) {
Comment thread
gfukushima marked this conversation as resolved.
// TODO this should be changed to vanilla MergeBesuControllerBuilder and the Transition*
// series of classes removed after we successfully transition to PoS
// https://github.com/hyperledger/besu/issues/2897
return new TransitionBesuControllerBuilder(builder, new MergeBesuControllerBuilder())
.genesisConfigFile(genesisConfig);
// Enable start with vanilla MergeBesuControllerBuilder for PoS checkpoint block
if (isCheckpointSync(syncMode) && isCheckpointPoSBlock(configOptions)) {
return new MergeBesuControllerBuilder().genesisConfigFile(genesisConfig);
} else {
// TODO this should be changed to vanilla MergeBesuControllerBuilder and the Transition*
// series of classes removed after we successfully transition to PoS
// https://github.com/hyperledger/besu/issues/2897
return new TransitionBesuControllerBuilder(builder, new MergeBesuControllerBuilder())
.genesisConfigFile(genesisConfig);
}

} else return builder.genesisConfigFile(genesisConfig);
}

Expand Down Expand Up @@ -258,5 +271,19 @@ private Long readQbftStartBlockConfig(final QbftConfigOptions qbftConfigOptions)

return startBlock;
}

private boolean isCheckpointPoSBlock(final GenesisConfigOptions configOptions) {
UInt256 terminalTotalDifficulty = configOptions.getTerminalTotalDifficulty().get();
// this is currently a limitation that besu has in its codebase
if (UInt256.fromHexString(configOptions.getCheckpointOptions().getTotalDifficulty().get())
.equals(UInt256.ZERO)
&& terminalTotalDifficulty.equals(UInt256.ZERO)) {
throw new InvalidConfigurationException(
"Post Merge checkpoint sync can't be used with TTD = 0 and checkpoint totalDifficulty = 0");
}
return configOptions.getCheckpointOptions().isValid()
&& (UInt256.fromHexString(configOptions.getCheckpointOptions().getTotalDifficulty().get())
.greaterThan(terminalTotalDifficulty));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ protected MergeContext createConsensusContext(
.get()
.getTerminalTotalDifficulty()
.map(Difficulty::of)
.orElse(Difficulty.ZERO));
.orElse(Difficulty.ZERO))
.setIsNearHeadCheckpointSync(syncConfig.isCheckpointPostMergeEnabled());

blockchain
.getFinalized()
Expand Down Expand Up @@ -235,6 +236,13 @@ protected List<PeerValidator> createPeerValidators(final ProtocolSchedule protoc
return retval;
}

@Override
public BesuController build() {
BesuController controller = super.build();
PostMergeContext.get().setSyncState(controller.getSyncState());
return controller;
}

public TimestampSchedule createTimestampProtocolSchedule() {
return MergeProtocolSchedule.createTimestamp(
configOptionsSupplier.get(), privacyParameters, isRevertReasonEnabled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.ethereum.mainnet.HeaderValidationMode;
Expand Down Expand Up @@ -188,7 +189,7 @@ public void setUp() throws IOException {

besuController =
new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.development())
.fromGenesisConfig(GenesisConfigFile.development(), SyncMode.FULL)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down
3 changes: 2 additions & 1 deletion besu/src/test/java/org/hyperledger/besu/PrivacyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.ethereum.privacy.storage.PrivacyStorageProvider;
Expand Down Expand Up @@ -107,7 +108,7 @@ private BesuController setUpControllerWithPrivacyEnabled(final boolean flexibleE
.setFlexiblePrivacyGroupsEnabled(flexibleEnabled)
.build();
return new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.mainnet())
.fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.ethereum.mainnet.ProtocolSchedule;
Expand Down Expand Up @@ -83,7 +84,7 @@ private static Blockchain importBlocks(final BesuController controller, final Pa
private static BesuController createController() throws IOException {
final Path dataDir = folder.newFolder().toPath();
return new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.mainnet())
.fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.evm.internal.EvmConfiguration;
Expand Down Expand Up @@ -413,7 +414,7 @@ protected BesuController createController(final GenesisConfigFile genesisConfigF
throws IOException {
final Path dataDir = folder.newFolder().toPath();
return new BesuController.Builder()
.fromGenesisConfig(genesisConfigFile)
.fromGenesisConfig(genesisConfigFile, SyncMode.FAST)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.hyperledger.besu.ethereum.core.MiningParameters;
import org.hyperledger.besu.ethereum.core.PrivacyParameters;
import org.hyperledger.besu.ethereum.eth.EthProtocolConfiguration;
import org.hyperledger.besu.ethereum.eth.sync.SyncMode;
import org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration;
import org.hyperledger.besu.ethereum.eth.transactions.TransactionPoolConfiguration;
import org.hyperledger.besu.evm.internal.EvmConfiguration;
Expand Down Expand Up @@ -64,7 +65,7 @@ public void blockImport() throws IOException {
BlockTestUtil.write1000Blocks(source);
final BesuController targetController =
new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.mainnet())
.fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down Expand Up @@ -96,7 +97,7 @@ public void blockImportRejectsBadPow() throws IOException {
BlockTestUtil.writeBadPowBlocks(source);
final BesuController targetController =
new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.mainnet())
.fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down Expand Up @@ -125,7 +126,7 @@ public void blockImportCanSkipPow() throws IOException {
BlockTestUtil.writeBadPowBlocks(source);
final BesuController targetController =
new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.mainnet())
.fromGenesisConfig(GenesisConfigFile.mainnet(), SyncMode.FAST)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down Expand Up @@ -166,7 +167,7 @@ public void ibftImport() throws IOException {

final BesuController controller =
new BesuController.Builder()
.fromGenesisConfig(GenesisConfigFile.fromConfig(config))
.fromGenesisConfig(GenesisConfigFile.fromConfig(config), SyncMode.FULL)
.synchronizerConfiguration(SynchronizerConfiguration.builder().build())
.ethProtocolConfiguration(EthProtocolConfiguration.defaultConfig())
.storageProvider(new InMemoryKeyValueStorageProvider())
Expand Down
Loading