Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Substrate always attempts to finalize the parent of a finalized block, even if it's already finalized #12614

Closed
2 tasks done
kayabaNerve opened this issue Nov 4, 2022 · 1 comment
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.

Comments

@kayabaNerve
Copy link

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

// Ensure parent chain is finalized to maintain invariant that finality is called
// sequentially.
if finalized && parent_exists {
self.apply_finality_with_block_hash(
operation,
parent_hash,
None,
info.best_hash,
make_notifications,
)?;
}
is run regardless of the parent's status.

This is in-consequential as the finalization function will simply return in this case, yet it does so printing a warning:

if block == last_finalized {
warn!(
"Possible safety violation: attempted to re-finalize last finalized block {:?} ",
last_finalized
);
return Ok(())
}

As someone who is only importing finalized blocks, and finalizing every block, I'm forced to endure such errors regardless of not having any safety violation as I'm not the one attempting to finalize the same block multiple times.

Steps to reproduce

  • Have block A be imported and finalized
  • Import block B with justifications

Alternatively, the cluster-sm profile of https://github.com/serai-dex/serai/tree/tendermint/deploy can be run to see this happen in real time. While I was worried this was my fault, as I'm working on a Tendermint implementation, a patch to my Substrate tree confirmed this corrected the behavior.

@github-actions github-actions bot added the J2-unconfirmed Issue might be valid, but it’s not yet known. label Nov 4, 2022
@davxy
Copy link
Member

davxy commented Mar 2, 2023

Fixed by #12653

@davxy davxy closed this as completed Mar 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J2-unconfirmed Issue might be valid, but it’s not yet known.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants