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:
@ -253,7 +253,7 @@ mod tests {
|
||||
fn test_rpc_gas_cap() {
|
||||
let args = CommandParser::<RpcServerArgs>::parse_from(["reth"]).args;
|
||||
let config = args.eth_config();
|
||||
assert_eq!(config.rpc_gas_cap, Into::<u64>::into(RPC_DEFAULT_GAS_CAP));
|
||||
assert_eq!(config.rpc_gas_cap, u64::from(RPC_DEFAULT_GAS_CAP));
|
||||
|
||||
let args =
|
||||
CommandParser::<RpcServerArgs>::parse_from(["reth", "--rpc.gascap", "1000"]).args;
|
||||
|
||||
11
crates/rpc/rpc-eth-types/src/cache/db.rs
vendored
11
crates/rpc/rpc-eth-types/src/cache/db.rs
vendored
@ -2,14 +2,11 @@
|
||||
//! <https://github.com/rust-lang/rust/issues/100013> in default implementation of
|
||||
//! `reth_rpc_eth_api::helpers::Call`.
|
||||
|
||||
use alloy_primitives::{
|
||||
map::{HashMap, HashSet},
|
||||
Address, B256, U256,
|
||||
};
|
||||
use alloy_primitives::{Address, B256, U256};
|
||||
use reth_errors::ProviderResult;
|
||||
use reth_revm::{database::StateProviderDatabase, db::CacheDB, DatabaseRef};
|
||||
use reth_storage_api::{HashedPostStateProvider, StateProvider};
|
||||
use reth_trie::HashedStorage;
|
||||
use reth_trie::{HashedStorage, MultiProofTargets};
|
||||
use revm::Database;
|
||||
|
||||
/// Helper alias type for the state's [`CacheDB`]
|
||||
@ -91,7 +88,7 @@ impl reth_storage_api::StateProofProvider for StateProviderTraitObjWrapper<'_> {
|
||||
fn multiproof(
|
||||
&self,
|
||||
input: reth_trie::TrieInput,
|
||||
targets: HashMap<B256, HashSet<B256>>,
|
||||
targets: MultiProofTargets,
|
||||
) -> ProviderResult<reth_trie::MultiProof> {
|
||||
self.0.multiproof(input, targets)
|
||||
}
|
||||
@ -100,7 +97,7 @@ impl reth_storage_api::StateProofProvider for StateProviderTraitObjWrapper<'_> {
|
||||
&self,
|
||||
input: reth_trie::TrieInput,
|
||||
target: reth_trie::HashedPostState,
|
||||
) -> reth_errors::ProviderResult<alloy_primitives::map::HashMap<B256, alloy_primitives::Bytes>>
|
||||
) -> reth_errors::ProviderResult<alloy_primitives::map::B256HashMap<alloy_primitives::Bytes>>
|
||||
{
|
||||
self.0.witness(input, target)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user