fix(node/bft): suppress benign message about certificate already exis…#4284
Draft
kaimast wants to merge 1 commit into
Draft
fix(node/bft): suppress benign message about certificate already exis…#4284kaimast wants to merge 1 commit into
kaimast wants to merge 1 commit into
Conversation
kaimast
commented
May 29, 2026
| self.sync_with_batch_header_from_peer::<IS_SYNCING, false>(peer_ip, batch_header).await?; | ||
|
|
||
| // Check if the certificate needs to be stored. | ||
| if !self.storage.contains_certificate(certificate.id()) { |
Contributor
Author
There was a problem hiding this comment.
This is now caught by insert_certficate and handled appropriately below.
kaimast
commented
May 29, 2026
| { | ||
| Ok(Ok(_)) => {} // continue | ||
| Ok(Err(err)) if err.is_benign() => { | ||
| trace!("Skipping insertion for certificate - {err}"); |
Contributor
Author
There was a problem hiding this comment.
Not sure if this should even be logged, but it can always be removed in the future
kaimast
commented
May 29, 2026
| } | ||
|
|
||
| // Ensure the storage does not already contain a certificate for this author in this round. | ||
| if self.contains_certificate_in_round_from(round, certificate.author()) { |
Contributor
Author
There was a problem hiding this comment.
These subsequent checks happen without any locking. Otherwise, this second check would only trigger if there are two certificates with same author+round with different IDs.
It would make sense to merge the two checks to at least do this part atomically, and have a dedicated error for the more severe case where two certificates with different IDs exist.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4283 by introducing a
CheckCertificateErrortype.