Documentation
¶
Index ¶
- func CompareRegisterIDs(a flow.RegisterID, b flow.RegisterID) int
- func GetAccessAPIBlockHeader(ctx context.Context, client access.AccessAPIClient, blockID flow.Identifier) (*flow.Header, error)
- func GetHeapAllocsBytes() uint64
- func SortRegisterEntries(registerEntries []flow.RegisterEntry)
- func SortRegisterIDs(registerIDs []flow.RegisterID)
- func WriteResult(w io.Writer, id flow.Identifier, result Result)
- type CachingStorageSnapshot
- type CapturingStorageSnapshot
- type ExecutionDataRemoteClient
- type ExecutionDataStorageSnapshot
- type ExecutionNodeRemoteClient
- type ExecutionNodeStorageSnapshot
- type FileRegisterCache
- type InMemoryRegisterCache
- type InterestingCadenceSpanExporter
- type RegisterCache
- type RemoteClient
- type RemoteDebugger
- func (d *RemoteDebugger) RunSDKTransaction(tx *sdk.Transaction, snapshot StorageSnapshot, header *flow.Header, ...) (Result, error)
- func (d *RemoteDebugger) RunScript(code []byte, arguments [][]byte, snapshot StorageSnapshot, ...) (Result, error)
- func (d *RemoteDebugger) RunTransaction(txBody *flow.TransactionBody, snapshot StorageSnapshot, ...) (Result, error)
- type Result
- type StorageSnapshot
- type UpdatableStorageSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareRegisterIDs ¶
func CompareRegisterIDs(a flow.RegisterID, b flow.RegisterID) int
func GetAccessAPIBlockHeader ¶ added in v0.38.0
func GetAccessAPIBlockHeader( ctx context.Context, client access.AccessAPIClient, blockID flow.Identifier, ) (*flow.Header, error)
func GetHeapAllocsBytes ¶ added in v0.27.0
func GetHeapAllocsBytes() uint64
GetHeapAllocsBytes returns the value of /gc/heap/allocs:bytes.
func SortRegisterEntries ¶
func SortRegisterEntries(registerEntries []flow.RegisterEntry)
func SortRegisterIDs ¶
func SortRegisterIDs(registerIDs []flow.RegisterID)
func WriteResult ¶
func WriteResult(w io.Writer, id flow.Identifier, result Result)
Types ¶
type CachingStorageSnapshot ¶
type CachingStorageSnapshot struct {
// contains filtered or unexported fields
}
CachingStorageSnapshot is a storage snapshot that caches register values in memory to avoid repeated calls to the backing snapshot.
func NewCachingStorageSnapshot ¶
func NewCachingStorageSnapshot(backing StorageSnapshot) *CachingStorageSnapshot
func (*CachingStorageSnapshot) Get ¶
func (s *CachingStorageSnapshot) Get(id flow.RegisterID) (flow.RegisterValue, error)
func (*CachingStorageSnapshot) Set ¶
func (s *CachingStorageSnapshot) Set(id flow.RegisterID, value flow.RegisterValue)
type CapturingStorageSnapshot ¶
type CapturingStorageSnapshot struct {
Reads []struct {
flow.RegisterID
flow.RegisterValue
}
Writes []struct {
flow.RegisterID
flow.RegisterValue
}
// contains filtered or unexported fields
}
func NewCapturingStorageSnapshot ¶
func NewCapturingStorageSnapshot(backing StorageSnapshot) *CapturingStorageSnapshot
func (*CapturingStorageSnapshot) Get ¶
func (s *CapturingStorageSnapshot) Get(id flow.RegisterID) (flow.RegisterValue, error)
func (*CapturingStorageSnapshot) Set ¶
func (s *CapturingStorageSnapshot) Set(id flow.RegisterID, value flow.RegisterValue)
type ExecutionDataRemoteClient ¶
type ExecutionDataRemoteClient struct {
// contains filtered or unexported fields
}
ExecutionDataRemoteClient is a remote client that connects to an access node and uses the execution data API to fetch execution data.
func NewExecutionDataRemoteClient ¶
func NewExecutionDataRemoteClient(address string) (*ExecutionDataRemoteClient, error)
func (*ExecutionDataRemoteClient) Close ¶
func (c *ExecutionDataRemoteClient) Close() error
func (*ExecutionDataRemoteClient) StorageSnapshot ¶
func (c *ExecutionDataRemoteClient) StorageSnapshot(blockHeight uint64, _ flow.Identifier) (snapshot.StorageSnapshot, error)
type ExecutionDataStorageSnapshot ¶ added in v0.38.0
type ExecutionDataStorageSnapshot struct {
Client executiondata.ExecutionDataAPIClient
BlockHeight uint64
}
ExecutionDataStorageSnapshot provides a storage snapshot connected to an access node to read the registers (via its execution data API).
func NewExecutionDataStorageSnapshot ¶ added in v0.38.0
func NewExecutionDataStorageSnapshot( client executiondata.ExecutionDataAPIClient, blockHeight uint64, ) ( *ExecutionDataStorageSnapshot, error, )
func (*ExecutionDataStorageSnapshot) Close ¶ added in v0.38.0
func (snapshot *ExecutionDataStorageSnapshot) Close() error
func (*ExecutionDataStorageSnapshot) Get ¶ added in v0.38.0
func (snapshot *ExecutionDataStorageSnapshot) Get( id flow.RegisterID, ) ( value flow.RegisterValue, err error, )
type ExecutionNodeRemoteClient ¶
type ExecutionNodeRemoteClient struct {
// contains filtered or unexported fields
}
ExecutionNodeRemoteClient is a remote client that connects to an execution node and uses the execution API to fetch execution data.
func NewExecutionNodeRemoteClient ¶
func NewExecutionNodeRemoteClient(address string) (*ExecutionNodeRemoteClient, error)
func (*ExecutionNodeRemoteClient) Close ¶
func (c *ExecutionNodeRemoteClient) Close() error
func (*ExecutionNodeRemoteClient) StorageSnapshot ¶
func (c *ExecutionNodeRemoteClient) StorageSnapshot(_ uint64, blockID flow.Identifier) (snapshot.StorageSnapshot, error)
type ExecutionNodeStorageSnapshot ¶ added in v0.38.0
type ExecutionNodeStorageSnapshot struct {
Client execution.ExecutionAPIClient
BlockID flow.Identifier
}
ExecutionNodeStorageSnapshot provides a storage snapshot connected to an execution node to read the registers.
func NewExecutionNodeStorageSnapshot ¶ added in v0.38.0
func NewExecutionNodeStorageSnapshot( client execution.ExecutionAPIClient, blockID flow.Identifier, ) ( *ExecutionNodeStorageSnapshot, error, )
func (*ExecutionNodeStorageSnapshot) Close ¶ added in v0.38.0
func (snapshot *ExecutionNodeStorageSnapshot) Close() error
func (*ExecutionNodeStorageSnapshot) Get ¶ added in v0.38.0
func (snapshot *ExecutionNodeStorageSnapshot) Get( id flow.RegisterID, ) ( value flow.RegisterValue, err error, )
type FileRegisterCache ¶ added in v0.38.0
type FileRegisterCache struct {
// contains filtered or unexported fields
}
func NewFileRegisterCache ¶ added in v0.38.0
func NewFileRegisterCache(filePath string) (*FileRegisterCache, error)
func (*FileRegisterCache) Get ¶ added in v0.38.0
func (c *FileRegisterCache) Get(owner, key string) ([]byte, bool)
func (*FileRegisterCache) Persist ¶ added in v0.38.0
func (c *FileRegisterCache) Persist() error
func (*FileRegisterCache) Set ¶ added in v0.38.0
func (c *FileRegisterCache) Set(owner, key string, value []byte)
type InMemoryRegisterCache ¶ added in v0.38.0
type InMemoryRegisterCache struct {
// contains filtered or unexported fields
}
func NewInMemoryRegisterCache ¶ added in v0.38.0
func NewInMemoryRegisterCache() *InMemoryRegisterCache
func (*InMemoryRegisterCache) Get ¶ added in v0.38.0
func (c *InMemoryRegisterCache) Get(owner, key string) ([]byte, bool)
func (*InMemoryRegisterCache) Persist ¶ added in v0.38.0
func (c *InMemoryRegisterCache) Persist() error
func (*InMemoryRegisterCache) Set ¶ added in v0.38.0
func (c *InMemoryRegisterCache) Set(owner, key string, value []byte)
type InterestingCadenceSpanExporter ¶
type InterestingCadenceSpanExporter struct {
Spans []otelTrace.ReadOnlySpan
}
func (*InterestingCadenceSpanExporter) ExportSpans ¶
func (s *InterestingCadenceSpanExporter) ExportSpans(_ context.Context, spans []otelTrace.ReadOnlySpan) error
func (*InterestingCadenceSpanExporter) Shutdown ¶
func (s *InterestingCadenceSpanExporter) Shutdown(_ context.Context) error
func (*InterestingCadenceSpanExporter) WriteSpans ¶
func (s *InterestingCadenceSpanExporter) WriteSpans(writer io.Writer) error
type RegisterCache ¶ added in v0.38.0
type RemoteClient ¶
type RemoteClient interface {
io.Closer
StorageSnapshot(blockHeight uint64, blockID flow.Identifier) (snapshot.StorageSnapshot, error)
}
type RemoteDebugger ¶ added in v0.23.1
type RemoteDebugger struct {
// contains filtered or unexported fields
}
func NewRemoteDebugger ¶ added in v0.23.1
func NewRemoteDebugger( chain flow.Chain, logger zerolog.Logger, vmTransactionExecutionEnabled bool, vmScriptExecutionEnabled bool, options ...fvm.Option, ) *RemoteDebugger
NewRemoteDebugger creates a new remote debugger. NOTE: Make sure to use the same version of flow-go as the network you are collecting registers from, otherwise the execution might differ from the way it runs on the network
func (*RemoteDebugger) RunSDKTransaction ¶
func (d *RemoteDebugger) RunSDKTransaction( tx *sdk.Transaction, snapshot StorageSnapshot, header *flow.Header, computeLimit uint64, ) ( Result, error, )
func (*RemoteDebugger) RunScript ¶ added in v0.23.1
func (d *RemoteDebugger) RunScript( code []byte, arguments [][]byte, snapshot StorageSnapshot, blockHeader *flow.Header, ) ( Result, error, )
RunScript runs the script using the given storage snapshot.
func (*RemoteDebugger) RunTransaction ¶ added in v0.23.1
func (d *RemoteDebugger) RunTransaction( txBody *flow.TransactionBody, snapshot StorageSnapshot, blockHeader *flow.Header, ) ( Result, error, )
RunTransaction runs the transaction using the given storage snapshot.
type Result ¶
type Result struct {
Snapshot *snapshot.ExecutionSnapshot
Output fvm.ProcedureOutput
}
type StorageSnapshot ¶ added in v0.38.0
type StorageSnapshot interface {
snapshot.StorageSnapshot
}
type UpdatableStorageSnapshot ¶
type UpdatableStorageSnapshot interface {
StorageSnapshot
Set(id flow.RegisterID, value flow.RegisterValue)
}