Search in sources :

Example 1 with StoredMerklePatriciaTrie

use of org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie in project besu by hyperledger.

the class StateBackupService method visitAccount.

private TrieIterator.State visitAccount(final Bytes32 nodeKey, final Node<Bytes> node) {
    if (node.getValue().isEmpty()) {
        return State.CONTINUE;
    }
    backupStatus.currentAccount = nodeKey;
    final Bytes nodeValue = node.getValue().orElse(Hash.EMPTY);
    final StateTrieAccountValue account = StateTrieAccountValue.readFrom(new BytesValueRLPInput(nodeValue, false));
    final Bytes code = worldStateStorage.getCode(account.getCodeHash(), null).orElse(Bytes.EMPTY);
    backupStatus.codeSize.addAndGet(code.size());
    final BytesValueRLPOutput accountOutput = new BytesValueRLPOutput();
    accountOutput.startList();
    // trie hash
    accountOutput.writeBytes(nodeKey);
    // account rlp
    accountOutput.writeBytes(nodeValue);
    // code
    accountOutput.writeBytes(code);
    accountOutput.endList();
    try {
        accountFileWriter.writeBytes(accountOutput.encoded().toArrayUnsafe());
    } catch (final IOException ioe) {
        LOG.error("Failure writing backup", ioe);
        return State.STOP;
    }
    // storage is written for each leaf, otherwise the whole trie would have to fit in memory
    final StoredMerklePatriciaTrie<Bytes32, Bytes> storageTrie = new StoredMerklePatriciaTrie<>(worldStateStorage::getAccountStateTrieNode, account.getStorageRoot(), Function.identity(), Function.identity());
    storageTrie.visitLeafs((storageKey, storageValue) -> visitAccountStorage(storageKey, storageValue, accountFileWriter));
    try {
        accountFileWriter.writeBytes(ACCOUNT_END_MARKER.toArrayUnsafe());
    } catch (final IOException ioe) {
        LOG.error("Failure writing backup", ioe);
        return State.STOP;
    }
    backupStatus.accountCount.incrementAndGet();
    return State.CONTINUE;
}
Also used : Bytes(org.apache.tuweni.bytes.Bytes) StoredMerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie) StateTrieAccountValue(org.hyperledger.besu.ethereum.worldstate.StateTrieAccountValue) IOException(java.io.IOException) BytesValueRLPInput(org.hyperledger.besu.ethereum.rlp.BytesValueRLPInput) BytesValueRLPOutput(org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput) Bytes32(org.apache.tuweni.bytes.Bytes32)

Example 2 with StoredMerklePatriciaTrie

use of org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie in project besu by hyperledger.

the class FastWorldStateDownloaderTest method doesNotRequestKnownStorageTrieNodesFromNetwork.

@Test
public void doesNotRequestKnownStorageTrieNodesFromNetwork() {
    // Setup "remote" state
    final WorldStateStorage remoteStorage = new WorldStateKeyValueStorage(new InMemoryKeyValueStorage());
    final WorldStateArchive remoteWorldStateArchive = new DefaultWorldStateArchive(remoteStorage, createPreimageStorage());
    final MutableWorldState remoteWorldState = remoteWorldStateArchive.getMutable();
    // Generate accounts and save corresponding state root
    final List<Account> accounts = dataGen.createRandomContractAccountsWithNonEmptyStorage(remoteWorldState, 20);
    final Hash stateRoot = remoteWorldState.rootHash();
    final BlockHeader header = dataGen.block(BlockOptions.create().setStateRoot(stateRoot).setBlockNumber(10)).getHeader();
    // Create some peers
    final List<RespondingEthPeer> peers = Stream.generate(() -> EthProtocolManagerTestUtil.createPeer(ethProtocolManager, header.getNumber())).limit(5).collect(Collectors.toList());
    final InMemoryTasksPriorityQueues<NodeDataRequest> taskCollection = new InMemoryTasksPriorityQueues<>();
    final WorldStateStorage localStorage = new WorldStateKeyValueStorage(new InMemoryKeyValueStorage());
    // Seed local storage with some trie node values
    final List<Bytes32> storageRootHashes = new StoredMerklePatriciaTrie<>(remoteStorage::getNodeData, remoteWorldState.rootHash(), Function.identity(), Function.identity()).entriesFrom(Bytes32.ZERO, 5).values().stream().map(RLP::input).map(StateTrieAccountValue::readFrom).map(StateTrieAccountValue::getStorageRoot).collect(Collectors.toList());
    final Map<Bytes32, Bytes> allTrieNodes = new HashMap<>();
    final Set<Bytes32> knownNodes = new HashSet<>();
    final Set<Bytes32> unknownNodes = new HashSet<>();
    for (final Bytes32 storageRootHash : storageRootHashes) {
        allTrieNodes.putAll(collectTrieNodesToBeRequestedAfterRoot(remoteStorage, storageRootHash, 5));
    }
    // Sanity check
    assertThat(allTrieNodes.size()).isGreaterThan(0);
    final Updater localStorageUpdater = localStorage.updater();
    boolean storeNode = true;
    for (final Map.Entry<Bytes32, Bytes> entry : allTrieNodes.entrySet()) {
        final Bytes32 hash = entry.getKey();
        final Bytes data = entry.getValue();
        if (storeNode) {
            localStorageUpdater.putAccountStorageTrieNode(null, null, hash, data);
            knownNodes.add(hash);
        } else {
            unknownNodes.add(hash);
        }
        storeNode = !storeNode;
    }
    localStorageUpdater.commit();
    final WorldStateDownloader downloader = createDownloader(ethProtocolManager.ethContext(), localStorage, taskCollection);
    final FastSyncState fastSyncState = new FastSyncState(header);
    final CompletableFuture<Void> result = downloader.run(null, fastSyncState);
    // Respond to node data requests
    final List<MessageData> sentMessages = new ArrayList<>();
    final RespondingEthPeer.Responder blockChainResponder = RespondingEthPeer.blockchainResponder(mock(Blockchain.class), remoteWorldStateArchive, mock(TransactionPool.class));
    final RespondingEthPeer.Responder responder = RespondingEthPeer.wrapResponderWithCollector(blockChainResponder, sentMessages);
    respondUntilDone(peers, responder, result);
    // World state should be available by the time the result is complete
    assertThat(localStorage.isWorldStateAvailable(stateRoot, header.getHash())).isTrue();
    // Check that unknown trie nodes were requested
    final List<Bytes32> requestedHashes = sentMessages.stream().filter(m -> m.getCode() == EthPV63.GET_NODE_DATA).map(GetNodeDataMessage::readFrom).flatMap(m -> StreamSupport.stream(m.hashes().spliterator(), true)).collect(Collectors.toList());
    assertThat(requestedHashes.size()).isGreaterThan(0);
    assertThat(requestedHashes).containsAll(unknownNodes);
    assertThat(requestedHashes).doesNotContainAnyElementsOf(knownNodes);
    // Check that all expected account data was downloaded
    final WorldStateArchive localWorldStateArchive = new DefaultWorldStateArchive(localStorage, createPreimageStorage());
    final WorldState localWorldState = localWorldStateArchive.get(stateRoot, null).get();
    assertThat(result).isDone();
    assertAccountsMatch(localWorldState, accounts);
}
Also used : BlockOptions(org.hyperledger.besu.ethereum.core.BlockDataGenerator.BlockOptions) WorldStateKeyValueStorage(org.hyperledger.besu.ethereum.storage.keyvalue.WorldStateKeyValueStorage) Node(org.hyperledger.besu.ethereum.trie.Node) Account(org.hyperledger.besu.evm.account.Account) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) EthProtocolManagerTestUtil(org.hyperledger.besu.ethereum.eth.manager.EthProtocolManagerTestUtil) InMemoryKeyValueStorageProvider.createInMemoryWorldStateArchive(org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createInMemoryWorldStateArchive) BlockDataGenerator(org.hyperledger.besu.ethereum.core.BlockDataGenerator) EthScheduler(org.hyperledger.besu.ethereum.eth.manager.EthScheduler) StalledDownloadException(org.hyperledger.besu.ethereum.eth.sync.worldstate.StalledDownloadException) Map(java.util.Map) After(org.junit.After) WorldStateStorage(org.hyperledger.besu.ethereum.worldstate.WorldStateStorage) Bytes32(org.apache.tuweni.bytes.Bytes32) GetNodeDataMessage(org.hyperledger.besu.ethereum.eth.messages.GetNodeDataMessage) InMemoryTasksPriorityQueues(org.hyperledger.besu.services.tasks.InMemoryTasksPriorityQueues) MockExecutorService(org.hyperledger.besu.testutil.MockExecutorService) Blockchain(org.hyperledger.besu.ethereum.chain.Blockchain) Set(java.util.Set) Collectors(java.util.stream.Collectors) RespondingEthPeer(org.hyperledger.besu.ethereum.eth.manager.RespondingEthPeer) Executors(java.util.concurrent.Executors) Objects(java.util.Objects) LockSupport(java.util.concurrent.locks.LockSupport) EthProtocolManager(org.hyperledger.besu.ethereum.eth.manager.EthProtocolManager) WorldStateDownloader(org.hyperledger.besu.ethereum.eth.sync.worldstate.WorldStateDownloader) List(java.util.List) Stream(java.util.stream.Stream) ProtocolScheduleFixture(org.hyperledger.besu.ethereum.core.ProtocolScheduleFixture) InMemoryKeyValueStorage(org.hyperledger.besu.services.kvstore.InMemoryKeyValueStorage) Optional(java.util.Optional) DefaultWorldStateArchive(org.hyperledger.besu.ethereum.worldstate.DefaultWorldStateArchive) Mockito.mock(org.mockito.Mockito.mock) Hash(org.hyperledger.besu.datatypes.Hash) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ThreadFactoryBuilder(com.google.common.util.concurrent.ThreadFactoryBuilder) StoredMerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie) FastSyncState(org.hyperledger.besu.ethereum.eth.sync.fastsync.FastSyncState) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) NoOpMetricsSystem(org.hyperledger.besu.metrics.noop.NoOpMetricsSystem) Bytes(org.apache.tuweni.bytes.Bytes) Mockito.spy(org.mockito.Mockito.spy) SynchronizerConfiguration(org.hyperledger.besu.ethereum.eth.sync.SynchronizerConfiguration) Function(java.util.function.Function) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) TrieNodeDecoder(org.hyperledger.besu.ethereum.trie.TrieNodeDecoder) Assertions.assertThatThrownBy(org.assertj.core.api.Assertions.assertThatThrownBy) WorldStateArchive(org.hyperledger.besu.ethereum.worldstate.WorldStateArchive) Timeout(org.junit.rules.Timeout) WorldStatePreimageKeyValueStorage(org.hyperledger.besu.ethereum.storage.keyvalue.WorldStatePreimageKeyValueStorage) StreamSupport(java.util.stream.StreamSupport) ExecutorService(java.util.concurrent.ExecutorService) WorldState(org.hyperledger.besu.evm.worldstate.WorldState) TransactionPool(org.hyperledger.besu.ethereum.eth.transactions.TransactionPool) AccountStorageEntry(org.hyperledger.besu.evm.account.AccountStorageEntry) BlockHeader(org.hyperledger.besu.ethereum.core.BlockHeader) EthContext(org.hyperledger.besu.ethereum.eth.manager.EthContext) Mockito.times(org.mockito.Mockito.times) MutableWorldState(org.hyperledger.besu.ethereum.core.MutableWorldState) RLP(org.hyperledger.besu.ethereum.rlp.RLP) Test(org.junit.Test) WorldStatePreimageStorage(org.hyperledger.besu.ethereum.worldstate.WorldStatePreimageStorage) MerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.MerklePatriciaTrie) BlockHeaderTestFixture(org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Mockito.never(org.mockito.Mockito.never) Rule(org.junit.Rule) MessageData(org.hyperledger.besu.ethereum.p2p.rlpx.wire.MessageData) StateTrieAccountValue(org.hyperledger.besu.ethereum.worldstate.StateTrieAccountValue) Ignore(org.junit.Ignore) DeterministicEthScheduler(org.hyperledger.besu.ethereum.eth.manager.DeterministicEthScheduler) EthPV63(org.hyperledger.besu.ethereum.eth.messages.EthPV63) Updater(org.hyperledger.besu.ethereum.worldstate.WorldStateStorage.Updater) Mockito.reset(org.mockito.Mockito.reset) Collections(java.util.Collections) TestClock(org.hyperledger.besu.testutil.TestClock) WorldStateStorage(org.hyperledger.besu.ethereum.worldstate.WorldStateStorage) Account(org.hyperledger.besu.evm.account.Account) MutableWorldState(org.hyperledger.besu.ethereum.core.MutableWorldState) HashMap(java.util.HashMap) RespondingEthPeer(org.hyperledger.besu.ethereum.eth.manager.RespondingEthPeer) Blockchain(org.hyperledger.besu.ethereum.chain.Blockchain) ArrayList(java.util.ArrayList) WorldState(org.hyperledger.besu.evm.worldstate.WorldState) MutableWorldState(org.hyperledger.besu.ethereum.core.MutableWorldState) Hash(org.hyperledger.besu.datatypes.Hash) Bytes32(org.apache.tuweni.bytes.Bytes32) WorldStateDownloader(org.hyperledger.besu.ethereum.eth.sync.worldstate.WorldStateDownloader) Bytes(org.apache.tuweni.bytes.Bytes) WorldStateKeyValueStorage(org.hyperledger.besu.ethereum.storage.keyvalue.WorldStateKeyValueStorage) Updater(org.hyperledger.besu.ethereum.worldstate.WorldStateStorage.Updater) BlockHeader(org.hyperledger.besu.ethereum.core.BlockHeader) HashSet(java.util.HashSet) TransactionPool(org.hyperledger.besu.ethereum.eth.transactions.TransactionPool) GetNodeDataMessage(org.hyperledger.besu.ethereum.eth.messages.GetNodeDataMessage) DefaultWorldStateArchive(org.hyperledger.besu.ethereum.worldstate.DefaultWorldStateArchive) InMemoryKeyValueStorage(org.hyperledger.besu.services.kvstore.InMemoryKeyValueStorage) MessageData(org.hyperledger.besu.ethereum.p2p.rlpx.wire.MessageData) StateTrieAccountValue(org.hyperledger.besu.ethereum.worldstate.StateTrieAccountValue) InMemoryTasksPriorityQueues(org.hyperledger.besu.services.tasks.InMemoryTasksPriorityQueues) FastSyncState(org.hyperledger.besu.ethereum.eth.sync.fastsync.FastSyncState) InMemoryKeyValueStorageProvider.createInMemoryWorldStateArchive(org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createInMemoryWorldStateArchive) DefaultWorldStateArchive(org.hyperledger.besu.ethereum.worldstate.DefaultWorldStateArchive) WorldStateArchive(org.hyperledger.besu.ethereum.worldstate.WorldStateArchive) Map(java.util.Map) HashMap(java.util.HashMap) Test(org.junit.Test)

Example 3 with StoredMerklePatriciaTrie

use of org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie in project besu by hyperledger.

the class PersistDataStepTest method assertDataPersisted.

private void assertDataPersisted(final List<Task<SnapDataRequest>> tasks) {
    tasks.forEach(task -> {
        if (task.getData() instanceof AccountRangeDataRequest) {
            final AccountRangeDataRequest data = (AccountRangeDataRequest) task.getData();
            StoredMerklePatriciaTrie<Bytes, Bytes> trie = new StoredMerklePatriciaTrie<>(worldStateStorage::getAccountStateTrieNode, data.getRootHash(), b -> b, b -> b);
            data.getAccounts().forEach((key, value) -> assertThat(trie.get(key)).isPresent());
        } else if (task.getData() instanceof StorageRangeDataRequest) {
            final StorageRangeDataRequest data = (StorageRangeDataRequest) task.getData();
            final StoredMerklePatriciaTrie<Bytes, Bytes> trie = new StoredMerklePatriciaTrie<>((location, hash) -> worldStateStorage.getAccountStorageTrieNode(Hash.wrap(data.getAccountHash()), location, hash), data.getStorageRoot(), b -> b, b -> b);
            data.getSlots().forEach((key, value) -> assertThat(trie.get(key)).isPresent());
        } else if (task.getData() instanceof BytecodeRequest) {
            final BytecodeRequest data = (BytecodeRequest) task.getData();
            assertThat(worldStateStorage.getCode(data.getCodeHash(), Hash.wrap(data.getAccountHash()))).isPresent();
        } else {
            fail("not expected message");
        }
    });
}
Also used : StoredMerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie) InMemoryKeyValueStorageProvider(org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) Bytes(org.apache.tuweni.bytes.Bytes) BytecodeRequest(org.hyperledger.besu.ethereum.eth.sync.snapsync.request.BytecodeRequest) SnapDataRequest(org.hyperledger.besu.ethereum.eth.sync.snapsync.request.SnapDataRequest) List(java.util.List) Assertions.fail(org.assertj.core.api.Assertions.fail) DataStorageFormat(org.hyperledger.besu.ethereum.worldstate.DataStorageFormat) AccountRangeDataRequest(org.hyperledger.besu.ethereum.eth.sync.snapsync.request.AccountRangeDataRequest) StorageRangeDataRequest(org.hyperledger.besu.ethereum.eth.sync.snapsync.request.StorageRangeDataRequest) WorldStateStorage(org.hyperledger.besu.ethereum.worldstate.WorldStateStorage) Task(org.hyperledger.besu.services.tasks.Task) Mockito.mock(org.mockito.Mockito.mock) Hash(org.hyperledger.besu.datatypes.Hash) Before(org.junit.Before) Bytes(org.apache.tuweni.bytes.Bytes) StoredMerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie) BytecodeRequest(org.hyperledger.besu.ethereum.eth.sync.snapsync.request.BytecodeRequest) AccountRangeDataRequest(org.hyperledger.besu.ethereum.eth.sync.snapsync.request.AccountRangeDataRequest) StorageRangeDataRequest(org.hyperledger.besu.ethereum.eth.sync.snapsync.request.StorageRangeDataRequest)

Example 4 with StoredMerklePatriciaTrie

use of org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie in project besu by hyperledger.

the class StackTrie method commit.

public void commit(final NodeUpdater nodeUpdater) {
    if (nbSegments.decrementAndGet() <= 0 && !elements.isEmpty()) {
        final List<Bytes> proofs = new ArrayList<>();
        final TreeMap<Bytes32, Bytes> keys = new TreeMap<>();
        elements.values().forEach(taskElement -> {
            proofs.addAll(taskElement.proofs());
            keys.putAll(taskElement.keys());
        });
        final Map<Bytes32, Bytes> proofsEntries = new HashMap<>();
        for (Bytes proof : proofs) {
            proofsEntries.put(Hash.hash(proof), proof);
        }
        final InnerNodeDiscoveryManager<Bytes> snapStoredNodeFactory = new InnerNodeDiscoveryManager<>((location, hash) -> Optional.ofNullable(proofsEntries.get(hash)), Function.identity(), Function.identity(), startKeyHash, keys.lastKey(), true);
        final MerklePatriciaTrie<Bytes, Bytes> trie = new StoredMerklePatriciaTrie<>(snapStoredNodeFactory, proofs.isEmpty() ? MerklePatriciaTrie.EMPTY_TRIE_NODE_HASH : rootHash);
        for (Map.Entry<Bytes32, Bytes> account : keys.entrySet()) {
            trie.put(account.getKey(), new SnapPutVisitor<>(snapStoredNodeFactory, account.getValue()));
        }
        trie.commit(nodeUpdater, (new CommitVisitor<>(nodeUpdater) {

            @Override
            public void maybeStoreNode(final Bytes location, final Node<Bytes> node) {
                if (!node.isHealNeeded()) {
                    super.maybeStoreNode(location, node);
                }
            }
        }));
    }
}
Also used : StoredMerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) InnerNodeDiscoveryManager(org.hyperledger.besu.ethereum.trie.InnerNodeDiscoveryManager) Node(org.hyperledger.besu.ethereum.trie.Node) ArrayList(java.util.ArrayList) TreeMap(java.util.TreeMap) CommitVisitor(org.hyperledger.besu.ethereum.trie.CommitVisitor) Bytes32(org.apache.tuweni.bytes.Bytes32) Bytes(org.apache.tuweni.bytes.Bytes) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) TreeMap(java.util.TreeMap) Map(java.util.Map)

Example 5 with StoredMerklePatriciaTrie

use of org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie in project besu by hyperledger.

the class RangeManager method findNewBeginElementInRange.

/**
 * Helps to create a new range according to the last data obtained. This happens when a peer
 * doesn't return all of the data in a range.
 *
 * @param worldstateRootHash the root hash
 * @param proofs proof received
 * @param endKeyHash the end of the range initially wanted
 * @param receivedKeys the last key received
 * @return begin of the new range
 */
public static Optional<Bytes32> findNewBeginElementInRange(final Bytes32 worldstateRootHash, final List<Bytes> proofs, final TreeMap<Bytes32, Bytes> receivedKeys, final Bytes32 endKeyHash) {
    if (receivedKeys.isEmpty() || receivedKeys.lastKey().compareTo(endKeyHash) >= 0) {
        return Optional.empty();
    } else {
        final Map<Bytes32, Bytes> proofsEntries = new HashMap<>();
        for (Bytes proof : proofs) {
            proofsEntries.put(Hash.hash(proof), proof);
        }
        final StoredMerklePatriciaTrie<Bytes, Bytes> storageTrie = new StoredMerklePatriciaTrie<>(new InnerNodeDiscoveryManager<>((location, key) -> Optional.ofNullable(proofsEntries.get(key)), Function.identity(), Function.identity(), receivedKeys.lastKey(), endKeyHash, false), worldstateRootHash);
        try {
            storageTrie.visitAll(bytesNode -> {
            });
        } catch (MerkleTrieException e) {
            return Optional.of(InnerNodeDiscoveryManager.decodePath(e.getLocation()));
        }
        return Optional.empty();
    }
}
Also used : StoredMerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie) InnerNodeDiscoveryManager(org.hyperledger.besu.ethereum.trie.InnerNodeDiscoveryManager) HashMap(java.util.HashMap) Bytes(org.apache.tuweni.bytes.Bytes) Function(java.util.function.Function) List(java.util.List) MerkleTrieException(org.hyperledger.besu.ethereum.trie.MerkleTrieException) TreeMap(java.util.TreeMap) Map(java.util.Map) Optional(java.util.Optional) BigInteger(java.math.BigInteger) Bytes32(org.apache.tuweni.bytes.Bytes32) Hash(org.hyperledger.besu.datatypes.Hash) Bytes(org.apache.tuweni.bytes.Bytes) StoredMerklePatriciaTrie(org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie) HashMap(java.util.HashMap) MerkleTrieException(org.hyperledger.besu.ethereum.trie.MerkleTrieException) Bytes32(org.apache.tuweni.bytes.Bytes32)

Aggregations

Bytes (org.apache.tuweni.bytes.Bytes)12 StoredMerklePatriciaTrie (org.hyperledger.besu.ethereum.trie.StoredMerklePatriciaTrie)12 Bytes32 (org.apache.tuweni.bytes.Bytes32)11 Hash (org.hyperledger.besu.datatypes.Hash)8 StateTrieAccountValue (org.hyperledger.besu.ethereum.worldstate.StateTrieAccountValue)6 WorldStateStorage (org.hyperledger.besu.ethereum.worldstate.WorldStateStorage)6 List (java.util.List)5 Map (java.util.Map)5 Optional (java.util.Optional)5 TreeMap (java.util.TreeMap)5 Function (java.util.function.Function)5 HashMap (java.util.HashMap)4 RLP (org.hyperledger.besu.ethereum.rlp.RLP)4 MerklePatriciaTrie (org.hyperledger.besu.ethereum.trie.MerklePatriciaTrie)4 ArrayList (java.util.ArrayList)3 UInt256 (org.apache.tuweni.units.bigints.UInt256)3 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)3 Address (org.hyperledger.besu.datatypes.Address)3 Stream (java.util.stream.Stream)2 WORLD_ROOT_HASH_KEY (org.hyperledger.besu.ethereum.bonsai.BonsaiWorldStateKeyValueStorage.WORLD_ROOT_HASH_KEY)2