Skip to content
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

Open
wants to merge 1 commit into
base: parallelise_importer
Choose a base branch
from

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Feb 22, 2025

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 and await never was reached.

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.
@xgreenx xgreenx self-assigned this Feb 22, 2025
@xgreenx xgreenx added the no changelog Skip the CI check of the changelog modification label Feb 22, 2025
Copy link
Contributor

@AurelienFT AurelienFT left a 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;
Copy link
Contributor

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();
Copy link
Contributor

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Skip the CI check of the changelog modification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants