mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: trie micro optimizations (#13282)
This commit is contained in:
@ -944,7 +944,7 @@ mod tests {
|
||||
use super::*;
|
||||
use crate::test_utils::TestBlockBuilder;
|
||||
use alloy_eips::eip7685::Requests;
|
||||
use alloy_primitives::{map::HashSet, BlockNumber, Bytes, StorageKey, StorageValue};
|
||||
use alloy_primitives::{map::B256HashMap, BlockNumber, Bytes, StorageKey, StorageValue};
|
||||
use rand::Rng;
|
||||
use reth_errors::ProviderResult;
|
||||
use reth_primitives::{Account, Bytecode, EthPrimitives, Receipt};
|
||||
@ -953,7 +953,8 @@ mod tests {
|
||||
StateRootProvider, StorageRootProvider,
|
||||
};
|
||||
use reth_trie::{
|
||||
AccountProof, HashedStorage, MultiProof, StorageMultiProof, StorageProof, TrieInput,
|
||||
AccountProof, HashedStorage, MultiProof, MultiProofTargets, StorageMultiProof,
|
||||
StorageProof, TrieInput,
|
||||
};
|
||||
|
||||
fn create_mock_state(
|
||||
@ -1094,7 +1095,7 @@ mod tests {
|
||||
fn multiproof(
|
||||
&self,
|
||||
_input: TrieInput,
|
||||
_targets: HashMap<B256, HashSet<B256>>,
|
||||
_targets: MultiProofTargets,
|
||||
) -> ProviderResult<MultiProof> {
|
||||
Ok(MultiProof::default())
|
||||
}
|
||||
@ -1103,7 +1104,7 @@ mod tests {
|
||||
&self,
|
||||
_input: TrieInput,
|
||||
_target: HashedPostState,
|
||||
) -> ProviderResult<HashMap<B256, Bytes>> {
|
||||
) -> ProviderResult<B256HashMap<Bytes>> {
|
||||
Ok(HashMap::default())
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
use super::ExecutedBlock;
|
||||
use alloy_consensus::BlockHeader;
|
||||
use alloy_primitives::{
|
||||
keccak256,
|
||||
map::{HashMap, HashSet},
|
||||
Address, BlockNumber, Bytes, StorageKey, StorageValue, B256,
|
||||
keccak256, map::B256HashMap, Address, BlockNumber, Bytes, StorageKey, StorageValue, B256,
|
||||
};
|
||||
use reth_errors::ProviderResult;
|
||||
use reth_primitives::{Account, Bytecode, NodePrimitives};
|
||||
@ -13,7 +11,7 @@ use reth_storage_api::{
|
||||
};
|
||||
use reth_trie::{
|
||||
updates::TrieUpdates, AccountProof, HashedPostState, HashedStorage, MultiProof,
|
||||
StorageMultiProof, TrieInput,
|
||||
MultiProofTargets, StorageMultiProof, TrieInput,
|
||||
};
|
||||
use revm::db::BundleState;
|
||||
use std::sync::OnceLock;
|
||||
@ -201,7 +199,7 @@ macro_rules! impl_state_provider {
|
||||
fn multiproof(
|
||||
&self,
|
||||
mut input: TrieInput,
|
||||
targets: HashMap<B256, HashSet<B256>>,
|
||||
targets: MultiProofTargets,
|
||||
) -> ProviderResult<MultiProof> {
|
||||
let MemoryOverlayTrieState { nodes, state } = self.trie_state().clone();
|
||||
input.prepend_cached(nodes, state);
|
||||
@ -212,7 +210,7 @@ macro_rules! impl_state_provider {
|
||||
&self,
|
||||
mut input: TrieInput,
|
||||
target: HashedPostState,
|
||||
) -> ProviderResult<HashMap<B256, Bytes>> {
|
||||
) -> ProviderResult<B256HashMap<Bytes>> {
|
||||
let MemoryOverlayTrieState { nodes, state } = self.trie_state().clone();
|
||||
input.prepend_cached(nodes, state);
|
||||
self.historical.witness(input, target)
|
||||
|
||||
Reference in New Issue
Block a user