-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[wip] feat: parallelize recovery #20169
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: main
Are you sure you want to change the base?
Conversation
|
Your PR title doesn't follow the Conventional Commit guidelines. Example of valid titles:
Usage:
Breaking Changes Breaking changes are noted by using an exclamation mark. For example:
Help For more information, follow the guidelines here: https://www.conventionalcommits.org/en/v1.0.0/ |
mattsse
left a comment
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 makes a lot of sense and is way easier than what I previously attempted
smol suggestion and a doc nit
we might also want to take the avail cores into account here but unsure because rayon already handles the bridging based on available threads
| /// Raw transaction that can be converted to an [`ExecutableTxIterator::Tx`] | ||
| type RawTx: Send + Sync + 'static; |
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 think we should highlight here that this can be anything as long as the the converter can map this into the Tx type
| while queue.first_key_value().is_some_and(|(idx, _)| *idx == next_for_execution) | ||
| { | ||
| let _ = execute_tx.send(queue.pop_first().unwrap().1); | ||
| next_for_execution += 1; | ||
| } | ||
| } else { | ||
| queue.insert(idx, tx); | ||
| } |
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'd like to replace this with while over first_entry
| let iter = Either::Left(iter.into_iter().map(Either::Left)); | ||
| let convert = move |tx| { | ||
| let Either::Left(tx) = tx else { unreachable!() }; | ||
| convert(tx).map(Either::Left).map_err(Either::Left) | ||
| }; | ||
|
|
||
| Ok(( | ||
| iter, | ||
| Box::new(convert) | ||
| as Box< | ||
| dyn Fn(Either<_, _>) -> Result<Either<_, _>, _> + Send + Sync + 'static, | ||
| >, | ||
| )) | ||
| } | ||
| BlockOrPayload::Block(block) => { |
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.
since this step looks slightly confusing, I think some additional docs would be helpful here
No description provided.