parallelchain-io / hotstuff_rs

Rust implementation of the HotStuff consensus algorithm.
38 stars 5 forks source link

Clarify the different purposes of `<QuorumCertificate as Certificate>::is_correct` and `safe_qc` #47

Open lyulka opened 3 months ago

lyulka commented 3 months ago

Relevant version

HotStuff-rs v0.4

Problem

My understanding about these two functions is that:

However, there seems to be overlap in what is_correct and safe_qc does. In particular, the three conditional arms in is_correct noted in #46 seem to check things that really should be checked by safe_qc instead of is_correct.

Proposed solution

Hopefully the resolution for #46 will remove the three arms or at least mark the arms as unreachable. Then, we should try to document clearly what is_correct is for and what safe_qc is for. In particular, try to answer the following question from the perspective of user-code: when should I call is_correct, and when should I call safe_qc?