From 5f7f94971310b2a58de750bb505f26df2ac74157 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 22 Jul 2024 22:14:38 +0000 Subject: [PATCH 1/7] fix(rpc/trace): no filter on tx.{from,to}_address Signed-off-by: jsvisa --- crates/rpc/rpc/src/trace.rs | 40 ++++++------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index 461a1cad5fcd..a2beb563b65c 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -24,7 +24,7 @@ use reth_rpc_types::{ parity::*, tracerequest::TraceCallRequest, }, - BlockError, BlockOverrides, Index, TransactionRequest, + BlockOverrides, Index, TransactionRequest, }; use reth_tasks::pool::BlockingTaskGuard; use revm::{ @@ -277,42 +277,14 @@ where // fetch all blocks in that range let blocks = self.provider().block_range(start..=end).map_err(Eth::Error::from_eth_err)?; - // find relevant blocks to trace - let mut target_blocks = Vec::new(); + // trace all blocks + let mut block_traces = Vec::with_capacity(blocks.len()); for block in &blocks { - let mut transaction_indices = HashSet::new(); - let mut highest_matching_index = 0; - for (tx_idx, tx) in block.body.iter().enumerate() { - let from = tx - .recover_signer_unchecked() - .ok_or(BlockError::InvalidSignature) - .map_err(Eth::Error::from_eth_err)?; - let to = tx.to(); - if matcher.matches(from, to) { - let idx = tx_idx as u64; - transaction_indices.insert(idx); - highest_matching_index = idx; - } - } - if !transaction_indices.is_empty() { - target_blocks.push((block.number, transaction_indices, highest_matching_index)); - } - } - - // trace all relevant blocks - let mut block_traces = Vec::with_capacity(target_blocks.len()); - for (num, indices, highest_idx) in target_blocks { let traces = self.inner.eth_api.trace_block_until( - num.into(), - Some(highest_idx), + block.number.into(), + None, TracingInspectorConfig::default_parity(), - move |tx_info, inspector, _, _, _| { - if let Some(idx) = tx_info.index { - if !indices.contains(&idx) { - // only record traces for relevant transactions - return Ok(None) - } - } + move |tx_info, inspector, res, _, _, _| { let traces = inspector.into_parity_builder().into_localized_transaction_traces(tx_info); Ok(Some(traces)) From 4a1c14734fe4b2a16b14b5a5a6872d728d08540e Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 22 Jul 2024 22:15:09 +0000 Subject: [PATCH 2/7] feat(rpc/trace): filter on trace.{from,to}_address Signed-off-by: jsvisa --- crates/rpc/rpc/src/trace.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index a2beb563b65c..7f2c8e3fed52 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -315,6 +315,29 @@ where } } + // filter out traces that don't match the filter + all_traces = all_traces + .into_iter() + .filter(|trace| { + let trace = &trace.trace; + let (from_address, to_address) = match trace.action { + Action::Call(CallAction { from, to, .. }) => (Some(from), Some(to)), + Action::Create(CreateAction { from, .. }) => ( + Some(from), + match trace.result { + Some(TraceOutput::Create(CreateOutput { address: to, .. })) => Some(to), + _ => None, + }, + ), + Action::Selfdestruct(SelfdestructAction { + address, refund_address, .. + }) => (Some(address), Some(refund_address)), + Action::Reward(RewardAction { author, .. }) => (None, Some(author)), + }; + matcher.matches(from_address, to_address) + }) + .collect::>(); + // apply after and count to traces if specified, this allows for a pagination style. // only consider traces after if let Some(after) = after.map(|a| a as usize).filter(|a| *a < all_traces.len()) { From 38bb1eaf7c28fcadaed41a576f0296ebd60fcdd2 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Tue, 23 Jul 2024 00:55:49 +0000 Subject: [PATCH 3/7] feat(rpc/trace): use matcher.matches Signed-off-by: jsvisa --- crates/rpc/rpc/src/trace.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index 7f2c8e3fed52..dfa2f4a4f85d 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -318,24 +318,7 @@ where // filter out traces that don't match the filter all_traces = all_traces .into_iter() - .filter(|trace| { - let trace = &trace.trace; - let (from_address, to_address) = match trace.action { - Action::Call(CallAction { from, to, .. }) => (Some(from), Some(to)), - Action::Create(CreateAction { from, .. }) => ( - Some(from), - match trace.result { - Some(TraceOutput::Create(CreateOutput { address: to, .. })) => Some(to), - _ => None, - }, - ), - Action::Selfdestruct(SelfdestructAction { - address, refund_address, .. - }) => (Some(address), Some(refund_address)), - Action::Reward(RewardAction { author, .. }) => (None, Some(author)), - }; - matcher.matches(from_address, to_address) - }) + .filter(|trace| matcher.matches(&trace.trace)) .collect::>(); // apply after and count to traces if specified, this allows for a pagination style. From 17c17a1202db1bd02b7a05f545ddf9cd789d0583 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Sat, 27 Jul 2024 12:27:58 +0800 Subject: [PATCH 4/7] fix typo Signed-off-by: jsvisa --- crates/rpc/rpc/src/trace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index dfa2f4a4f85d..a773061dc9ec 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -284,7 +284,7 @@ where block.number.into(), None, TracingInspectorConfig::default_parity(), - move |tx_info, inspector, res, _, _, _| { + move |tx_info, inspector, res, _, _| { let traces = inspector.into_parity_builder().into_localized_transaction_traces(tx_info); Ok(Some(traces)) From 2c1e4918eba7cb67968edbffe5f8aea7bfb8ca93 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Wed, 31 Jul 2024 17:10:04 +0800 Subject: [PATCH 5/7] feat(rpc/trace): apply pre-filter Signed-off-by: jsvisa --- crates/rpc/rpc/src/trace.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/crates/rpc/rpc/src/trace.rs b/crates/rpc/rpc/src/trace.rs index a773061dc9ec..0089b8b861ad 100644 --- a/crates/rpc/rpc/src/trace.rs +++ b/crates/rpc/rpc/src/trace.rs @@ -280,13 +280,15 @@ where // trace all blocks let mut block_traces = Vec::with_capacity(blocks.len()); for block in &blocks { + let matcher = matcher.clone(); let traces = self.inner.eth_api.trace_block_until( block.number.into(), None, TracingInspectorConfig::default_parity(), - move |tx_info, inspector, res, _, _| { - let traces = + move |tx_info, inspector, _, _, _| { + let mut traces = inspector.into_parity_builder().into_localized_transaction_traces(tx_info); + traces.retain(|trace| matcher.matches(&trace.trace)); Ok(Some(traces)) }, ); @@ -303,11 +305,10 @@ where // add reward traces for all blocks for block in &blocks { if let Some(base_block_reward) = self.calculate_base_block_reward(&block.header)? { - all_traces.extend(self.extract_reward_traces( - &block.header, - &block.ommers, - base_block_reward, - )); + let mut traces = + self.extract_reward_traces(&block.header, &block.ommers, base_block_reward); + traces.retain(|trace| matcher.matches(&trace.trace)); + all_traces.extend(traces); } else { // no block reward, means we're past the Paris hardfork and don't expect any rewards // because the blocks in ascending order @@ -315,12 +316,6 @@ where } } - // filter out traces that don't match the filter - all_traces = all_traces - .into_iter() - .filter(|trace| matcher.matches(&trace.trace)) - .collect::>(); - // apply after and count to traces if specified, this allows for a pagination style. // only consider traces after if let Some(after) = after.map(|a| a as usize).filter(|a| *a < all_traces.len()) { From b7c1080fa5b9341570caaf38da7cc64d1cfcb28f Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 2 Aug 2024 14:03:16 +0200 Subject: [PATCH 6/7] chore: update alloy --- Cargo.lock | 220 ++++++++++----------- Cargo.toml | 56 +++--- crates/rpc/rpc-eth-api/src/helpers/spec.rs | 5 +- crates/rpc/rpc-testing-util/src/debug.rs | 2 +- crates/rpc/rpc-types-compat/src/block.rs | 3 +- 5 files changed, 140 insertions(+), 146 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81b806f81836..297fda920f85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,9 +123,9 @@ dependencies = [ [[package]] name = "alloy-consensus" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58047cc851e58c26224521d1ecda466e3d746ebca0274cd5427aa660a88c353" +checksum = "04c309895995eaa4bfcc345f5515a39c7df9447798645cc8bf462b6c5bf1dc96" dependencies = [ "alloy-eips", "alloy-primitives", @@ -156,9 +156,9 @@ dependencies = [ [[package]] name = "alloy-eips" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a3e14fa0d152d00bd8daf605eb74ad397efb0f54bd7155585823dddb4401e" +checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -168,15 +168,16 @@ dependencies = [ "derive_more", "k256", "once_cell", + "rand 0.8.5", "serde", "sha2 0.10.8", ] [[package]] name = "alloy-genesis" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cb76c8a3913f2466c5488f3a915e3a15d15596bdc935558c1a9be75e9ec508" +checksum = "79614dfe86144328da11098edcc7bc1a3f25ad8d3134a9eb9e857e06f0d9840d" dependencies = [ "alloy-primitives", "alloy-serde", @@ -197,11 +198,12 @@ dependencies = [ [[package]] name = "alloy-json-rpc" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e76a9feec2352c78545d1a37415699817bae8dc41654bd1bfe57d6cdd5433bd" +checksum = "57e2865c4c3bb4cdad3f0d9ec1ab5c0c657ba69a375651bd35e32fb6c180ccc2" dependencies = [ "alloy-primitives", + "alloy-sol-types", "serde", "serde_json", "thiserror", @@ -210,13 +212,14 @@ dependencies = [ [[package]] name = "alloy-network" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3223d71dc78f464b2743418d0be8b5c894313e272105a6206ad5e867d67b3ce2" +checksum = "6e701fc87ef9a3139154b0b4ccb935b565d27ffd9de020fe541bf2dec5ae4ede" dependencies = [ "alloy-consensus", "alloy-eips", "alloy-json-rpc", + "alloy-network-primitives", "alloy-primitives", "alloy-rpc-types-eth", "alloy-serde", @@ -228,11 +231,22 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-network-primitives" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec9d5a0f9170b10988b6774498a022845e13eda94318440d17709d50687f67f9" +dependencies = [ + "alloy-primitives", + "alloy-serde", + "serde", +] + [[package]] name = "alloy-node-bindings" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a2864b3470d3c74bf50a70f4a5f3e87a7359870878a268be829d7caff42f13" +checksum = "16faebb9ea31a244fd6ce3288d47df4be96797d9c3c020144b8f2c31543a4512" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -273,15 +287,16 @@ dependencies = [ [[package]] name = "alloy-provider" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29da7457d853cb8199ec04b227d5d2ef598be3e59fc2bbad70c8be213292f32" +checksum = "3f9c0ab10b93de601a6396fc7ff2ea10d3b28c46f079338fa562107ebf9857c8" dependencies = [ "alloy-chains", "alloy-consensus", "alloy-eips", "alloy-json-rpc", "alloy-network", + "alloy-network-primitives", "alloy-primitives", "alloy-pubsub", "alloy-rpc-client", @@ -309,9 +324,9 @@ dependencies = [ [[package]] name = "alloy-pubsub" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64acfec654ade392cecfa9bba0408eb2a337d55f1b857925da79970cb70f3d6" +checksum = "3f5da2c55cbaf229bad3c5f8b00b5ab66c74ef093e5f3a753d874cfecf7d2281" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -350,9 +365,9 @@ dependencies = [ [[package]] name = "alloy-rpc-client" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a9e609524fa31c2c70eb24c0da60796809193ad4787a6dfe6d0db0d3ac112d" +checksum = "5b38e3ffdb285df5d9f60cb988d336d9b8e3505acb78750c3bc60336a7af41d3" dependencies = [ "alloy-json-rpc", "alloy-primitives", @@ -374,9 +389,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5d76f1e8b22f48b7b8f985782b68e7eb3938780e50e8b646a53e41a598cdf5" +checksum = "e6c31a3750b8f5a350d17354e46a52b0f2f19ec5f2006d816935af599dedc521" dependencies = [ "alloy-rpc-types-engine", "alloy-rpc-types-eth", @@ -387,9 +402,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-admin" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "137f0014c3a61ccc5168289fcc214d7296c389c0bf60425c0f898cff1d7e4bec" +checksum = "fbfb8b2c2eea8acd5580c9804a1ee58038938b16efb24eec09c3005f65b0e4ad" dependencies = [ "alloy-genesis", "alloy-primitives", @@ -399,9 +414,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4282c002a4ae9f57887dae57083fcca6dca09cb6685bf98b8582ea93cb3df97d" +checksum = "52ab6509cd38b2e8c8da726e0f61c1e314a81df06a38d37ddec8bced3f8d25ed" dependencies = [ "alloy-primitives", "alloy-serde", @@ -410,9 +425,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-beacon" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b47dcc8e3bebea57b1c9495a7e6f3313e99d355c0f5b80473cfbdfcbdd6ebea" +checksum = "c8a24bcff4f9691d7a4971b43e5da46aa7b4ce22ed7789796612dc1eed220983" dependencies = [ "alloy-eips", "alloy-primitives", @@ -424,9 +439,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73445fbc5c02258e3d0d977835c92366a4d91545fd456c3fc8601c61810bc9f6" +checksum = "ff63f51b2fb2f547df5218527fd0653afb1947bf7fead5b3ce58c75d170b30f7" dependencies = [ "alloy-consensus", "alloy-eips", @@ -443,12 +458,13 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "605fa8462732bb8fd0645a9941e12961e079d45ae6a44634c826f8229c187bdf" +checksum = "81e18424d962d7700a882fe423714bd5b9dde74c7a7589d4255ea64068773aef" dependencies = [ "alloy-consensus", "alloy-eips", + "alloy-network-primitives", "alloy-primitives", "alloy-rlp", "alloy-serde", @@ -463,9 +479,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-mev" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffcb83a5a91d327c40ba2157a19016bb883c1426f1708fea5f9e042032fd73e" +checksum = "5a0593a17b4b009598eb3e8380e298c53bd5581f3f37d85a38e6a34881c90ea1" dependencies = [ "alloy-eips", "alloy-primitives", @@ -476,9 +492,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f561a8cdd377b6ac3beab805b9df5ec2c7d99bb6139aab23c317f26df6fb346" +checksum = "a86eeb49ea0cc79f249faa1d35c20541bb1c317a59b5962cb07b1890355b0064" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -490,9 +506,9 @@ dependencies = [ [[package]] name = "alloy-rpc-types-txpool" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06a4bd39910631c11148c5b2c55e2c61f8626affd2a612e382c668d5e5971ce" +checksum = "c2342fed8175642b15a37a51f8729b05b2469281fbeb816f0ccbb0087e2dd74a" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth", @@ -502,9 +518,9 @@ dependencies = [ [[package]] name = "alloy-serde" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c5b9057acc02aee1b8aac2b5a0729cb0f73d080082c111313e5d1f92a96630" +checksum = "e33feda6a53e6079895aed1d08dcb98a1377b000d80d16370fbbdb8155d547ef" dependencies = [ "alloy-primitives", "arbitrary", @@ -514,9 +530,9 @@ dependencies = [ [[package]] name = "alloy-signer" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37f10592696f4ab8b687d5a8ab55e998a14ea0ca5f8eb20ad74a96ad671bb54a" +checksum = "740a25b92e849ed7b0fa013951fe2f64be9af1ad5abe805037b44fb7770c5c47" dependencies = [ "alloy-primitives", "async-trait", @@ -528,9 +544,9 @@ dependencies = [ [[package]] name = "alloy-signer-local" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b537f3e55f30753578f4623d5f66ddad8fa582af3fa6b15bad23dd1b9775228" +checksum = "1b0707d4f63e4356a110b30ef3add8732ab6d181dd7be4607bf79b8777105cee" dependencies = [ "alloy-consensus", "alloy-network", @@ -634,9 +650,9 @@ dependencies = [ [[package]] name = "alloy-transport-http" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d8f1eefa8cb9e7550740ee330feba4fed303a77ad3085707546f9152a88c380" +checksum = "2437d145d80ea1aecde8574d2058cceb8b3c9cba05f6aea8e67907c660d46698" dependencies = [ "alloy-json-rpc", "alloy-transport", @@ -649,9 +665,9 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31007c56dc65bd81392112dda4a14c20ac7e30bb4cb2e9176192e8d9fab1983f" +checksum = "804494366e20468776db4e18f9eb5db7db0fe14f1271eb6dbf155d867233405c" dependencies = [ "alloy-json-rpc", "alloy-pubsub", @@ -668,14 +684,14 @@ dependencies = [ [[package]] name = "alloy-transport-ws" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ccc1c8f8ae415e93ec0e7851bd4cdf4afdd48793d13a91b860317da1f36104" +checksum = "af855163e7df008799941aa6dd324a43ef2bf264b08ba4b22d44aad6ced65300" dependencies = [ "alloy-pubsub", "alloy-transport", "futures", - "http 1.1.0", + "http", "rustls", "serde_json", "tokio", @@ -1138,15 +1154,6 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" -dependencies = [ - "serde", -] - [[package]] name = "bimap" version = "0.6.3" @@ -3332,15 +3339,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "gloo-net" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" +checksum = "c06f627b1a58ca3d42b45d6104bf1e1a03799df472df00988b6ba21accc10580" dependencies = [ "futures-channel", "futures-core", "futures-sink", "gloo-utils", - "http 0.2.12", + "http", "js-sys", "pin-project", "serde", @@ -3398,7 +3405,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http", "indexmap 2.3.0", "slab", "tokio", @@ -3547,17 +3554,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.1.0" @@ -3576,7 +3572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -3587,7 +3583,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http", "http-body", "pin-project-lite", ] @@ -3662,7 +3658,7 @@ dependencies = [ "futures-channel", "futures-util", "h2", - "http 1.1.0", + "http", "http-body", "httparse", "httpdate", @@ -3680,7 +3676,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", - "http 1.1.0", + "http", "hyper", "hyper-util", "log", @@ -3702,7 +3698,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http", "http-body", "hyper", "pin-project-lite", @@ -4182,9 +4178,9 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" +checksum = "1568257acc17d60cd19c61b8e2b068f0d706399bbf9ebf8afdb08f7fe824721f" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -4200,15 +4196,15 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" +checksum = "37f545bed6cf5cea796c1ef50ccb87a8fa613f36f2141ec85c56f3eefc03ae55" dependencies = [ "base64 0.22.1", "futures-channel", "futures-util", "gloo-net", - "http 1.1.0", + "http", "jsonrpsee-core", "pin-project", "rustls", @@ -4225,24 +4221,22 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" +checksum = "e6e188cdec4745cfb6174608f10c3d8c6ea57e986b636b0d6de53aafef29c7ea" dependencies = [ - "anyhow", "async-trait", - "beef", "bytes", "futures-timer", "futures-util", - "http 1.1.0", + "http", "http-body", "http-body-util", "jsonrpsee-types", "parking_lot 0.12.3", "pin-project", "rand 0.8.5", - "rustc-hash 1.1.0", + "rustc-hash 2.0.0", "serde", "serde_json", "thiserror", @@ -4254,9 +4248,9 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d90064e04fb9d7282b1c71044ea94d0bbc6eff5621c66f1a0bce9e9de7cf3ac" +checksum = "e39c8c20007a1fbcdcfb76d771257529f78e7eea81e9de03c52f870e7b13351e" dependencies = [ "async-trait", "base64 0.22.1", @@ -4279,9 +4273,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4" +checksum = "8e7cae5320ea42b1f35ff792413330e206146e9ecb9cb6e7ffe12e167bd169ca" dependencies = [ "heck 0.5.0", "proc-macro-crate", @@ -4292,13 +4286,12 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "654afab2e92e5d88ebd8a39d6074483f3f2bfdf91c5ac57fe285e7127cdd4f51" +checksum = "ff967386dfa9e89ea6de6ee75ee0e87ee28fbff896e0282f646f47ce158a3ae3" dependencies = [ - "anyhow", "futures-util", - "http 1.1.0", + "http", "http-body", "http-body-util", "hyper", @@ -4320,12 +4313,11 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" +checksum = "af7d734a4b0ae276b1e9e31572ab1f0f92d55797f0ca6b661afdd2266dc12756" dependencies = [ - "beef", - "http 1.1.0", + "http", "serde", "serde_json", "thiserror", @@ -4333,9 +4325,9 @@ dependencies = [ [[package]] name = "jsonrpsee-wasm-client" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4727ac037f834c6f04c0912cada7532dbddb54e92fbc64e33d6cb8c24af313c9" +checksum = "a3db6294ef23107961daf31901331dd672875424500f1aa2a6292f09275125d5" dependencies = [ "jsonrpsee-client-transport", "jsonrpsee-core", @@ -4344,11 +4336,11 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" +checksum = "be6085716aa39842013cd74e3fe67cda8d3f509cc3917609430c9c28c6016535" dependencies = [ - "http 1.1.0", + "http", "jsonrpsee-client-transport", "jsonrpsee-core", "jsonrpsee-types", @@ -6172,7 +6164,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.1.0", + "http", "http-body", "http-body-util", "hyper", @@ -7830,7 +7822,7 @@ name = "reth-node-metrics" version = "1.0.3" dependencies = [ "eyre", - "http 1.1.0", + "http", "jsonrpsee", "metrics", "metrics-exporter-prometheus", @@ -8247,7 +8239,7 @@ dependencies = [ "async-trait", "derive_more", "futures", - "http 1.1.0", + "http", "http-body", "hyper", "jsonrpsee", @@ -8327,7 +8319,7 @@ name = "reth-rpc-builder" version = "1.0.3" dependencies = [ "clap", - "http 1.1.0", + "http", "jsonrpsee", "metrics", "pin-project", @@ -8477,7 +8469,7 @@ version = "1.0.3" dependencies = [ "alloy-rpc-types-engine", "assert_matches", - "http 1.1.0", + "http", "jsonrpsee", "jsonrpsee-http-client", "pin-project", @@ -9798,7 +9790,7 @@ dependencies = [ "base64 0.22.1", "bytes", "futures", - "http 1.1.0", + "http", "httparse", "log", "rand 0.8.5", @@ -10419,7 +10411,7 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "http 1.1.0", + "http", "http-body", "http-body-util", "http-range-header", @@ -10655,7 +10647,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http", "httparse", "log", "rand 0.8.5", diff --git a/Cargo.toml b/Cargo.toml index 073a26d14002..0c8d34aad70b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -397,37 +397,37 @@ alloy-dyn-abi = "0.7.2" alloy-sol-types = "0.7.2" alloy-rlp = "0.3.4" alloy-trie = { version = "0.4", default-features = false } -alloy-rpc-types = { version = "0.2", default-features = false, features = [ +alloy-rpc-types = { version = "0.2.1", default-features = false, features = [ "eth", ] } -alloy-rpc-types-anvil = { version = "0.2", default-features = false } -alloy-rpc-types-beacon = { version = "0.2", default-features = false } -alloy-rpc-types-admin = { version = "0.2", default-features = false } -alloy-rpc-types-txpool = { version = "0.2", default-features = false } -alloy-serde = { version = "0.2", default-features = false } -alloy-rpc-types-engine = { version = "0.2", default-features = false } -alloy-rpc-types-eth = { version = "0.2", default-features = false } -alloy-rpc-types-mev = { version = "0.2", default-features = false } -alloy-rpc-types-trace = { version = "0.2", default-features = false } -alloy-genesis = { version = "0.2", default-features = false } -alloy-node-bindings = { version = "0.2", default-features = false } -alloy-provider = { version = "0.2", default-features = false, features = [ +alloy-rpc-types-anvil = { version = "0.2.1", default-features = false } +alloy-rpc-types-beacon = { version = "0.2.1", default-features = false } +alloy-rpc-types-admin = { version = "0.2.1", default-features = false } +alloy-rpc-types-txpool = { version = "0.2.1", default-features = false } +alloy-serde = { version = "0.2.1", default-features = false } +alloy-rpc-types-engine = { version = "0.2.1", default-features = false } +alloy-rpc-types-eth = { version = "0.2.1", default-features = false } +alloy-rpc-types-mev = { version = "0.2.1", default-features = false } +alloy-rpc-types-trace = { version = "0.2.1", default-features = false } +alloy-genesis = { version = "0.2.1", default-features = false } +alloy-node-bindings = { version = "0.2.1", default-features = false } +alloy-provider = { version = "0.2.1", default-features = false, features = [ "reqwest", ] } -alloy-eips = { version = "0.2", default-features = false } -alloy-signer = { version = "0.2", default-features = false } -alloy-signer-local = { version = "0.2", default-features = false } -alloy-network = { version = "0.2", default-features = false } -alloy-consensus = { version = "0.2", default-features = false } +alloy-eips = { version = "0.2.1", default-features = false } +alloy-signer = { version = "0.2.1", default-features = false } +alloy-signer-local = { version = "0.2.1", default-features = false } +alloy-network = { version = "0.2.1", default-features = false } +alloy-consensus = { version = "0.2.1", default-features = false } alloy-transport = { version = "0.2" } -alloy-transport-http = { version = "0.2", features = [ +alloy-transport-http = { version = "0.2.1", features = [ "reqwest-rustls-tls", ], default-features = false } -alloy-transport-ws = { version = "0.2", default-features = false } -alloy-transport-ipc = { version = "0.2", default-features = false } -alloy-pubsub = { version = "0.2", default-features = false } -alloy-json-rpc = { version = "0.2", default-features = false } -alloy-rpc-client = { version = "0.2", default-features = false } +alloy-transport-ws = { version = "0.2.1", default-features = false } +alloy-transport-ipc = { version = "0.2.1", default-features = false } +alloy-pubsub = { version = "0.2.1", default-features = false } +alloy-json-rpc = { version = "0.2.1", default-features = false } +alloy-rpc-client = { version = "0.2.1", default-features = false } # op op-alloy-rpc-types = "0.1" @@ -507,10 +507,10 @@ tower-http = "0.5" discv5 = "0.6.0" # rpc -jsonrpsee = "0.23" -jsonrpsee-core = "0.23" -jsonrpsee-types = "0.23" -jsonrpsee-http-client = "0.23" +jsonrpsee = "0.24" +jsonrpsee-core = "0.24" +jsonrpsee-types = "0.24" +jsonrpsee-http-client = "0.24" # http http = "1.0" diff --git a/crates/rpc/rpc-eth-api/src/helpers/spec.rs b/crates/rpc/rpc-eth-api/src/helpers/spec.rs index 96b9bdeb3d64..6e9edae8b2ed 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/spec.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/spec.rs @@ -63,13 +63,14 @@ pub trait EthApiSpec: Send + Sync { let current_block = U256::from( self.provider().chain_info().map(|info| info.best_number).unwrap_or_default(), ); - SyncStatus::Info(SyncInfo { + SyncStatus::Info(Box::new(SyncInfo { starting_block: self.starting_block(), current_block, highest_block: current_block, warp_chunks_amount: None, warp_chunks_processed: None, - }) + stages: None, + })) } else { SyncStatus::None }; diff --git a/crates/rpc/rpc-testing-util/src/debug.rs b/crates/rpc/rpc-testing-util/src/debug.rs index 91a9bf2ee8fd..c0151e2d1be2 100644 --- a/crates/rpc/rpc-testing-util/src/debug.rs +++ b/crates/rpc/rpc-testing-util/src/debug.rs @@ -104,7 +104,7 @@ where BlockId::Number(tag) => self.block_by_number(tag, false).await, }? .ok_or_else(|| RpcError::Custom("block not found".to_string()))?; - let hashes = block.transactions.hashes().map(|tx| (*tx, opts.clone())).collect::>(); + let hashes = block.transactions.hashes().map(|tx| (tx, opts.clone())).collect::>(); let stream = futures::stream::iter(hashes.into_iter().map(move |(tx, opts)| async move { match self.debug_trace_transaction_json(tx, opts).await { Ok(result) => Ok((result, tx)), diff --git a/crates/rpc/rpc-types-compat/src/block.rs b/crates/rpc/rpc-types-compat/src/block.rs index 7cfd57e8aaf8..82420fdac331 100644 --- a/crates/rpc/rpc-types-compat/src/block.rs +++ b/crates/rpc/rpc-types-compat/src/block.rs @@ -2,6 +2,7 @@ use crate::transaction::from_recovered_with_block_context; use alloy_rlp::Encodable; +use alloy_rpc_types::Transaction; use reth_primitives::{ Block as PrimitiveBlock, BlockWithSenders, Header as PrimitiveHeader, Withdrawals, B256, U256, }; @@ -154,7 +155,7 @@ fn from_block_with_transactions( block_hash: B256, block: PrimitiveBlock, total_difficulty: U256, - transactions: BlockTransactions, + transactions: BlockTransactions, ) -> Block { let uncles = block.ommers.into_iter().map(|h| h.hash_slow()).collect(); let mut header = from_primitive_with_hash(block.header.seal(block_hash)); From 31ee9cfa7a7ebda11eb413b6881a1ab56249803d Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Fri, 2 Aug 2024 14:08:43 +0200 Subject: [PATCH 7/7] docs --- crates/rpc/rpc-types-compat/src/block.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/rpc/rpc-types-compat/src/block.rs b/crates/rpc/rpc-types-compat/src/block.rs index 82420fdac331..bd5b83f2c6bb 100644 --- a/crates/rpc/rpc-types-compat/src/block.rs +++ b/crates/rpc/rpc-types-compat/src/block.rs @@ -52,7 +52,7 @@ pub fn from_block_with_tx_hashes( /// total difficulty to populate its field in the rpc response. /// /// This will populate the `transactions` field with the _full_ -/// [Transaction](reth_rpc_types::Transaction) objects: [`BlockTransactions::Full`] +/// [`Transaction`] objects: [`BlockTransactions::Full`] pub fn from_block_full( mut block: BlockWithSenders, total_difficulty: U256,