File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
core/src/consensus/tendermint Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -1102,6 +1102,24 @@ impl Worker {
11021102 }
11031103
11041104 fn proposal_generated ( & mut self , sealed_block : & SealedBlock ) {
1105+ let proposal_height = sealed_block. header ( ) . number ( ) ;
1106+ let proposal_seal = sealed_block. header ( ) . seal ( ) ;
1107+ let proposal_view = TendermintSealView :: new ( proposal_seal)
1108+ . consensus_view ( )
1109+ . expect ( "Generated proposal should have a valid seal" ) ;
1110+ assert ! ( proposal_height <= self . height, "A proposal cannot be generated on the future height" ) ;
1111+ if proposal_height < self . height || ( proposal_height == self . height && proposal_view != self . view ) {
1112+ ctrace ! (
1113+ ENGINE ,
1114+ "Proposal is generated on the height {} and view {}. Current height is {} and view is {}" ,
1115+ proposal_height,
1116+ proposal_view,
1117+ self . height,
1118+ self . view,
1119+ ) ;
1120+ return
1121+ }
1122+
11051123 let header = sealed_block. header ( ) ;
11061124 let hash = header. hash ( ) ;
11071125 let parent_hash = header. parent_hash ( ) ;
@@ -1116,7 +1134,12 @@ impl Worker {
11161134 parent_hash, expected_parent_hash
11171135 ) ;
11181136 } else {
1119- panic ! ( "Block is generated at unexpected step {:?}" , self . step) ;
1137+ ctrace ! (
1138+ ENGINE ,
1139+ "Proposal is generated after step is changed. Expected step is ProposeWaitBlockGeneration but current step is {:?}" ,
1140+ self . step,
1141+ ) ;
1142+ return
11201143 }
11211144 let prev_proposer_idx = self . block_proposer_idx ( * parent_hash) . expect ( "Prev block must exists" ) ;
11221145
You can’t perform that action at this time.
0 commit comments