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

Properly bubble up InsertBlockFatalError #10219

Closed
Tracked by #8742
Rjected opened this issue Aug 8, 2024 · 3 comments · Fixed by #10276
Closed
Tracked by #8742

Properly bubble up InsertBlockFatalError #10219

Rjected opened this issue Aug 8, 2024 · 3 comments · Fixed by #10276
Assignees
Labels
A-engine Related to the engine implementation C-enhancement New feature or request

Comments

@Rjected
Copy link
Member

Rjected commented Aug 8, 2024

ref #10217 (review)

We need to introduce a way to handle any fatal errors that were encountered when calling insert_block.

This happens in two places not already handled, first in on_downloaded_block:

Err(err) => {
debug!(target: "engine", err=%err.kind(), "failed to insert downloaded block");
if let Err(fatal) = self.on_insert_block_error(err) {
warn!(target: "engine", %fatal, "fatal error occurred while inserting downloaded block");
}
}

And in try_connect_buffered_blocks:

if let Err(fatal) = self.on_insert_block_error(err) {
warn!(target: "engine", %fatal, "fatal error occurred while connecting buffered blocks");
}

on_backfill_sync_finished calls try_connect_buffered_blocks here:

self.on_engine_message(msg);

The other call to try_connect_buffered_blocks is here:

self.try_connect_buffered_blocks(block_num_hash);

However, we need to bubble the error in this method anyways or include it in TreeEvent somehow, because we call insert_block here and need to handle the error:

Err(err) => {
debug!(target: "engine", err=%err.kind(), "failed to insert downloaded block");
if let Err(fatal) = self.on_insert_block_error(err) {
warn!(target: "engine", %fatal, "fatal error occurred while inserting downloaded block");
}
}

@Rjected Rjected added C-enhancement New feature or request A-engine Related to the engine implementation labels Aug 8, 2024
@martinezjorge
Copy link
Contributor

Is anyone on this? Could I take a stab at it?

@Rjected
Copy link
Member Author

Rjected commented Aug 9, 2024

Is anyone on this? Could I take a stab at it?

assigned! let me know if you have any questions or need review

@rkrasiuk
Copy link
Member

@Rjected emitting a fatal event is not ideal. we should properly bubble it up. @martinezjorge feel free to change the return types of methods in the flow in question

@github-project-automation github-project-automation bot moved this from Todo to Done in Reth Tracker Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-engine Related to the engine implementation C-enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants