Skip to content

Commit

Permalink
add TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Oct 2, 2024
1 parent 0f4ebc0 commit 0becffb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions types/src/v0/impls/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,7 @@ mod test_headers {

#[async_std::test]
async fn test_validate_proposal_error_cases() {
// TODO add assertion for timestamp validation
let genesis = GenesisForTest::default().await;
let vid_common = vid_scheme(1).disperse([]).unwrap().common;

Expand Down
4 changes: 3 additions & 1 deletion types/src/v0/impls/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ pub fn validate_proposal(
}

// Validate timestamp increasing.
// TODO add test https://github.com/EspressoSystems/espresso-sequencer/issues/2100
if proposal.timestamp() < parent_header.timestamp() {
return Err(ProposalValidationError::InvalidTimestampNonIncrementing {
proposal_timestamp: proposal.timestamp(),
Expand Down Expand Up @@ -698,6 +699,7 @@ impl HotShotState<SeqTypes> for ValidatedState {
.expect("Chain Config not found in validated state");

// Validate l1_finalized.
// TODO add test https://github.com/EspressoSystems/espresso-sequencer/issues/2100
let proposed_finalized = proposed_header.l1_finalized();
let parent_finalized = parent_leaf.block_header().l1_finalized();
if proposed_finalized < parent_finalized {
Expand All @@ -718,8 +720,8 @@ impl HotShotState<SeqTypes> for ValidatedState {
return Err(BlockError::InvalidBlockHeader);
}
}

// Validate `l1_head`.
// TODO add test https://github.com/EspressoSystems/espresso-sequencer/issues/2100
if proposed_header.l1_head() < parent_leaf.block_header().l1_head() {
tracing::error!("Invalid proposal: l1_head decreasing");
return Err(BlockError::InvalidBlockHeader);
Expand Down

0 comments on commit 0becffb

Please sign in to comment.