-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
feat(engine): wire StateRootTask in EngineApiTreeHandler #12639
base: main
Are you sure you want to change the base?
Conversation
5eba0ab
to
e3149b0
Compare
70e9ba3
to
8f89fff
Compare
e3149b0
to
ffd4c4a
Compare
8f89fff
to
20ec32e
Compare
crates/engine/tree/src/tree/mod.rs
Outdated
let consistent_view = ConsistentDbView::new_with_latest_tip(self.provider.clone())?; | ||
|
||
let input = self | ||
.compute_trie_input(consistent_view.clone(), block.parent_hash) | ||
.map_err(|e| InsertBlockErrorKindTwo::Other(Box::new(e)))?; | ||
let state_root_config = | ||
StateRootConfig { consistent_view: consistent_view.clone(), input: Arc::new(input) }; | ||
let receiver_stream = StdReceiverStream::new(state_root_rx); | ||
let state_root_task = StateRootTask::new(state_root_config, receiver_stream); | ||
let state_root_handle = state_root_task.spawn(); | ||
let state_hook = move |result_and_state: &ResultAndState| { | ||
let _ = state_root_tx.send(result_and_state.state.clone()); | ||
}; |
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.
is this expected to instantiate a state root task each time, or is it expected that we spawn it once?
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.
yep, it is designed to instantiate one task per block. maybe we could get rid of the overhead of creating the task with a background service, similar to what we have for persistence, once everything is working correctly we can measure to compare both approaches
ffd4c4a
to
fde920f
Compare
4e45271
to
60a90c7
Compare
52e1366
to
2ffe7c8
Compare
c373aa2
to
256cd4d
Compare
8e7f598
to
e734d3f
Compare
fa4e2d1
to
b5f64dc
Compare
f982fa2
to
1665120
Compare
b5f64dc
to
a265490
Compare
7939f11
to
d8dea1f
Compare
a265490
to
885b439
Compare
4730fcb
to
fbc22f5
Compare
885b439
to
598aa99
Compare
fbc22f5
to
344a9b8
Compare
598aa99
to
c43f9fa
Compare
465e211
to
c04977e
Compare
34b74d7
to
b05a56d
Compare
2fa2c24
to
f71d25b
Compare
e6a8af7
to
5b9bd66
Compare
4e7256a
to
8975416
Compare
Towards #12053