Skip to content

Commit b83bb43

Browse files
committed
clarify ForkEquivocationProof::check's params
1 parent 32ca8ad commit b83bb43

File tree

1 file changed

+8
-2
lines changed
  • substrate/primitives/consensus/beefy/src

1 file changed

+8
-2
lines changed

substrate/primitives/consensus/beefy/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,9 @@ impl<Id: RuntimeAppPublic, Header: HeaderT, Hash: HashOutput>
408408
/// Validates [ForkEquivocationProof] with the following checks:
409409
/// - if the commitment is to a block in our history, then at least a header or an ancestry
410410
/// proof is provided:
411-
/// - the proof is correct if the provided `canonical_header` is at height
412-
/// `commitment.block_number` and `commitment.payload` != `canonical_payload(canonical_header)`
411+
/// - the proof is correct if `self.canonical_header` hashes to `canonical_header_hash`, is at
412+
/// height `commitment.block_number`, and `commitment.payload` !=
413+
/// `canonical_payload(canonical_header)`
413414
/// - the proof is correct if the provided `ancestry_proof` proves
414415
/// `mmr_root(commitment.block_number) != mmr_root(commitment.payload)`
415416
/// - `commitment` is signed by all claimed signatories
@@ -423,10 +424,15 @@ impl<Id: RuntimeAppPublic, Header: HeaderT, Hash: HashOutput>
423424
/// be finalized by GRANDPA.
424425
pub fn check<MsgHash: HashT, NodeHash: HashT<Output = Hash>>(
425426
&self,
427+
// The MMR root of the best block of the chain where this proof is submitted.
426428
best_root: Hash,
429+
// The size of the MMR at the best block.
427430
mmr_size: u64,
431+
// The hash of the canonical header at the height of `commitment.block_number`.
428432
canonical_header_hash: &Header::Hash,
433+
// The block number at which the mmr pallet was added to the runtime.
429434
first_mmr_block_num: Header::Number,
435+
// The best block number of the chain where this proof is submitted.
430436
best_block_num: Header::Number,
431437
) -> bool
432438
where

0 commit comments

Comments
 (0)