diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/verkle/worldview/VerkleWorldState.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/verkle/worldview/VerkleWorldState.java index 92d325811bf..6d9802fb044 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/verkle/worldview/VerkleWorldState.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/trie/diffbased/verkle/worldview/VerkleWorldState.java @@ -169,9 +169,7 @@ protected Hash internalCalculateRootHash( } preloadedHashers.put( - accountKey, - trieKeyPreloader.createPreloadedHasher( - accountKey, accountKeyIds, storageKeyIds, codeKeyIds)); + accountKey, trieKeyPreloader.createPreloadedHasher(storageKeyIds, codeKeyIds)); }); for (final Address accountKey : addressesToPersist) { diff --git a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/TrieKeyPreloader.java b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/TrieKeyPreloader.java index d7bf2e92acb..1974efec3c0 100644 --- a/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/TrieKeyPreloader.java +++ b/ethereum/verkletrie/src/main/java/org/hyperledger/besu/ethereum/verkletrie/TrieKeyPreloader.java @@ -14,7 +14,6 @@ */ package org.hyperledger.besu.ethereum.verkletrie; -import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.StorageSlotKey; import org.hyperledger.besu.ethereum.trie.verkle.adapter.TrieKeyBatchAdapter; import org.hyperledger.besu.ethereum.trie.verkle.hasher.CachedPedersenHasher; @@ -24,6 +23,7 @@ import java.util.List; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -60,13 +60,9 @@ public List generateStorageKeyIds(final Set storageSlot } public HasherContext createPreloadedHasher( - final Address address, - final List accountKeyIds, - final List storageKeyIds, - final List codeChunkIds) { + final List storageKeyIds, final List codeChunkIds) { return new HasherContext( - new CachedPedersenHasher( - trieKeyAdapter.manyTrieKeyHashes(address, accountKeyIds, storageKeyIds, codeChunkIds)), + new CachedPedersenHasher(10_000, new ConcurrentHashMap<>()), !storageKeyIds.isEmpty(), !codeChunkIds.isEmpty()); } diff --git a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/stateless/Eip4762AccessWitness.java b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/stateless/Eip4762AccessWitness.java index ee444c0947d..4fce60e3981 100644 --- a/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/stateless/Eip4762AccessWitness.java +++ b/evm/src/main/java/org/hyperledger/besu/evm/gascalculator/stateless/Eip4762AccessWitness.java @@ -256,8 +256,8 @@ private long touchAddressOnReadAndComputeGas( private List getStorageSlotTreeIndexes(final UInt256 storageKey) { return List.of( - TRIE_KEY_ADAPTER.locateStorageKeyOffset(storageKey), - TRIE_KEY_ADAPTER.locateStorageKeySuffix(storageKey)); + TRIE_KEY_ADAPTER.getStorageKeyTrieIndex(storageKey), + UInt256.fromBytes(TRIE_KEY_ADAPTER.getStorageKeySuffix(storageKey))); } @Override diff --git a/platform/build.gradle b/platform/build.gradle index f396eb2a061..244790c3604 100644 --- a/platform/build.gradle +++ b/platform/build.gradle @@ -183,7 +183,7 @@ dependencies { api 'org.hyperledger.besu:ipa-multipoint:0.8.4-SNAPSHOT' - api 'org.hyperledger.besu:besu-verkle-trie:0.0.3-20241002.133354-5' + api 'org.hyperledger.besu:besu-verkle-trie:0.0.3-20241107.124625-9' } }