-
Notifications
You must be signed in to change notification settings - Fork 69
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
Validation bugfix #2089
Validation bugfix #2089
Conversation
types/src/v0/impls/state.rs
Outdated
@@ -663,6 +695,41 @@ impl HotShotState<SeqTypes> for ValidatedState { | |||
.resolve() | |||
.expect("Chain Config not found in validated state"); | |||
|
|||
// Validate l1_finalized. | |||
let Some(proposed_finalized) = proposed_header.l1_finalized() else { | |||
tracing::error!("L1 finalized has None value."); |
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.
Does this mean the proposer proposed an invalid block? I think in that case this should be warn
at most? We should only log error
if this is something unexpected and/or it's worth waking people up for.
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.
appears to have been addressed here: 8f0d229
types/src/v0/impls/state.rs
Outdated
return Err(BlockError::InvalidBlockHeader); | ||
}; | ||
|
||
let parent_finalized = parent_leaf.block_header().l1_finalized().unwrap().number(); |
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 we're not adding tests now please open an issue for that (if we don't have it already) and link it in the code.
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.
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.
LGTM, some nits.
validate l1_head is incrementing
also avoid hitting timestamp validation in previously existing test (for the time being).
Also allow equality
* fix timestamp validation * fix system_time field in Error variant
Use this method in validation and in `wait_for_l1_finalized`.
This way we can tell which one failed
Co-authored-by: Mathis <sveitser@gmail.com>
adb3cd3
to
0f4ebc0
Compare
Adds missing validation steps * validate timestamp (against system time and previous block) * wait for l1_finalized * wait for l1_head * validate blocks are not decrementing * small update to pee-existing tests to avoid hitting these cases * adds TODOs for followups --------- Co-authored-by: tbro <tbro@users.noreply.github.com> Co-authored-by: Jeb Bearer <jeb@espressosys.com> Co-authored-by: Mathis <sveitser@gmail.com>
Closes #2088
Closes #968
This PR:
Adds validation to replicas.