Skip to content

Commit

Permalink
[REMOVE AFTER #7778] include new version of verkle-trie impl
Browse files Browse the repository at this point in the history
Signed-off-by: Luis Pinto <[email protected]>
  • Loading branch information
lu-pinto committed Dec 10, 2024
1 parent 836137a commit 16b15db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -60,13 +60,9 @@ public List<Bytes32> generateStorageKeyIds(final Set<StorageSlotKey> storageSlot
}

public HasherContext createPreloadedHasher(
final Address address,
final List<Bytes32> accountKeyIds,
final List<Bytes32> storageKeyIds,
final List<Bytes32> codeChunkIds) {
final List<Bytes32> storageKeyIds, final List<Bytes32> codeChunkIds) {
return new HasherContext(
new CachedPedersenHasher(
trieKeyAdapter.manyTrieKeyHashes(address, accountKeyIds, storageKeyIds, codeChunkIds)),
new CachedPedersenHasher(10_000, new ConcurrentHashMap<>()),
!storageKeyIds.isEmpty(),
!codeChunkIds.isEmpty());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ private long touchAddressOnReadAndComputeGas(

private List<UInt256> 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
Expand Down
2 changes: 1 addition & 1 deletion platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
}

Expand Down

0 comments on commit 16b15db

Please sign in to comment.