-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add StateProviderFactory custom trait #331
Conversation
Benchmark results for
|
Date (UTC) | 2025-01-09T16:55:46+00:00 |
Commit | 94d042e248ab66754a19c3434b26ffed13bfe8d2 |
Base SHA | 26db62de834397c04fbe105f900e393bb6d28f87 |
Significant changes
Benchmark | Mean | Status |
---|---|---|
reference_trie_insert_and_hash_3000 | 2.58% | Performance has degraded. |
hashing_3000_elements | 2.88% | Performance has degraded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
@@ -0,0 +1,43 @@ | |||
use crate::live_builder::simulation::SimulatedOrderCommand; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doc comment would be nice
crates/rbuilder/src/provider/mod.rs
Outdated
|
||
pub mod reth_prov; | ||
|
||
pub trait StateProviderFactory: Clone + 'static + Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we name this something different so it doesn't get confused with the reth StateProviderFactory? Maybe RbuilderProvider?
crates/rbuilder/src/provider/mod.rs
Outdated
|
||
pub mod reth_prov; | ||
|
||
pub trait StateProviderFactory: Clone + 'static + Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments!!!!!
crates/rbuilder/src/provider/mod.rs
Outdated
|
||
pub mod reth_prov; | ||
|
||
pub trait StateProviderFactory: Clone + 'static + Send + Sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clone + 'static doesn't seem right, it feels more like specific use constrains you brought to the trait.
crates/rbuilder/src/provider/mod.rs
Outdated
fn run_trie_prefetcher( | ||
&self, | ||
parent_hash: B256, | ||
simulated_orders: broadcast::Receiver<SimulatedOrderCommand>, | ||
cancel: CancellationToken, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments!
crates/rbuilder/src/provider/mod.rs
Outdated
fn calculate_state_root( | ||
&self, | ||
parent_hash: B256, | ||
outcome: &ExecutionOutcome, | ||
config: RootHashConfig, | ||
) -> Result<B256, RootHashError>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If feels like the specifics of roothash calculation should be hidden (eg: RootHashConfig) inside the specific implementation and not in the trait (and they are probably going to be constant during the while execution!)
All the Default::default() for the SparseTrieSharedCache broke the whole caching thing. This must be carefully rethought or it will not work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must fix the roothash!
@@ -169,23 +168,47 @@ impl BaseConfig { | |||
)) | |||
} | |||
|
|||
/// WARN: opens reth db | |||
pub async fn create_builder<SlotSourceType>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this method in #330
@@ -0,0 +1,77 @@ | |||
use super::OrderInputConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was removed in #327?
π Summary
π‘ Motivation and Context
β I have completed the following steps:
make lint
make test