Skip to content

fix(node/bft): suppress benign message about certificate already exis…#4284

Draft
kaimast wants to merge 1 commit into
testnetfrom
log/benign-cert-error
Draft

fix(node/bft): suppress benign message about certificate already exis…#4284
kaimast wants to merge 1 commit into
testnetfrom
log/benign-cert-error

Conversation

@kaimast

@kaimast kaimast commented May 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #4283 by introducing a CheckCertificateError type.

Comment thread node/bft/src/primary.rs
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()) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now caught by insert_certficate and handled appropriately below.

Comment thread node/bft/src/primary.rs
{
Ok(Ok(_)) => {} // continue
Ok(Err(err)) if err.is_benign() => {
trace!("Skipping insertion for certificate - {err}");

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this should even be logged, but it can always be removed in the future

}

// 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()) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant