Skip to content

Commit e400653

Browse files
committed
update comments
1 parent eb53f71 commit e400653

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

storage/store/proposal_signatures.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ func newProposalSignatures(collector module.CacheMetrics, db storage.DB) *propos
4747
// CAUTION:
4848
// - The caller must acquire either the lock [storage.LockInsertBlock] or [storage.LockInsertOrFinalizeClusterBlock]
4949
// but not both and hold the lock until the database write has been committed.
50-
// - The lock proof serves as a reminder that the CALLER is responsible to ensure that the DEDUPLICATION CHECK
51-
// is done elsewhere ATOMICALLY with this write operation. It is intended that this function is called only for new
52-
// blocks, i.e. no signature was previously persisted for it.
50+
// - OVERWRITES existing data (potential for data corruption):
51+
// The lock proof serves as a reminder that the CALLER is responsible to ensure that the DEDUPLICATION CHECK is done elsewhere
52+
// ATOMICALLY within this write operation. Currently it's done by operation.InsertHeader where it performs a check
53+
// to ensure the blockID is new, therefore any data indexed by this blockID is new as well.
5354
//
5455
// No error returns expected during normal operations.
5556
func (h *proposalSignatures) storeTx(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, sig []byte) error {

storage/store/protocol_kv_store.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ func (s *ProtocolKVStore) BatchStore(rw storage.ReaderBatchWriter, stateID flow.
104104
//
105105
// CAUTION:
106106
// - The caller must acquire the lock [storage.LockInsertBlock] and hold it until the database write has been committed.
107+
// - OVERWRITES existing data (potential for data corruption):
108+
// The lock proof serves as a reminder that the CALLER is responsible to ensure that the DEDUPLICATION CHECK is done elsewhere
109+
// ATOMICALLY within this write operation. Currently it's done by operation.InsertHeader where it performs a check
110+
// to ensure the blockID is new, therefore any data indexed by this blockID is new as well.
107111
//
108112
// Expected errors during normal operations:
109113
// - [storage.ErrAlreadyExist] if a KV store for the given blockID has already been indexed.

0 commit comments

Comments
 (0)