Skip to content

Commit 38f5ea4

Browse files
committed
clarifying difference between collection and collection Guarantee
1 parent 65049dc commit 38f5ea4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

storage/blocks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type Blocks interface {
6969
// TODO: this method is not available until next spork (mainnet27) or a migration that builds the index.
7070
// ByView(view uint64) (*flow.Header, error)
7171

72-
// ByCollectionID returns the block for the given collection ID.
72+
// ByCollectionID returns the block for the given [flow.CollectionGuarantee] ID.
7373
// This method is only available for collections included in finalized blocks.
7474
// While consensus nodes verify that collections are not repeated within the same fork,
7575
// each different fork can contain a recent collection once. Therefore, we must wait for

storage/operation/headers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func BlockExists(r storage.Reader, blockID flow.Identifier) (bool, error) {
124124
return KeyExists(r, MakePrefix(codeHeader, blockID))
125125
}
126126

127-
// IndexBlockContainingCollectionGuarantee produces a mapping from collection ID to the block ID containing this collection.
127+
// IndexBlockContainingCollectionGuarantee produces a mapping from the ID of a [flow.CollectionGuarantee] to the block ID containing this guarantee.
128128
//
129129
// CAUTION:
130130
// - The caller must acquire the lock ??? and hold it until the database write has been committed.
@@ -141,7 +141,7 @@ func IndexBlockContainingCollectionGuarantee(w storage.Writer, collID flow.Ident
141141
return UpsertByKey(w, MakePrefix(codeCollectionBlock, collID), blockID)
142142
}
143143

144-
// LookupBlockContainingCollectionGuarantee retrieves the block containing the collection with the given ID.
144+
// LookupBlockContainingCollectionGuarantee retrieves the block containing the [flow.CollectionGuarantee] with the given ID.
145145
//
146146
// CAUTION: A collection can be included in multiple *unfinalized* blocks. However, the implementation
147147
// assumes a one-to-one map from collection ID to a *single* block ID. This holds for FINALIZED BLOCKS ONLY

storage/store/blocks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (b *Blocks) ProposalByHeight(height uint64) (*flow.Proposal, error) {
179179
return b.retrieveProposal(blockID)
180180
}
181181

182-
// ByCollectionID returns the block for the given collection ID.
182+
// ByCollectionID returns the block for the given [flow.CollectionGuarantee] ID.
183183
// This method is only available for collections included in finalized blocks.
184184
// While consensus nodes verify that collections are not repeated within the same fork,
185185
// each different fork can contain a recent collection once. Therefore, we must wait for

0 commit comments

Comments
 (0)