Skip to content

Commit 3f812fe

Browse files
committed
refactor: move provider to background thread
1 parent bbee877 commit 3f812fe

15 files changed

Lines changed: 740 additions & 527 deletions

File tree

Cargo.lock

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

crates/edr_generic/tests/integration/helpers.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use edr_provider::{
1010
NoopLogger, Provider, ProviderSpec, SyncProviderSpec,
1111
};
1212
use edr_solidity::contract_decoder::ContractDecoder;
13+
use edr_transaction::{IsEip155, IsEip4844, TransactionMut, TransactionType};
1314
use parking_lot::RwLock;
1415
use tokio::runtime;
1516

@@ -20,7 +21,11 @@ pub(crate) fn get_chain_fork_provider<
2021
ChainSpecT: SyncProviderSpec<
2122
CurrentTime,
2223
Hardfork = edr_chain_l1::Hardfork,
23-
SignedTransaction: Default + TransactionValidation<ValidationError: PartialEq>,
24+
PooledTransaction: IsEip155,
25+
SignedTransaction: Default
26+
+ TransactionMut
27+
+ TransactionType<Type: IsEip4844>
28+
+ TransactionValidation<ValidationError: PartialEq>,
2429
> + ProviderSpec<CurrentTime>,
2530
>(
2631
chain_id: u64,

crates/edr_generic/tests/integration/issues/issue_947.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use edr_provider::{
1212
ProviderSpec, SyncProviderSpec,
1313
};
1414
use edr_test_utils::env::json_rpc_url_provider;
15+
use edr_transaction::{IsEip155, IsEip4844, TransactionMut, TransactionType};
1516
use serial_test::serial;
1617

1718
use crate::integration::helpers::get_chain_fork_provider;
@@ -25,7 +26,11 @@ fn get_provider<
2526
ChainSpecT: SyncProviderSpec<
2627
CurrentTime,
2728
Hardfork = edr_chain_l1::Hardfork,
28-
SignedTransaction: Default + TransactionValidation<ValidationError: PartialEq>,
29+
PooledTransaction: IsEip155,
30+
SignedTransaction: Default
31+
+ TransactionMut
32+
+ TransactionType<Type: IsEip4844>
33+
+ TransactionValidation<ValidationError: PartialEq>,
2934
> + ProviderSpec<CurrentTime>,
3035
>(
3136
hardfork: edr_chain_l1::Hardfork,

crates/edr_napi_core/src/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<ChainSpecT: SyncNapiSpec<TimerT>, TimerT: Clone + TimeSinceEpoch> SyncProvi
5252
{
5353
// Ignore potential failure of logging, as returning the original error is more
5454
// important
55-
let _result = self.log_failed_deserialization(method_name, &provider_error);
55+
let _result = self.log_failed_deserialization(method_name, provider_error);
5656
}
5757

5858
let response = jsonrpc::ResponseData::<()>::Error {

crates/edr_provider/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ alloy-serde.workspace = true
1313
alloy-sol-types.workspace = true
1414
anyhow = { workspace = true, optional = true }
1515
auto_impl = { version = "1.2", default-features = false }
16+
crossbeam-channel = "0.5"
1617
derive-where.workspace = true
1718
dyn-clone.workspace = true
1819
edr_block_api.workspace = true
@@ -54,6 +55,7 @@ edr_test_utils = { workspace = true, optional = true }
5455
edr_tracing.workspace = true
5556
edr_transaction.workspace = true
5657
edr_utils.workspace = true
58+
edr_utils_sync.workspace = true
5759
foundry-evm-traces.workspace = true
5860
indexmap = { version = "2.0.0", default-features = false, features = ["std"] }
5961
itertools = { version = "0.14.0", default-features = false, features = [

0 commit comments

Comments
 (0)