diff --git a/sequencer/src/genesis.rs b/sequencer/src/genesis.rs index 08d0184df6..f809bc49b1 100644 --- a/sequencer/src/genesis.rs +++ b/sequencer/src/genesis.rs @@ -140,6 +140,12 @@ mod upgrade_serialization { )) } (None, Some(v)) => { + if v.start_proposing_view < v.stop_proposing_view { + return Err(de::Error::custom( + "start_proposing_view is less than stop_proposing_view", + )); + } + map.insert( version, Upgrade { @@ -149,6 +155,14 @@ mod upgrade_serialization { ); } (Some(t), None) => { + if t.start_proposing_time.unix_timestamp() + < t.stop_proposing_time.unix_timestamp() + { + return Err(de::Error::custom( + "start_proposing_time is less than stop_proposing_time", + )); + } + map.insert( version, Upgrade { diff --git a/types/src/v0/v0_1/instance_state.rs b/types/src/v0/v0_1/instance_state.rs index 7e52eac6c4..c54860474c 100644 --- a/types/src/v0/v0_1/instance_state.rs +++ b/types/src/v0/v0_1/instance_state.rs @@ -86,7 +86,7 @@ impl Upgrade { config.start_proposing_time = t.start_proposing_time.unix_timestamp(); config.stop_proposing_time = t.stop_proposing_time.unix_timestamp(); config.start_voting_time = t.start_voting_time.unwrap_or_default().unix_timestamp(); - // this should not panmic because Timestamp::max() constructs the maximum possible Unix timestamp + // this should not panic because Timestamp::max() constructs the maximum possible Unix timestamp // using i64::MAX config.stop_voting_time = t .stop_voting_time