Skip to content

Commit b302a21

Browse files
Add comments for protocol hash IDs and tags. (#2774)
Add comments for protocol hash IDs and tags
1 parent d010564 commit b302a21

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

protocol/hash.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ package protocol
2020
// This ensures, for example, the hash of a transaction will never collide with the hash of a vote
2121
type HashID string
2222

23-
// Hash IDs for specific object types, in lexicographic order to avoid dups.
23+
// Hash IDs for specific object types, in lexicographic order.
24+
// Hash IDs must be PREFIX-FREE (no hash ID is a prefix of another).
2425
const (
2526
AuctionBid HashID = "aB"
2627
AuctionDeposit HashID = "aD"

protocol/tags.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Tag string
2323
// Tags, in lexicographic sort order of tag values to avoid duplicates.
2424
// These tags must not contain a comma character because lists of tags
2525
// are encoded using a comma separator (see network/msgOfInterest.go).
26+
// The tags must be 2 bytes long.
2627
const (
2728
UnknownMsgTag Tag = "??"
2829
AgreementVoteTag Tag = "AV"

0 commit comments

Comments
 (0)