-
Notifications
You must be signed in to change notification settings - Fork 1.9k
refactor(trie): remove proof task manager #18934
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
base: refactor/remove-factory-generic
Are you sure you want to change the base?
Changes from 10 commits
3516451
ed45ebd
d44180d
0b18f64
42ceedd
8e00a4a
2b90133
3f6400e
f302447
833b031
40bb506
e49791e
c02a68d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ use reth_trie::{ | |
}; | ||
use reth_trie_parallel::{ | ||
proof::ParallelProof, | ||
proof_task::{AccountMultiproofInput, ProofTaskKind, ProofTaskManagerHandle}, | ||
proof_task::{AccountMultiproofInput, ProofTaskManagerHandle}, | ||
root::ParallelStateRootError, | ||
}; | ||
use std::{ | ||
|
@@ -346,10 +346,9 @@ pub struct MultiproofManager { | |
pending: VecDeque<PendingMultiproofTask>, | ||
/// Executor for tasks | ||
executor: WorkloadExecutor, | ||
/// Handle to the proof task manager used for creating `ParallelProof` instances for storage | ||
/// proofs. | ||
/// Handle to the proof worker pool for storage proofs. | ||
storage_proof_task_handle: ProofTaskManagerHandle, | ||
/// Handle to the proof task manager used for account multiproofs. | ||
/// Handle to the proof worker pool for account multiproofs. | ||
account_proof_task_handle: ProofTaskManagerHandle, | ||
|
||
/// Cached storage proof roots for missed leaves; this maps | ||
/// hashed (missed) addresses to their storage proof roots. | ||
|
@@ -556,15 +555,10 @@ impl MultiproofManager { | |
missed_leaves_storage_roots, | ||
}; | ||
|
||
let (sender, receiver) = channel(); | ||
let proof_result: Result<DecodedMultiProof, ParallelStateRootError> = (|| { | ||
account_proof_task_handle | ||
.queue_task(ProofTaskKind::AccountMultiproof(input, sender)) | ||
.map_err(|_| { | ||
ParallelStateRootError::Other( | ||
"Failed to queue account multiproof to worker pool".into(), | ||
) | ||
})?; | ||
let receiver = account_proof_task_handle | ||
.queue_account_multiproof(input) | ||
.map_err(|e| ParallelStateRootError::Other(e.to_string()))?; | ||
|
||
receiver | ||
.recv() | ||
|
@@ -1223,7 +1217,7 @@ mod tests { | |
DatabaseProviderFactory, | ||
}; | ||
use reth_trie::{MultiProof, TrieInput}; | ||
use reth_trie_parallel::proof_task::{ProofTaskCtx, ProofTaskManager}; | ||
use reth_trie_parallel::proof_task::{spawn_proof_workers, ProofTaskCtx}; | ||
use revm_primitives::{B256, U256}; | ||
|
||
fn create_test_state_root_task<F>(factory: F) -> MultiProofTask | ||
|
@@ -1238,12 +1232,12 @@ mod tests { | |
config.prefix_sets.clone(), | ||
); | ||
let consistent_view = ConsistentDbView::new(factory, None); | ||
let proof_task = | ||
ProofTaskManager::new(executor.handle().clone(), consistent_view, task_ctx, 1, 1) | ||
.expect("Failed to create ProofTaskManager"); | ||
let proof_handle = | ||
spawn_proof_workers(executor.handle().clone(), consistent_view, task_ctx, 1, 1) | ||
.expect("Failed to spawn proof workers"); | ||
let channel = channel(); | ||
|
||
MultiProofTask::new(config, executor, proof_task.handle(), channel.0, 1, None) | ||
MultiProofTask::new(config, executor, proof_handle, channel.0, 1, None) | ||
} | ||
|
||
#[test] | ||
|
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 just
.max(MIN_WORKER_COUNT)
? Let's move this towith_*_worker_count
functions, no need to have a separate helper fn for this