Skip to content

Commit

Permalink
docs: document the start/end row in row proof (#1473)
Browse files Browse the repository at this point in the history
## Description

Adds a simple documentation to the start row and end row fields in row
proof to show that they're not used for verification. But if anyone is
using them downstream, they should validate them themselves
  • Loading branch information
rach-id authored Sep 20, 2024
1 parent 0abc1de commit 4392e84
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions types/row_proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ type RowProof struct {
RowRoots []tmbytes.HexBytes `json:"row_roots"`
// Proofs is a list of Merkle proofs where each proof proves that a row
// exists in a Merkle tree with a given data root.
Proofs []*merkle.Proof `json:"proofs"`
StartRow uint32 `json:"start_row"`
EndRow uint32 `json:"end_row"`
Proofs []*merkle.Proof `json:"proofs"`
// StartRow the index of the start row.
// Note: currently, StartRow is not validated as part of the proof verification.
// If this field is used downstream, Validate(root) should be called along with
// extra validation depending on how it's used.
StartRow uint32 `json:"start_row"`
// EndRow the index of the end row.
// Note: currently, EndRow is not validated as part of the proof verification.
// If this field is used downstream, Validate(root) should be called along with
// extra validation depending on how it's used.
EndRow uint32 `json:"end_row"`
}

// Validate performs checks on the fields of this RowProof. Returns an error if
Expand Down

0 comments on commit 4392e84

Please sign in to comment.