Discard equivocated round when processing notarizations - #457
Conversation
ab103ae to
6922dc1
Compare
|
|
||
| if round.finalization != nil { | ||
| e.Logger.Debug("Received finalization for an already finalized round", zap.Uint64("round", message.Finalization.Round)) | ||
| if err := e.storeFinalization(message); err != nil { |
There was a problem hiding this comment.
if we receive a valid finalization, but the leader equivocated shouldn't we trigger replication?
| zap.Uint64("round", roundNum), | ||
| zap.Stringer("block header", &expectedBlockHeader), | ||
| zap.Stringer("finalized block header", &finalization.Finalization.BlockHeader)) | ||
| delete(e.rounds, roundNum) |
There was a problem hiding this comment.
hmm, I'm wondering if anything bad can happen if we delete the round.
Maybe a couple things? For instance we could have already progressed to the next round and incremented e.round. This means we will have no entry in the rounds map, and we may have no entry in the empty rounds map so I wonder if any lookup breaks.
Also if we restart the node it will re-set the rounds map when we read from the wal. But I don't think this is an issue
There was a problem hiding this comment.
we can't progress to the next round at the point where we delete the round because we discard the notarization.
There was a problem hiding this comment.
Also if we restart the node it will re-set the rounds map when we read from the wal. But I don't think this is an issue
It will simply delete the round once more, but in order to have a higher round than that, it will need to replicate the round, no? so it will eventually overwrite the rounds map when it reloads the WAL.
But good point, I should make a UT that checks this.
c8dc152 to
5b282a6
Compare
When receiving a finalization, check if the block received beforehand corresponds to the received finalization, and if not, delete the round. Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
When receiving a notarization, check if the block received beforehand corresponds to the received notarization, and if not, delete the round. Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
5f18372 to
cab5e29
Compare
Co-authored-by: Sam Liokumovich <65994425+samliok@users.noreply.github.com> Signed-off-by: yacovm <yacovm@users.noreply.github.com>
986dfd9 to
7dc9a2f
Compare
When receiving a notarization, check if the block received beforehand corresponds to the received notarization, and if not, delete the round.