Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix encode trie value for account state
Browse files Browse the repository at this point in the history
Signed-off-by: garyschulte <garyschulte@gmail.com>
garyschulte committed Dec 5, 2024
1 parent a109b18 commit 255f08f
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
import static org.hyperledger.besu.ethereum.storage.keyvalue.KeyValueSegmentIdentifier.TRIE_BRANCH_STORAGE;
import static org.hyperledger.besu.ethereum.trie.diffbased.common.storage.DiffBasedWorldStateKeyValueStorage.WORLD_BLOCK_HASH_KEY;
import static org.hyperledger.besu.ethereum.trie.diffbased.common.storage.DiffBasedWorldStateKeyValueStorage.WORLD_ROOT_HASH_KEY;
import static org.hyperledger.besu.ethereum.trie.diffbased.common.worldview.DiffBasedWorldView.encodeTrieValue;

import org.hyperledger.besu.cli.util.VersionProvider;
import org.hyperledger.besu.controller.BesuController;
@@ -236,7 +237,7 @@ Hash rebuildAccountTrie(
long accountStorageCount = 0L;
while (accountStorageIterator.hasNext()) {
var storagePair = accountStorageIterator.next();
accountStorageTrie.put(storagePair.getFirst(), storagePair.getSecond());
accountStorageTrie.put(storagePair.getFirst(), encodeTrieValue(storagePair.getSecond()));

// commit the account storage trie
if (accountStorageCount++ % FORCED_COMMIT_INTERVAL == 0) {
Original file line number Diff line number Diff line change
@@ -55,8 +55,8 @@ void setupBonsaiBlockchain() {
blockchainSetupUtil =
BlockchainSetupUtil.createForEthashChain(
// Mainnet is a more robust test resource, but it takes upwards of 1 minute to generate
BlockTestUtil.getMainnetResources(),
// BlockTestUtil.getSnapTestChainResources(), /* snap only has a
//BlockTestUtil.getMainnetResources(),
BlockTestUtil.getSnapTestChainResources(),
DataStorageFormat.BONSAI);
blockchainSetupUtil.importAllBlocks(HeaderValidationMode.NONE, HeaderValidationMode.NONE);
}

0 comments on commit 255f08f

Please sign in to comment.