Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9985e11
Add a block processing integration test to verify that sequential and…
ahamlat Jul 22, 2024
bfd1f77
Add two more tests.
ahamlat Jul 22, 2024
242d99f
Add slot storage and account tests. Also add the used smart contract …
ahamlat Jul 25, 2024
82fb891
spotless
ahamlat Jul 25, 2024
e48945d
Move the files to the right directories
ahamlat Jul 25, 2024
17e9557
Merge branch 'main' into add-integration-tests-on-block-processing
ahamlat Jul 25, 2024
433f9f6
spotless.
ahamlat Jul 25, 2024
d5bef06
Fix unit tests.
ahamlat Jul 25, 2024
952140d
Refactoring, extract class static fields
ahamlat Jul 26, 2024
b1b5704
Merge branch 'main' into add-integration-tests-on-block-processing
ahamlat Jul 29, 2024
6c66e8a
Add privateKey and comment fields to the genesis file
ahamlat Jul 29, 2024
c65bffe
Spotless.
ahamlat Jul 29, 2024
19f489a
Rename blockProcessor to sequentialBlockProcessor
ahamlat Jul 29, 2024
4c0c4eb
Merge branch 'main' into add-integration-tests-on-block-processing
ahamlat Jul 30, 2024
3a6b174
fix updatedAccount0x2 filed name
ahamlat Jul 30, 2024
a908c6d
Use ParameterizedTest with sequential and parallel processors
ahamlat Jul 30, 2024
ad1d3c9
Renaming few constants
ahamlat Jul 30, 2024
9c81ff5
Delete unused fields
ahamlat Jul 30, 2024
badad3f
Delete unused fields
ahamlat Jul 30, 2024
5a8638b
Merge branch 'main' into add-integration-tests-on-block-processing
ahamlat Jul 30, 2024
df51885
Merge branch 'main' into add-integration-tests-on-block-processing
ahamlat Jul 31, 2024
5443137
Merge branch 'main' into add-integration-tests-on-block-processing
ahamlat Aug 1, 2024
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 @@ -14,6 +14,7 @@
*/
package org.hyperledger.besu.ethereum.core;

import static org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createBonsaiInMemoryWorldStateArchive;
import static org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createInMemoryWorldStateArchive;

import org.hyperledger.besu.config.GenesisConfigFile;
Expand All @@ -31,10 +32,12 @@
import org.hyperledger.besu.ethereum.worldstate.WorldStateArchive;
import org.hyperledger.besu.evm.internal.EvmConfiguration;
import org.hyperledger.besu.metrics.noop.NoOpMetricsSystem;
import org.hyperledger.besu.plugin.services.storage.DataStorageFormat;
import org.hyperledger.besu.plugin.services.storage.KeyValueStorage;
import org.hyperledger.besu.services.kvstore.InMemoryKeyValueStorage;

import java.math.BigInteger;
import java.util.Optional;
import java.util.function.Function;

public class ExecutionContextTestFixture {
Expand All @@ -52,7 +55,8 @@ private ExecutionContextTestFixture(
final GenesisConfigFile genesisConfigFile,
final ProtocolSchedule protocolSchedule,
final KeyValueStorage blockchainKeyValueStorage,
final KeyValueStorage variablesKeyValueStorage) {
final KeyValueStorage variablesKeyValueStorage,
final Optional<DataStorageFormat> dataStorageFormat) {
final GenesisState genesisState = GenesisState.fromConfig(genesisConfigFile, protocolSchedule);
this.genesis = genesisState.getBlock();
this.blockchainKeyValueStorage = blockchainKeyValueStorage;
Expand All @@ -67,7 +71,9 @@ private ExecutionContextTestFixture(
false),
new NoOpMetricsSystem(),
0);
this.stateArchive = createInMemoryWorldStateArchive();
if (dataStorageFormat.isPresent() && dataStorageFormat.get().equals(DataStorageFormat.BONSAI))
this.stateArchive = createBonsaiInMemoryWorldStateArchive(blockchain);
else this.stateArchive = createInMemoryWorldStateArchive();
this.protocolSchedule = protocolSchedule;
this.protocolContext =
new ProtocolContext(blockchain, stateArchive, null, new BadBlockManager());
Expand Down Expand Up @@ -115,6 +121,7 @@ public static class Builder {
private KeyValueStorage variablesKeyValueStorage;
private KeyValueStorage blockchainKeyValueStorage;
private ProtocolSchedule protocolSchedule;
private Optional<DataStorageFormat> dataStorageFormat = Optional.empty();

public Builder(final GenesisConfigFile genesisConfigFile) {
this.genesisConfigFile = genesisConfigFile;
Expand All @@ -135,6 +142,11 @@ public Builder protocolSchedule(final ProtocolSchedule protocolSchedule) {
return this;
}

public Builder dataStorageFormat(final DataStorageFormat dataStorageFormat) {
this.dataStorageFormat = Optional.of(dataStorageFormat);
return this;
}

public ExecutionContextTestFixture build() {
if (protocolSchedule == null) {
protocolSchedule =
Expand All @@ -157,8 +169,13 @@ public ExecutionContextTestFixture build() {
if (variablesKeyValueStorage == null) {
variablesKeyValueStorage = new InMemoryKeyValueStorage();
}

return new ExecutionContextTestFixture(
genesisConfigFile, protocolSchedule, variablesKeyValueStorage, blockchainKeyValueStorage);
genesisConfigFile,
protocolSchedule,
variablesKeyValueStorage,
blockchainKeyValueStorage,
dataStorageFormat);
}
}
}
Loading