@@ -43,7 +43,15 @@ func (node *Node) explorerMessageHandler(ctx context.Context, msg *msg_pb.Messag
43
43
Msg ("[Explorer] onCommitted unable to parse msg" )
44
44
return err
45
45
}
46
-
46
+ // If a future block is received, it logs a warning and discards the block
47
+ // TODO: can be done with isRightBlockNumAndViewID(recvMsg)
48
+ if current := node .Blockchain ().CurrentBlock ().NumberU64 (); recvMsg .BlockNum != current + 1 {
49
+ utils .Logger ().Debug ().
50
+ Uint64 ("Received BlockNum" , recvMsg .BlockNum ).
51
+ Uint64 ("Current Block Number" , current ).
52
+ Msg ("[Explorer] received a future block on COMMIT phase" )
53
+ return nil
54
+ }
47
55
aggSig , mask , err := node .Consensus .ReadSignatureBitmapPayload (
48
56
recvMsg .Payload , 0 ,
49
57
)
@@ -88,6 +96,15 @@ func (node *Node) explorerMessageHandler(ctx context.Context, msg *msg_pb.Messag
88
96
utils .Logger ().Error ().Err (err ).Msg ("[Explorer] Unable to parse Prepared msg" )
89
97
return err
90
98
}
99
+ // If a future block is received, it logs a warning and discards the block
100
+ // TODO: can be done with isRightBlockNumAndViewID(recvMsg)
101
+ if current := node .Blockchain ().CurrentBlock ().NumberU64 (); recvMsg .BlockNum != current + 1 {
102
+ utils .Logger ().Debug ().
103
+ Uint64 ("Received BlockNum" , recvMsg .BlockNum ).
104
+ Uint64 ("Current Block Number" , current ).
105
+ Msg ("[Explorer] received a future block on PREPARE phase" )
106
+ return nil
107
+ }
91
108
block , blockObj := recvMsg .Block , & types.Block {}
92
109
if err := rlp .DecodeBytes (block , blockObj ); err != nil {
93
110
utils .Logger ().Error ().Err (err ).Msg ("explorer could not rlp decode block" )
0 commit comments