Skip to content

Commit 9ad069f

Browse files
committed
11.3 vibes
1 parent 8365e13 commit 9ad069f

69 files changed

Lines changed: 2606 additions & 1641 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 1809 additions & 1187 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -70,62 +70,73 @@ codegen-units = 1
7070
incremental = false
7171

7272
[workspace.dependencies]
73-
reth = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
74-
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
75-
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
76-
reth-db-common = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
77-
reth-errors = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
78-
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
79-
reth-node-api = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
80-
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
81-
reth-trie = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
82-
reth-trie-parallel = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
83-
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
84-
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
85-
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
86-
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
87-
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646", features = [
73+
# default-features minus "rocksdb": we only read reth datadirs via MDBX + static files.
74+
# ("reth-revm/portable" from reth's default set is re-enabled on the reth-revm dep below.)
75+
reth = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b", default-features = false, features = [
76+
"jemalloc",
77+
"otlp",
78+
"otlp-logs",
79+
"js-tracer",
80+
"keccak-cache-global",
81+
"asm-keccak",
82+
"min-debug-logs",
83+
] }
84+
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
85+
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
86+
reth-db-common = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
87+
reth-errors = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
88+
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
89+
reth-node-api = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
90+
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
91+
reth-trie = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
92+
reth-trie-parallel = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
93+
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
94+
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
95+
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
96+
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
97+
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b", features = [
8898
"test-utils",
8999
] }
90-
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
91-
reth-evm = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
92-
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
93-
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
94-
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
95-
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
96-
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "27a8c0f5a6dfb27dea84c5751776ecabdd069646" }
97-
98-
# compatible with reth 27a8c0f5a6dfb27dea84c5751776ecabdd069646 dependencies
99-
revm = { version = "31.0.2", features = [
100+
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
101+
reth-evm = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
102+
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
103+
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b", features = ["portable"] }
104+
reth-execution-errors = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
105+
reth-trie-db = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
106+
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
107+
reth-tasks = { git = "https://github.com/paradigmxyz/reth", rev = "d6324d63e27ef6b7c49cdc9b1977c1b808234c7b" }
108+
109+
# compatible with reth v1.11.3 (d6324d63e27ef6b7c49cdc9b1977c1b808234c7b) dependencies
110+
revm = { version = "34.0.0", features = [
100111
"std",
101112
"secp256k1",
102113
"optional_balance_check",
103114
], default-features = false }
104-
revm-inspectors = { version = "0.32.0", default-features = false }
115+
revm-inspectors = { version = "0.34.2", default-features = false }
105116

106117
ethereum_ssz_derive = "0.9.0"
107118
ethereum_ssz = "0.9.0"
108119

109-
alloy-primitives = { version = "1.4.1", default-features = false, features = [
120+
alloy-primitives = { version = "1.5.6", default-features = false, features = [
110121
"getrandom",
111122
] }
112-
alloy-rlp = "0.3.10"
123+
alloy-rlp = "0.3.13"
113124
alloy-chains = "0.2.5"
114-
alloy-trie = { version = "0.8.1", default-features = false }
115-
alloy-evm = { version = "0.23.3", default-features = false }
116-
alloy-provider = { version = "1.0.41", features = ["ipc", "pubsub", "ws"] }
117-
alloy-eips = { version = "1.0.41" }
118-
alloy-rpc-types = { version = "1.0.41" }
119-
alloy-json-rpc = { version = "1.0.41" }
120-
alloy-network = { version = "1.0.41" }
121-
alloy-network-primitives = { version = "1.0.41" }
122-
alloy-node-bindings = { version = "1.0.41" }
123-
alloy-consensus = { version = "1.0.41", features = ["kzg"] }
124-
alloy-rpc-types-beacon = { version = "1.0.41", features = ["ssz"] }
125-
alloy-rpc-types-engine = { version = "1.0.41", features = ["ssz"] }
126-
alloy-rpc-types-eth = { version = "1.0.41" }
127-
alloy-signer = { version = "1.0.41" }
128-
alloy-signer-local = { version = "1.0.41" }
125+
alloy-trie = { version = "0.9.4", default-features = false }
126+
alloy-evm = { version = "0.27.2", default-features = false }
127+
alloy-provider = { version = "1.6.3", features = ["ipc", "pubsub", "ws"] }
128+
alloy-eips = { version = "1.6.3" }
129+
alloy-rpc-types = { version = "1.6.3" }
130+
alloy-json-rpc = { version = "1.6.3" }
131+
alloy-network = { version = "1.6.3" }
132+
alloy-network-primitives = { version = "1.6.3" }
133+
alloy-node-bindings = { version = "1.6.3" }
134+
alloy-consensus = { version = "1.6.3", features = ["kzg"] }
135+
alloy-rpc-types-beacon = { version = "1.6.3", features = ["ssz"] }
136+
alloy-rpc-types-engine = { version = "1.6.3", features = ["ssz"] }
137+
alloy-rpc-types-eth = { version = "1.6.3" }
138+
alloy-signer = { version = "1.6.3" }
139+
alloy-signer-local = { version = "1.6.3" }
129140

130141
# Version required by ethereum-consensus beacon-api-client
131142
mev-share-sse = { git = "https://github.com/paradigmxyz/mev-share-rs", rev = "9eb2b0138ab3202b9eb3af4b19c7b3bf40b0faa8", default-features = false }
@@ -141,7 +152,7 @@ parking_lot = { version = "0.12.3" }
141152
tokio = { version = "1.40.0", default-features = false }
142153
futures = "0.3"
143154
futures-util = "0.3"
144-
reqwest = { version = "0.12.8" }
155+
reqwest = { version = "0.12.8", features = ["json"] }
145156
serde = { version = "1.0.210" }
146157
serde_json = { version = "1.0" }
147158
serde_with = { version = "3.8.1" }

crates/eth-sparse-mpt/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rustc-hash = "2.0.0"
1717
rayon = "1.10.0"
1818
smallvec = "1.13.2"
1919
alloy-trie.workspace = true
20-
nybbles = { version = "0.3.3", features = ["serde"] }
20+
nybbles = { version = "0.4", features = ["serde"] }
2121

2222
tracing.workspace = true
2323

@@ -32,6 +32,7 @@ reth-node-api = { workspace = true, optional = true }
3232
reth-node-ethereum = { workspace = true, optional = true }
3333
reth-trie.workspace = true
3434
reth-trie-parallel = { workspace = true, optional = true }
35+
reth-tasks = { workspace = true, optional = true }
3536
reth-trie-db.workspace = true
3637
reth-provider.workspace = true
3738
reth-revm = { workspace = true, optional = true }
@@ -64,6 +65,7 @@ dev-tools = [
6465
"dep:reth-node-api",
6566
"dep:reth-node-ethereum",
6667
"dep:reth-trie-parallel",
68+
"dep:reth-tasks",
6769
"dep:reth-revm",
6870
]
6971

crates/eth-sparse-mpt/benches/trie_do_bench.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ fn insert_proofs(c: &mut Criterion) {
9292
let mut proofs: HashMap<Nibbles, Vec<(Nibbles, Bytes)>> = Default::default();
9393
for key in &byte_keys {
9494
let key = Nibbles::unpack(key);
95-
let current_key_proofs = proofs.entry(key.clone()).or_default();
95+
let current_key_proofs = proofs.entry(key).or_default();
9696
for (path, node) in &nodes {
9797
if key.starts_with(path) {
98-
current_key_proofs.push((path.clone(), node.clone().into()));
98+
current_key_proofs.push((*path, node.clone().into()));
9999
}
100100
}
101-
current_key_proofs.sort_by_key(|(p, _)| p.clone());
102-
current_key_proofs.dedup_by_key(|(p, _)| p.clone());
101+
current_key_proofs.sort_by_key(|(p, _)| *p);
102+
current_key_proofs.dedup_by_key(|(p, _)| *p);
103103
}
104104
for (path, proof) in proofs {
105105
proof_store.add_proof(path, proof).unwrap();

crates/eth-sparse-mpt/benches/trie_insert_bench.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ fn gather_nodes(c: &mut Criterion) {
120120
.into_iter()
121121
.flat_map(|mp| mp.account_subtree.into_iter().collect::<Vec<_>>())
122122
.collect();
123-
account_proof.sort_by_key(|(p, _)| p.clone());
124-
account_proof.dedup_by_key(|(p, _)| p.clone());
123+
account_proof.sort_by_key(|(p, _)| *p);
124+
account_proof.dedup_by_key(|(p, _)| *p);
125125
account_proof
126126
};
127127

crates/eth-sparse-mpt/src/bin/correctness-harness.rs

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ use reth_evm_ethereum::EthEvmConfig;
1414
use reth_node_api::NodeTypesWithDBAdapter;
1515
use reth_node_ethereum::EthereumNode;
1616
use reth_provider::{
17-
providers::{ConsistentDbView, OverlayStateProviderFactory, StaticFileProvider},
17+
providers::{
18+
ConsistentDbView, OverlayStateProviderFactory, RocksDBProvider, StaticFileProvider,
19+
StaticFileProviderBuilder,
20+
},
1821
BlockHashReader, BlockNumReader, BlockReader, ChainSpecProvider, HeaderProvider,
1922
ProviderFactory, TransactionVariant,
2023
};
2124
use reth_revm::database::StateProviderDatabase;
2225
use reth_trie::TrieInput;
26+
use reth_trie_db::ChangesetCache;
2327
use reth_trie_parallel::root::ParallelStateRoot;
2428
use revm::database::BundleState;
2529
use std::{
@@ -347,13 +351,13 @@ fn calculate_reth_root(
347351
parent_hash: B256,
348352
outcome: &BundleState,
349353
) -> Result<B256> {
350-
let overlay = OverlayStateProviderFactory::new(factory.clone());
354+
let overlay = OverlayStateProviderFactory::new(factory.clone(), ChangesetCache::new());
351355
let hasher = factory
352356
.history_by_block_hash(parent_hash)
353357
.with_context(|| format!("failed to open state provider at parent hash {parent_hash:?}"))?;
354358
let hashed_post_state = hasher.hashed_post_state(outcome);
355359
let trie_input = TrieInput::from_state(hashed_post_state);
356-
ParallelStateRoot::new(overlay, trie_input.prefix_sets.freeze())
360+
ParallelStateRoot::new(overlay, trie_input.prefix_sets.freeze(), task_runtime())
357361
.incremental_root()
358362
.with_context(|| "parallel state root failed")
359363
}
@@ -403,24 +407,46 @@ fn open_provider_factory(
403407
.with_context(|| format!("failed to open reth db at {}", db_path.display()))?,
404408
);
405409

406-
let static_files =
407-
StaticFileProvider::read_only(&static_files_path, false).with_context(|| {
408-
format!(
409-
"failed to open static files at {}",
410-
static_files_path.display()
411-
)
412-
})?;
413410
let static_files = if let Some(blocks_per_file) = static_file_blocks_per_file {
414-
static_files.with_custom_blocks_per_file(blocks_per_file)
411+
StaticFileProviderBuilder::read_only(&static_files_path)
412+
.with_blocks_per_file(blocks_per_file)
413+
.build()
415414
} else {
416-
static_files
417-
};
415+
StaticFileProvider::read_only(&static_files_path, false)
416+
}
417+
.with_context(|| {
418+
format!(
419+
"failed to open static files at {}",
420+
static_files_path.display()
421+
)
422+
})?;
418423

424+
let rocksdb_provider = RocksDBProvider::builder(datadir.join("rocksdb"))
425+
.with_default_tables()
426+
.with_read_only(true)
427+
.build()
428+
.context("failed to open rocksdb provider")?;
419429
Ok(ProviderFactory::<NodeTypes>::new(
420430
db,
421431
chain_spec,
422432
static_files,
423-
))
433+
rocksdb_provider,
434+
task_runtime(),
435+
)?)
436+
}
437+
438+
/// Process-wide reth task runtime for parallel provider/trie I/O.
439+
fn task_runtime() -> reth_tasks::Runtime {
440+
use reth_tasks::{Runtime, RuntimeBuilder, RuntimeConfig};
441+
442+
static RUNTIME: std::sync::OnceLock<Runtime> = std::sync::OnceLock::new();
443+
RUNTIME
444+
.get_or_init(|| {
445+
RuntimeBuilder::new(RuntimeConfig::default())
446+
.build()
447+
.expect("failed to build reth task runtime")
448+
})
449+
.clone()
424450
}
425451

426452
fn parse_chain_spec(chain: &str) -> Result<Arc<ChainSpec>> {

crates/eth-sparse-mpt/src/utils.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,23 @@ pub fn rlp_pointer(rlp_encode: Bytes) -> Bytes {
2929
}
3030

3131
pub fn concat_path(p1: &Nibbles, p2: &[u8]) -> Nibbles {
32-
let mut result = Nibbles::with_capacity(p1.len() + p2.len());
33-
result.extend_from_slice_unchecked(p1);
32+
let mut result = *p1;
3433
result.extend_from_slice_unchecked(p2);
3534
result
3635
}
3736

3837
pub fn strip_first_nibble_mut(p: &mut Nibbles) -> u8 {
39-
let nibble = p[0];
40-
let vec = p.as_mut_vec_unchecked();
41-
vec.remove(0);
38+
let nibble = p.get_unchecked(0);
39+
*p = p.slice_unchecked(1, p.len());
4240
nibble
4341
}
4442

4543
#[inline]
4644
pub fn extract_prefix_and_suffix(p1: &Nibbles, p2: &Nibbles) -> (Nibbles, Nibbles, Nibbles) {
4745
let prefix_len = p1.common_prefix_length(p2);
48-
let prefix = Nibbles::from_nibbles_unchecked(&p1[..prefix_len]);
49-
let suffix1 = Nibbles::from_nibbles_unchecked(&p1[prefix_len..]);
50-
let suffix2 = Nibbles::from_nibbles_unchecked(&p2[prefix_len..]);
46+
let prefix = p1.slice_unchecked(0, prefix_len);
47+
let suffix1 = p1.slice_unchecked(prefix_len, p1.len());
48+
let suffix2 = p2.slice_unchecked(prefix_len, p2.len());
5149

5250
(prefix, suffix1, suffix2)
5351
}
@@ -136,16 +134,3 @@ fn mismatch_chunks<const N: usize>(xs: &[u8], ys: &[u8]) -> usize {
136134
.take_while(|(x, y)| x == y)
137135
.count()
138136
}
139-
140-
// rbuilder uses nybbles v3.3.0 and reth_trie uses nybbles v4.3.0. This is a temporary fix to convert between the two.
141-
// We can remove the below methods once rbuilder has been upgraded to nybbles v4.3.0.
142-
// nybbles v4.3.0 has a breaking change (byte array with 1 byte per nybble vs U256 packed data + length) in the API which breaks a lot of parts of the eth sparse trie code.
143-
#[inline]
144-
pub fn convert_reth_nybbles_to_nibbles(n: reth_trie::Nibbles) -> Nibbles {
145-
Nibbles::from_nibbles(n.to_vec())
146-
}
147-
148-
#[inline]
149-
pub fn convert_nibbles_to_reth_nybbles(n: Nibbles) -> reth_trie::Nibbles {
150-
reth_trie::Nibbles::from_nibbles(n.as_slice())
151-
}

crates/eth-sparse-mpt/src/v1/reth_sparse_trie/shared_cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ impl RethSparseTrieShareCacheInternal {
146146
multiproof: MultiProof,
147147
) -> Result<(), AddNodeError> {
148148
let mut nodes: Vec<_> = multiproof.account_subtree.into_iter().collect();
149-
nodes.sort_by_key(|(p, _)| p.clone());
149+
nodes.sort_by_key(|(p, _)| *p);
150150
self.account_trie.add_nodes(&nodes)?;
151151
for (account, storge_proofs) in multiproof.storages {
152152
let mut nodes: Vec<_> = storge_proofs.subtree.into_iter().collect();
153-
nodes.sort_by_key(|(p, _)| p.clone());
153+
nodes.sort_by_key(|(p, _)| *p);
154154
let account = Bytes::copy_from_slice(account.as_slice());
155155
let storage_trie = self.storage_tries.entry(account).or_default();
156156
storage_trie.add_nodes(&nodes)?;

crates/eth-sparse-mpt/src/v1/reth_sparse_trie/trie_fetcher/mod.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::time::Instant;
22

3-
use crate::utils::{convert_reth_nybbles_to_nibbles, hash_map_with_capacity, HashMap, HashSet};
3+
use crate::utils::{hash_map_with_capacity, HashMap, HashSet};
44
use alloy_primitives::map::HashSet as AlloyHashSet;
55
use tracing::trace;
66

@@ -106,7 +106,9 @@ where
106106
}
107107

108108
fn pad_path(mut path: Nibbles) -> B256 {
109-
path.as_mut_vec_unchecked().resize(64, 0);
109+
while path.len() < 64 {
110+
path.push_unchecked(0);
111+
}
110112
let mut res = B256::default();
111113
path.pack_to(res.as_mut_slice());
112114
res
@@ -164,16 +166,16 @@ fn merge_results(
164166
let mut result = MultiProof::default();
165167
for mut proof in multiproofs {
166168
result.account_subtree.append(&mut proof.account_subtree);
167-
result.account_subtree.sort_by_key(|s| s.0.clone());
168-
result.account_subtree.dedup_by_key(|s| s.0.clone());
169+
result.account_subtree.sort_by_key(|s| s.0);
170+
result.account_subtree.dedup_by_key(|s| s.0);
169171

170172
for (account, mut storage_proof) in proof.storages {
171173
let result_storage_proof = result.storages.entry(account).or_default();
172174
result_storage_proof
173175
.subtree
174176
.append(&mut storage_proof.subtree);
175-
result_storage_proof.subtree.sort_by_key(|s| s.0.clone());
176-
result_storage_proof.subtree.dedup_by_key(|s| s.0.clone());
177+
result_storage_proof.subtree.sort_by_key(|s| s.0);
178+
result_storage_proof.subtree.dedup_by_key(|s| s.0);
177179
}
178180
}
179181

@@ -192,9 +194,9 @@ fn convert_reth_multiproof(
192194
) -> MultiProof {
193195
let mut account_subtree = Vec::with_capacity(reth_proof.account_subtree.len());
194196
for (k, v) in reth_proof.account_subtree.into_inner() {
195-
account_subtree.push((convert_reth_nybbles_to_nibbles(k), v));
197+
account_subtree.push((k, v));
196198
}
197-
account_subtree.sort_by_key(|a| a.0.clone());
199+
account_subtree.sort_by_key(|a| a.0);
198200
let mut storages = hash_map_with_capacity(reth_proof.storages.len());
199201
for (k, reth_storage_proof) in reth_proof.storages {
200202
if !all_requested_accounts.contains(&k) {
@@ -206,9 +208,9 @@ fn convert_reth_multiproof(
206208
let mut subtree = Vec::with_capacity(reth_storage_proof.subtree.len());
207209

208210
for (k, v) in reth_storage_proof.subtree.into_inner() {
209-
subtree.push((convert_reth_nybbles_to_nibbles(k), v));
211+
subtree.push((k, v));
210212
}
211-
subtree.sort_by_key(|a| a.0.clone());
213+
subtree.sort_by_key(|a| a.0);
212214
let v = StorageMultiProof { subtree };
213215
storages.insert(k, v);
214216
}

0 commit comments

Comments
 (0)