-
Notifications
You must be signed in to change notification settings - Fork 10
chore(trie): Remove redundant generic lifetime for InitializationJob
#632
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
Changes from all commits
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ use crate::{ | |||||
| }; | ||||||
| use alloy_eips::BlockNumHash; | ||||||
| use alloy_primitives::B256; | ||||||
| use derive_more::Constructor; | ||||||
| use reth_db::{ | ||||||
| cursor::{DbCursorRO, DbDupCursorRO}, | ||||||
| tables, | ||||||
|
|
@@ -28,10 +29,10 @@ const INITIALIZE_STORAGE_THRESHOLD: usize = 100000; | |||||
| const INITIALIZE_LOG_THRESHOLD: usize = 100000; | ||||||
|
|
||||||
| /// Initialization job for external storage. | ||||||
| #[derive(Debug)] | ||||||
| pub struct InitializationJob<'a, Tx: DbTx, S: OpProofsStore + Send> { | ||||||
| #[derive(Debug, Constructor)] | ||||||
| pub struct InitializationJob<Tx: DbTx, S: OpProofsStore + Send> { | ||||||
| storage: S, | ||||||
| tx: &'a Tx, | ||||||
| tx: Tx, | ||||||
| } | ||||||
|
|
||||||
| /// Macro to generate simple cursor iterators for tables | ||||||
|
|
@@ -133,15 +134,14 @@ impl CompletionEstimatable for StoredNibbles { | |||||
| /// Initialize a table from a source iterator to a storage function. Handles batching and logging. | ||||||
| async fn initialize< | ||||||
| S: Iterator<Item = Result<(Key, Value), DatabaseError>>, | ||||||
| F: Future<Output = Result<(), OpProofsStorageError>> + Send, | ||||||
| Key: CompletionEstimatable + Clone + 'static, | ||||||
| Value: Clone + 'static, | ||||||
| >( | ||||||
| name: &str, | ||||||
| source: S, | ||||||
| storage_threshold: usize, | ||||||
| log_threshold: usize, | ||||||
| save_fn: impl Fn(Vec<(Key, Value)>) -> F, | ||||||
| save_fn: impl AsyncFnOnce(Vec<(Key, Value)>) -> Result<(), OpProofsStorageError> + Send + Copy, | ||||||
|
||||||
| save_fn: impl AsyncFnOnce(Vec<(Key, Value)>) -> Result<(), OpProofsStorageError> + Send + Copy, | |
| mut save_fn: impl AsyncFnMut(Vec<(Key, Value)>) -> Result<(), OpProofsStorageError> + Send, |
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.
OpProofsStorealready requiresSend + Sync(seecrates/optimism/trie/src/api.rs), so the additional+ Sendbound onShere is redundant. Dropping it would keep the new type signature as minimal as the PR intends.