3

Correct me if i'm wrong: In GRANDPA, validators cast votes for the next finalized Block, which is as far as i understand the Block hash signed + metadata(round number,...etc).

My questions are:

  1. Are these votes included in the Block itself? if so is it in the justifications field?
  2. when a new validator joins the network or lets say a node crashed for a while and reconnected but missed some blocks and so he imports those blocks, does he check the justification of a block to verify its finality?

1 Answer 1

7

In GRANDPA there are two phases of voting per round: prevote and precommit. On a very high-level the first phase of voting will inform other participants on what they "expect" to finalize and it will, in some sense, limit what can be voted on to finalize in the next phase (precommit). As such, the actual finalization of blocks happens after the precommit phase is over. When a round concludes, a commit message is gossiped that includes all the precommits in the given round that justify a given block being finalized. This commit message is what is included as part of a GRANDPA justification, but additionally it may contain extra block headers that might be needed to verify the commit (since voters might have voted for forks that eventually get orphaned and those blocks might no longer be available on the network).

  1. Yes, the precommit votes are included as part of a justification. It exists in the justification field associated with a given block and not on the block itself.

  2. A validator will always verify any justification that comes attached with a block for its validity. Additionally, it will make sure that all blocks that change the authority set (end of session/era) include a finality justification. The node will only enact GRANDPA authority set changes when the block that triggered it is finalized.

It is important to take into account that due to the way GRANDPA works not all blocks are guaranteed to have a justification. Instead, the only blocks that must have a justification are the blocks changing authorities.

4
  • but how come a new validator that just joined the network can verify the finality of some blocks if they dont have justifications since they could be sometimes not included? and why is it that only when we have an authority change that we need a justification? what does this protect against? shouldn't all blocks be simply having the justifications?
    – dadzerlaze
    Commented Nov 19, 2022 at 7:35
  • GRANDPA stands apart from other Byzantine fault-tolerant (BFT) blockchain algorithms in that validators vote on chains, not blocks. So when a block contains a justification and the two previous blocks don't, the validator in your example can assume that the two previous blocks are finalized as well. And I think you are misunderstanding the sentence. The only blocks that must have a justification are the blocks changing authorities, but they are not the only blocks that can have a justification. @dadzerlaze Commented Nov 21, 2022 at 9:43
  • @DaanvanderPlas ah completely forgot about the chain thing, makes sense, though i wonder what other cases when you need justifications other then changing authorities?
    – dadzerlaze
    Commented Nov 22, 2022 at 6:00
  • Basically every GRANDPA round, to update the finality of the chain. Commented Feb 10, 2023 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.