diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java index 4cd47521e92..bcab8bbfd82 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/DataStorageConfiguration.java @@ -40,6 +40,13 @@ public interface DataStorageConfiguration { .bonsaiMaxLayersToLoad(DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD) .build(); + DataStorageConfiguration DEFAULT_BONSAI_PARTIAL_DB_CONFIG = + ImmutableDataStorageConfiguration.builder() + .dataStorageFormat(DataStorageFormat.BONSAI) + .bonsaiMaxLayersToLoad(DEFAULT_BONSAI_MAX_LAYERS_TO_LOAD) + .unstable(Unstable.DEFAULT_PARTIAL) + .build(); + DataStorageConfiguration DEFAULT_FOREST_CONFIG = ImmutableDataStorageConfiguration.builder() .dataStorageFormat(DataStorageFormat.FOREST) @@ -73,6 +80,9 @@ interface Unstable { DataStorageConfiguration.Unstable DEFAULT = ImmutableDataStorageConfiguration.Unstable.builder().build(); + DataStorageConfiguration.Unstable DEFAULT_PARTIAL = + ImmutableDataStorageConfiguration.Unstable.builder().bonsaiFullFlatDbEnabled(false).build(); + @Value.Default default boolean getBonsaiLimitTrieLogsEnabled() { return DEFAULT_BONSAI_LIMIT_TRIE_LOGS_ENABLED; diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java index e3abbe6f0b7..c056fcb5050 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/AbstractIsolationTests.java @@ -153,8 +153,9 @@ public abstract class AbstractIsolationTests { @BeforeEach public void createStorage() { worldStateKeyValueStorage = + // TODO: this is a temporary fix for BonsaiSnapShotIsolationTests assertions createKeyValueStorageProvider() - .createWorldStateStorage(DataStorageConfiguration.DEFAULT_BONSAI_CONFIG); + .createWorldStateStorage(DataStorageConfiguration.DEFAULT_BONSAI_PARTIAL_DB_CONFIG); archive = new BonsaiWorldStateProvider( (BonsaiWorldStateKeyValueStorage) worldStateKeyValueStorage, diff --git a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java index c786a609ce6..585f6d4d953 100644 --- a/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java +++ b/ethereum/core/src/test/java/org/hyperledger/besu/ethereum/trie/diffbased/bonsai/BonsaiSnapshotIsolationTests.java @@ -152,6 +152,8 @@ public void assertCloseDisposesOfStateWithoutCommitting() { assertThat(res.isSuccessful()).isTrue(); shouldCloseSnapshot.persist(oneTx.getHeader()); + // TODO: full flat strategy will not be updated with these values, only the trie + // determine how we want to make this assertion for full flat assertThat(shouldCloseSnapshot.get(testAddress)).isNotNull(); assertThat(shouldCloseSnapshot.get(testAddress).getBalance()) .isEqualTo(Wei.of(1_000_000_000_000_000_000L));