Skip to content

Commit 50b4ba4

Browse files
committed
rename results operations
1 parent 5bd5581 commit 50b4ba4

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

engine/execution/state/bootstrap/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (b *Bootstrapper) BootstrapExecutionDatabase(
107107
return fmt.Errorf("could not index initial genesis execution block: %w", err)
108108
}
109109

110-
err = operation.IndexOwnOrSealedExecutionResult(lctx, rw, rootSeal.BlockID, rootSeal.ResultID)
110+
err = operation.IndexTrustedExecutionResult(lctx, rw, rootSeal.BlockID, rootSeal.ResultID)
111111
if err != nil {
112112
return fmt.Errorf("could not index result for root result: %w", err)
113113
}

state/protocol/badger/state.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ func bootstrapSealingSegment(
298298
if err != nil {
299299
return fmt.Errorf("could not insert execution result: %w", err)
300300
}
301-
err = operation.IndexOwnOrSealedExecutionResult(lctx, rw, result.BlockID, result.ID())
301+
err = operation.IndexTrustedExecutionResult(lctx, rw, result.BlockID, result.ID())
302302
if err != nil {
303303
return fmt.Errorf("could not index execution result: %w", err)
304304
}
@@ -457,7 +457,7 @@ func bootstrapSealingSegment(
457457
// If the sealed root block is different from the finalized root block, then it means the node dynamically
458458
// bootstrapped. In that case, we index the result of the latest sealed result, so that the EN is able
459459
// to confirm that it is loading the correct state to execute the next block.
460-
err = operation.IndexOwnOrSealedExecutionResult(lctx, rw, rootSeal.BlockID, rootSeal.ResultID)
460+
err = operation.IndexTrustedExecutionResult(lctx, rw, rootSeal.BlockID, rootSeal.ResultID)
461461
if err != nil {
462462
return fmt.Errorf("could not index root result: %w", err)
463463
}

storage/operation/receipts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ func RetrieveExecutionReceiptStub(r storage.Reader, receiptID flow.Identifier, m
2727
return RetrieveByKey(r, MakePrefix(codeExecutionReceiptMeta, receiptID), meta)
2828
}
2929

30-
// IndexOwnExecutionReceipt indexes the Execution Node's OWN execution receipt by the executed block ID.
30+
// IndexMyExecutionReceipt indexes the Execution Node's OWN execution receipt by the executed block ID.
3131
//
3232
// Error returns:
3333
// - [storage.ErrDataMismatch] if a *different* receipt has already been indexed for the same block
34-
func IndexOwnExecutionReceipt(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, receiptID flow.Identifier) error {
34+
func IndexMyExecutionReceipt(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, receiptID flow.Identifier) error {
3535
if !lctx.HoldsLock(storage.LockInsertMyReceipt) {
3636
return fmt.Errorf("cannot index own execution receipt without holding lock %s", storage.LockInsertMyReceipt)
3737
}

storage/operation/receipts_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestReceipts_Index(t *testing.T) {
4141

4242
err := storage.WithLock(lockManager, storage.LockInsertMyReceipt, func(lctx lockctx.Context) error {
4343
return db.WithReaderBatchWriter(func(rw storage.ReaderBatchWriter) error {
44-
return operation.IndexOwnExecutionReceipt(lctx, rw, blockID, expected)
44+
return operation.IndexMyExecutionReceipt(lctx, rw, blockID, expected)
4545
})
4646
})
4747
require.Nil(t, err)

storage/operation/results.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func RetrieveExecutionResult(r storage.Reader, resultID flow.Identifier, result
2727
return RetrieveByKey(r, MakePrefix(codeExecutionResult, resultID), result)
2828
}
2929

30-
// IndexOwnOrSealedExecutionResult indexes the result of the given block.
30+
// IndexTrustedExecutionResult indexes the result of the given block.
3131
// It is used by the following scenarios:
3232
// 1. Execution Node indexes its own executed block's result when finish executing a block
3333
// 2. Execution Node indexes the sealed root block's result during bootstrapping
@@ -36,7 +36,7 @@ func RetrieveExecutionResult(r storage.Reader, resultID flow.Identifier, result
3636
//
3737
// It returns [storage.ErrDataMismatch] if there is already an indexed result for the given blockID,
3838
// but it is different from the given resultID.
39-
func IndexOwnOrSealedExecutionResult(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, resultID flow.Identifier) error {
39+
func IndexTrustedExecutionResult(lctx lockctx.Proof, rw storage.ReaderBatchWriter, blockID flow.Identifier, resultID flow.Identifier) error {
4040
// during bootstrapping, we index the sealed root block or the spork root block, which is not
4141
// produced by the node itself, but we still need to index its execution result to be able to
4242
// execute next block

storage/store/my_receipts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (m *MyExecutionReceipts) BatchStoreMyReceipt(lctx lockctx.Proof, receipt *f
7777
}
7878

7979
// require [storage.LockInsertMyReceipt] to be held
80-
err = operation.IndexOwnExecutionReceipt(lctx, rw, blockID, receiptID)
80+
err = operation.IndexMyExecutionReceipt(lctx, rw, blockID, receiptID)
8181
if err != nil {
8282
return err
8383
}

storage/store/results.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func NewExecutionResults(collector module.CacheMetrics, db storage.DB) *Executio
5050
// this API is only used to fetch result for last executed block, so in happy case, it only need to be 1,
5151
// we use 100 here to be more resilient to forks
5252
withLimit[flow.Identifier, flow.Identifier](100),
53-
withStoreWithLock(operation.IndexOwnOrSealedExecutionResult),
53+
withStoreWithLock(operation.IndexTrustedExecutionResult),
5454
withRetrieve(retrieveByBlockID),
5555
),
5656
}

0 commit comments

Comments
 (0)