Documentation ¶
Index ¶
- Constants
- func CommitDelta(ldg ledger.Ledger, ruh RegisterUpdatesHolder, baseState flow.StateCommitment) (flow.StateCommitment, *ledger.TrieUpdate, error)
- func IsBlockExecuted(ctx context.Context, state ReadOnlyExecutionState, block flow.Identifier) (bool, error)
- func NewLedgerStorageSnapshot(ldg ledger.Ledger, commitment flow.StateCommitment) snapshot.StorageSnapshot
- func RegisterEntriesToKeysValues(entries flow.RegisterEntries) ([]ledger.Key, []ledger.Value)
- func RegisterIDToKey(reg flow.RegisterID) ledger.Key
- type ExecutionState
- type LedgerStorageSnapshot
- type ReadOnlyExecutionState
- type RegisterUpdatesHolder
Constants ¶
View Source
const ( KeyPartOwner = uint16(0) // @deprecated - controller was used only by the very first // version of cadence for access controll which was retired later on // KeyPartController = uint16(1) KeyPartKey = uint16(2) )
Variables ¶
This section is empty.
Functions ¶
func CommitDelta ¶
func CommitDelta(ldg ledger.Ledger, ruh RegisterUpdatesHolder, baseState flow.StateCommitment) (flow.StateCommitment, *ledger.TrieUpdate, error)
func IsBlockExecuted ¶ added in v0.11.0
func IsBlockExecuted(ctx context.Context, state ReadOnlyExecutionState, block flow.Identifier) (bool, error)
IsBlockExecuted returns whether the block has been executed. it checks whether the state commitment exists in execution state.
func NewLedgerStorageSnapshot ¶ added in v0.30.0
func NewLedgerStorageSnapshot( ldg ledger.Ledger, commitment flow.StateCommitment, ) snapshot.StorageSnapshot
func RegisterEntriesToKeysValues ¶ added in v0.30.0
func RegisterIDToKey ¶ added in v0.10.0
func RegisterIDToKey(reg flow.RegisterID) ledger.Key
Types ¶
type ExecutionState ¶
type ExecutionState interface { ReadOnlyExecutionState UpdateHighestExecutedBlockIfHigher(context.Context, *flow.Header) error SaveExecutionResults( ctx context.Context, result *execution.ComputationResult, ) error }
ExecutionState is an interface used to access and mutate the execution state of the blockchain.
func NewExecutionState ¶
func NewExecutionState( ls ledger.Ledger, commits storage.Commits, blocks storage.Blocks, headers storage.Headers, collections storage.Collections, chunkDataPacks storage.ChunkDataPacks, results storage.ExecutionResults, myReceipts storage.MyExecutionReceipts, events storage.Events, serviceEvents storage.ServiceEvents, transactionResults storage.TransactionResults, db *badger.DB, tracer module.Tracer, ) ExecutionState
NewExecutionState returns a new execution state access layer for the given ledger storage.
type LedgerStorageSnapshot ¶ added in v0.30.0
type LedgerStorageSnapshot struct {
// contains filtered or unexported fields
}
TODO(patrick): revisit caching. readCache needs to be mutex guarded for parallel execution.
func (*LedgerStorageSnapshot) Get ¶ added in v0.30.0
func (storage *LedgerStorageSnapshot) Get( id flow.RegisterID, ) ( flow.RegisterValue, error, )
type ReadOnlyExecutionState ¶
type ReadOnlyExecutionState interface { // NewStorageSnapshot creates a new ready-only view at the given state commitment. NewStorageSnapshot(flow.StateCommitment) snapshot.StorageSnapshot // StateCommitmentByBlockID returns the final state commitment for the provided block ID. StateCommitmentByBlockID(context.Context, flow.Identifier) (flow.StateCommitment, error) // HasState returns true if the state with the given state commitment exists in memory HasState(flow.StateCommitment) bool // ChunkDataPackByChunkID retrieve a chunk data pack given the chunk ID. ChunkDataPackByChunkID(flow.Identifier) (*flow.ChunkDataPack, error) GetExecutionResultID(context.Context, flow.Identifier) (flow.Identifier, error) GetHighestExecutedBlockID(context.Context) (uint64, flow.Identifier, error) }
ReadOnlyExecutionState allows to read the execution state
type RegisterUpdatesHolder ¶ added in v0.16.0
type RegisterUpdatesHolder interface {
UpdatedRegisters() flow.RegisterEntries
}
Click to show internal directories.
Click to hide internal directories.