-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Dedicated threads for the block importer #2750
base: parallelise_importer
Are you sure you want to change the base?
Dedicated threads for the block importer #2750
Conversation
Removed cloning of teh block and utilized the feature of rayon runtime with scoped parallel jobs execution. Moved code to catch `InvalidDatabaseStateAfterExecution` to the right place. Removed requirements from the database to be modifiable. Fixed the not working `async` part of the block importer. Before importing of the block were blocking the tokio task and `await` never was reached.
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 like the refactor, I was wondering if the LocalRunner with 1 thread would have been an issue when parallel-executor would have been added but I don't think so. So i'm fine
@@ -167,6 +167,8 @@ async fn _gas_price_updater__can_recover_on_startup_when_gas_price_db_is_behind( | |||
Some(BlockHeight::new(height)) | |||
); | |||
|
|||
tokio::time::sleep(std::time::Duration::from_millis(20)).await; |
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.
Do you want to sneak this change or it's leftover ?
@@ -50,7 +50,7 @@ async fn poa_instant_trigger_is_produces_instantly() { | |||
) | |||
.add_fee_input() | |||
.finalize_as_transaction(); | |||
let _tx_id = client.submit(&tx).await.unwrap(); | |||
let _tx_id = client.submit_and_await_commit(&tx).await.unwrap(); |
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.
Do you want to sneak this change or it's leftover ?
Removed cloning of the block and utilized the feature of rayon runtime with scoped parallel jobs execution.
Moved code to catch
InvalidDatabaseStateAfterExecution
to the right place.Removed requirements from the database to be modifiable.
Fixed the not working
async
part of the block importer. Before importing of the block were blocking the tokio task andawait
never was reached.