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

feat: don't stop the pipeline on internal stage errs #453

Merged
merged 7 commits into from
Dec 15, 2022

Conversation

onbjerg
Copy link
Collaborator

@onbjerg onbjerg commented Dec 15, 2022

Differentiate between fatal errors that should stop the pipeline because no progress can be made, and errors that are recoverable. Stages should feel free to emit errors to make unit testing them easier, and the pipeline should catch them, evaluate if they are fatal or not and act accordingly

@onbjerg onbjerg added C-enhancement New feature or request A-staged-sync Related to staged sync (pipelines and stages) labels Dec 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2022

Codecov Report

❗ No coverage uploaded for pull request base (main@7b6bf08). Click here to learn what that means.
The diff coverage is 76.92%.

@@           Coverage Diff           @@
##             main     #453   +/-   ##
=======================================
  Coverage        ?   74.09%           
=======================================
  Files           ?      239           
  Lines           ?    23225           
  Branches        ?        0           
=======================================
  Hits            ?    17208           
  Misses          ?     6017           
  Partials        ?        0           
Impacted Files Coverage Δ
crates/stages/src/pipeline.rs 95.42% <75.00%> (ø)
crates/stages/src/error.rs 50.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@onbjerg
Copy link
Collaborator Author

onbjerg commented Dec 15, 2022

Discussion on whether StageError::Internal should be fatal or not: #457

@onbjerg onbjerg force-pushed the onbjerg/pipeline-stage-errs branch from 9a66b07 to 5a8ad6c Compare December 15, 2022 10:09
@onbjerg onbjerg marked this pull request as ready for review December 15, 2022 10:55
Copy link
Member

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - nits.

@@ -21,6 +21,7 @@ pub enum StageError {
Database(#[from] DbError),
#[error("Stage encountered a execution error in block {block}: {error}.")]
/// The stage encountered a execution error
// TODO: Probably redundant, should be rolled into `Validation`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

crates/stages/src/stages/bodies.rs Outdated Show resolved Hide resolved
crates/stages/src/stages/headers.rs Show resolved Hide resolved
@@ -28,6 +28,7 @@ pub struct SendersStage {
pub commit_threshold: u64,
}

// TODO(onbjerg): Should unwind
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which cases?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All cases I think. If we can't recover the sender then the transaction is invalid (assuming our recover algo is not broken)

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
@onbjerg onbjerg merged commit f8b4251 into main Dec 15, 2022
@onbjerg onbjerg deleted the onbjerg/pipeline-stage-errs branch December 15, 2022 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-staged-sync Related to staged sync (pipelines and stages) C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants