Skip to content

Commit f53da97

Browse files
committed
properly documented function in storage/operation/spork.go
1 parent 38f5ea4 commit f53da97

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

storage/operation/receipts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func InsertExecutionReceiptStub(w storage.Writer, receiptID flow.Identifier, met
1414
return UpsertByKey(w, MakePrefix(codeExecutionReceiptMeta, receiptID), meta)
1515
}
1616

17-
// RetrieveExecutionReceiptMeta retrieves a [flow.ExecutionReceiptStub] by its ID.
17+
// RetrieveExecutionReceiptStub retrieves a [flow.ExecutionReceiptStub] by its ID.
1818
//
1919
// Expected errors during normal operations:
2020
// - [storage.ErrNotFound] if no receipt stub with the specified ID is known.

storage/operation/spork.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@ import (
66
)
77

88
// IndexSporkRootBlock indexes the spork root block ID for the present spork.
9+
// A Node's state is strictly tied to a specific spork, and should never change during
10+
// the lifetime of the node. This values is inserted exactly once when bootstrapping the
11+
// state and should always be present for a properly bootstrapped node.
12+
// CAUTION: OVERWRITES existing data (potential for data corruption).
13+
// TODO: error if key already exists!
914
//
10-
// Error returns:
11-
// - generic error in case of unexpected failure from the database layer or encoding failure.
15+
// No errors are expected during normal operation.
1216
func IndexSporkRootBlock(w storage.Writer, blockID flow.Identifier) error {
1317
return UpsertByKey(w, MakePrefix(codeSporkRootBlockID), blockID)
1418
}
1519

16-
// RetrieveSporkRootBlockID retrieves the spork root block ID for the present spork.
17-
//
18-
// Error returns:
19-
// - generic error in case of unexpected failure from the database layer or encoding failure.
20+
// RetrieveSporkRootBlockID retrieves the spork root block's ID for the present spork, which this node is
21+
// participating in. A Node's state is strictly tied to a specific spork, and should never change during
22+
// the lifetime of the node.
23+
// This values is inserted exactly once when bootstrapping the state and should always be present for a
24+
// properly bootstrapped node.
25+
// No errors are expected during normal operation.
2026
func RetrieveSporkRootBlockID(r storage.Reader, blockID *flow.Identifier) error {
2127
return RetrieveByKey(r, MakePrefix(codeSporkRootBlockID), blockID)
2228
}

0 commit comments

Comments
 (0)