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 @@ -1098,6 +1098,24 @@ impl Worker {
1098
1098
}
1099
1099
1100
1100
fn proposal_generated ( & mut self , sealed_block : & SealedBlock ) {
1101
+ let proposal_height = sealed_block. header ( ) . number ( ) ;
1102
+ let proposal_seal = sealed_block. header ( ) . seal ( ) ;
1103
+ let proposal_view = TendermintSealView :: new ( proposal_seal)
1104
+ . consensus_view ( )
1105
+ . expect ( "Generated proposal should have a valid seal" ) ;
1106
+ assert ! ( proposal_height <= self . height, "A proposal cannot be generated on the future height" ) ;
1107
+ if proposal_height < self . height || ( proposal_height == self . height && proposal_view != self . view ) {
1108
+ ctrace ! (
1109
+ ENGINE ,
1110
+ "Proposal is generated on the height {} and view {}. Current height is {} and view is {}" ,
1111
+ proposal_height,
1112
+ proposal_view,
1113
+ self . height,
1114
+ self . view,
1115
+ ) ;
1116
+ return
1117
+ }
1118
+
1101
1119
let header = sealed_block. header ( ) ;
1102
1120
let hash = header. hash ( ) ;
1103
1121
let parent_hash = header. parent_hash ( ) ;
@@ -1112,7 +1130,12 @@ impl Worker {
1112
1130
parent_hash, expected_parent_hash
1113
1131
) ;
1114
1132
} else {
1115
- panic ! ( "Block is generated at unexpected step {:?}" , self . step) ;
1133
+ ctrace ! (
1134
+ ENGINE ,
1135
+ "Proposal is generated after step is changed. Expected step is ProposeWaitBlockGeneration but current step is {:?}" ,
1136
+ self . step,
1137
+ ) ;
1138
+ return
1116
1139
}
1117
1140
let prev_proposer_idx = self . block_proposer_idx ( * parent_hash) . expect ( "Prev block must exists" ) ;
1118
1141
You can’t perform that action at this time.
0 commit comments