tracing

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 51 Imported by: 0

README

Cosmos-tracing

Cosmos-tracing is an extension for Cosmos-SDK based apps to provide thorough insights into the internal execution. This tool, based on open tracing, captures call graphs, performance and additional data.

A modified chain app (known as Tracing-Node) can run with the blockchain network as a fullnode to capture data in real time or be synced on old state.
The Jaeger provides a store and frontend for traces to visualize them.

Motivation and history

This extension was developed in parallel to my work at tgrade which has a very complex multi CosmWasm contract PoE module. I realized that it would be a nightmare to debug the contract interactions or IO without better tooling. Beside logging and events, the blockchain is a black box mostly. One of the major pain points was deciphering error message. Due to non-determinism of error messages, there was no way to store them in the original format on chain and to make them available to devs. The Tracing-Node with the Jaeger UI now solves this problem.

From the initial version that I developed in my own time, some more work was done to make the code easier to adapt to new apps and add additional data and traces to capture.Confio sponsored some of this work, and I am very thankful for this!

Also bit thanks to Ethan was the first power user and provided many good questions and feedback to improve the data or traces captured and Pino who helped with code reviews, integrations and a lot of ops work.

How to use it

The tracing code needs to be integrated into the blockchain app. This is some manual work where you fork the app and modify the app and command code with tracing extensions. It is not trivial but this repo includes some examples that should get you started. Find the tracing package or diff the code with the original source. Once you have a patched binary, it is simple:

  • First start Jaeger with the following command, for example:
docker run --name=jaeger -d -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one
  • Then, start the Tracing-Node with --cosmos-tracing.open-tracing flag set
  • Lastly, access UI at http://localhost:16686

Once the node starts processing blocks, you'll see traces in the UI.

Example

# build a binary
cd examples/wasmd
make build # or build-linux-static

# setup node to connect to a chain

# start with flag
./build/wasmd start --cosmos-tracing.open-tracing --home=<your-nodes-home>

Sponsors

Big thank you also to my sponsor(s) on github, who keep me motivated that Open Source is the way to go.

Disclaimer

The provided code is as it is, with no assurances of flawlessness. Users need to be careful during the instrumentation process and should backup their data before running a new version with tracing enabled.

Once you have an app-hash error, it is hard to find the root cause. I used to disable specific tracing features until I found the problem. You can still see feature flags like os.Getenv("no_tracing_ibcreceive") in the codebase to support this without re-building a binary. Especially capturing IBC-results with the Osmosis IBC Hooks enabled creates problems. It is deactivated by default now. (Set ENV tracing_ibcreceive_capture to enable)

Future versions and support

I am going to provide an example for Cosmos-SDK v0.50 but I can not promise long term support. I have very limited capacity. Also custom support via github issues or discord on individual integrations may not be possible.

Copyright 2021-2024 Alex Peters 
Copyright 2021-2023 Confio GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Documentation

Index

Constants

View Source
const (
	ABCIBeginBlockOperationName   = "abci_begin_block"
	ABCIEndBlockOperationName     = "abci_end_block"
	ModuleBeginBlockOperationName = "module_begin_block"
	ModuleEndBlockOperationName   = "module_end_block"
)

Variables

View Source
var (
	// MaxStoreTraced max size. Spans are lost when the log size is too big
	MaxStoreTraced    = 5_000
	MaxSDKMsgTraced   = 5_000
	MaxSDKLogTraced   = 5_000
	MaxIBCPacketDescr = 5_000
	DefaultMaxLength  = 10_000
)

Functions

func AddModuleInitFlags

func AddModuleInitFlags(startCmd *cobra.Command)

AddModuleInitFlags implements servertypes.ModuleInitFlags interface.

func BeginBlockTracer

func BeginBlockTracer(other sdk.BeginBlocker) sdk.BeginBlocker

BeginBlockTracer is a decorator to the begin block callback that adds tracing functionality Deprecated use TraceModuleManager instead to get more fine grained module data

func ContractGenericInputMsgRecorder

func ContractGenericInputMsgRecorder(obj interface{}) func(opentracing.Span)

func ContractGenericResponseRecorder

func ContractGenericResponseRecorder[T any]() func(opentracing.Span, *T)

ContractGenericResponseRecorder logs response as json which gives a much better output than log.Object

func ContractIBCChannelOpenResponseRecorder

func ContractIBCChannelOpenResponseRecorder() func(opentracing.Span, *wasmvmtypes.IBC3ChannelOpenResponse)

func ContractJsonInputMsgRecorder

func ContractJsonInputMsgRecorder(msg []byte) func(span opentracing.Span)

func ContractVmResponseRecorder

func ContractVmResponseRecorder() func(opentracing.Span, *wasmvmtypes.Response)

func DoWithTracing

func DoWithTracing(ctx sdk.Context, operationName string, logStore storeLogSetting, cb Exec)

DoWithTracing execute callback in tracing context

func DoWithTracingAsync

func DoWithTracingAsync(ctx sdk.Context, operationName string, logStore storeLogSetting, cb Exec) func()

func EndBlockTracer

func EndBlockTracer(other sdk.EndBlocker) sdk.EndBlocker

EndBlockTracer is a decorator to the end block callback that adds tracing functionality Deprecated use TraceModuleManager instead to get more fine grained module data

func IsSimulation

func IsSimulation(ctx sdk.Context) bool

IsSimulation is simulation context

func IsTraceable

func IsTraceable(ctx sdk.Context) bool

IsTraceable returns true when context is applicable for tracing

func NewTraceAnteHandler

func NewTraceAnteHandler(other sdk.AnteHandler, cdc codec.Codec) sdk.AnteHandler

NewTraceAnteHandler decorates the ante handler with tracing functionality

func NewTraceGovRouter

func NewTraceGovRouter(other govv1beta1.Router) govv1beta1.Router

func NewTraceIBCHandler

func NewTraceIBCHandler(other porttypes.IBCModule, moduleName string) porttypes.IBCModule

NewTraceIBCHandler constructor

func NewTraceWasmIBCHandler

func NewTraceWasmIBCHandler(other porttypes.IBCModule) porttypes.IBCModule

NewTraceWasmIBCHandler Deprecated: this is for wasm module only

func NewTraceWasmVm

func NewTraceWasmVm(other wasmtypes.WasmEngine) wasmtypes.WasmEngine

NewTraceWasmVm constructor

func NewTracingGRPCServer

func NewTracingGRPCServer(other grpc.Server, cdc codec.Codec) grpc.Server

func ReadTracerConfig

func ReadTracerConfig(opts servertypes.AppOptions) error

ReadTracerConfig reads the tracer flag

func RunWithTracer

func RunWithTracer(startCmd *cobra.Command, appName string)

func StartTracer

func StartTracer(appName string) io.Closer

todo: make this configurable

func TraceMessageHandlerDecorator

func TraceMessageHandlerDecorator(cdc codec.Codec) func(other wasmkeeper.Messenger) wasmkeeper.Messenger

TraceMessageHandlerDecorator wasm keeper option to decorate the messenger for tracing

func TraceQueryDecorator

TraceQueryDecorator wasm keeper option to decorate the query handler for tracing

func WithBlockTimeClock

func WithBlockTimeClock(rootCtx sdk.Context) (sdk.Context, time.Time)

WithBlockTimeClock return context with block time clock set and current relative block time

func WithSimulation

func WithSimulation(rootCtx sdk.Context, sim bool) sdk.Context

WithSimulation set simulation flag

Types

type BlockTimeClock

type BlockTimeClock struct {
	// contains filtered or unexported fields
}

func NewBlockTimeClock

func NewBlockTimeClock(currentSystemTime time.Time, blockTime time.Time) *BlockTimeClock

NewBlockTimeClock constructor

func (BlockTimeClock) Now

func (b BlockTimeClock) Now(currentSystemTime time.Time) time.Time

Now returns the relative block time

type Exec

type Exec func(workCtx sdk.Context, span opentracing.Span) error

Exec callback to be executed within a tracing contexts. returned error is for tracking only and not causing any side effects

type GasTrace

type GasTrace struct {
	Gas        storetypes.Gas
	Descriptor string
	Refund     bool
	Offset     storetypes.Gas
}

func NewGasTrace

func NewGasTrace(amount storetypes.Gas, descriptor string, refund bool, consumed storetypes.Gas) GasTrace

NewGasTrace constructor

func (GasTrace) String

func (g GasTrace) String() string

type MessageRouter

type MessageRouter interface {
	Handler(msg sdk.Msg) baseapp.MsgServiceHandler
}

MessageRouter ADR 031 request type routing

func NewTraceMessageRouter

func NewTraceMessageRouter(other MessageRouter) MessageRouter

type MockIBCModule

type MockIBCModule struct {
	OnAcknowledgementPacketFn func(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) error
	OnRecvPacketFn            func(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) exported.Acknowledgement
}

func (MockIBCModule) OnAcknowledgementPacket

func (m MockIBCModule) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) error

func (MockIBCModule) OnChanCloseConfirm

func (m MockIBCModule) OnChanCloseConfirm(ctx sdk.Context, portID, channelID string) error

func (MockIBCModule) OnChanCloseInit

func (m MockIBCModule) OnChanCloseInit(ctx sdk.Context, portID, channelID string) error

func (MockIBCModule) OnChanOpenAck

func (m MockIBCModule) OnChanOpenAck(ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string) error

func (MockIBCModule) OnChanOpenConfirm

func (m MockIBCModule) OnChanOpenConfirm(ctx sdk.Context, portID, channelID string) error

func (MockIBCModule) OnChanOpenInit

func (m MockIBCModule) OnChanOpenInit(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID string, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, version string) (string, error)

func (MockIBCModule) OnChanOpenTry

func (m MockIBCModule) OnChanOpenTry(ctx sdk.Context, order channeltypes.Order, connectionHops []string, portID, channelID string, channelCap *capabilitytypes.Capability, counterparty channeltypes.Counterparty, counterpartyVersion string) (version string, err error)

func (MockIBCModule) OnRecvPacket

func (m MockIBCModule) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) exported.Acknowledgement

func (MockIBCModule) OnTimeoutPacket

func (m MockIBCModule) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) error

type ModuleManager

type ModuleManager interface {
	SetOrderInitGenesis(moduleNames ...string)
	SetOrderExportGenesis(moduleNames ...string)
	SetOrderBeginBlockers(moduleNames ...string)
	SetOrderEndBlockers(moduleNames ...string)
	SetOrderMigrations(moduleNames ...string)
	RegisterInvariants(ir sdk.InvariantRegistry)
	RegisterServices(cfg module.Configurator)
	InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage) abci.ResponseInitChain
	ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) map[string]json.RawMessage
	RunMigrations(ctx sdk.Context, cfg module.Configurator, fromVM module.VersionMap) (module.VersionMap, error)
	BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
	EndBlock(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
	GetVersionMap() module.VersionMap
	ModuleNames() []string
	GetModules() map[string]any
	GetConsensusVersion(module string) uint64
	ExportGenesisForModules(ctx sdk.Context, cdc codec.JSONCodec, modulesToExport []string) map[string]json.RawMessage
}

ModuleManager abstract module manager type. Should ideally exists in the SDK

type TraceGRPCServer

type TraceGRPCServer struct {
	// contains filtered or unexported fields
}

func (*TraceGRPCServer) RegisterService

func (t *TraceGRPCServer) RegisterService(sd *stdgrpc.ServiceDesc, handler interface{})

type TraceGasMeter

type TraceGasMeter struct {
	// contains filtered or unexported fields
}

TraceGasMeter is a decorator to the sdk GasMeter that catuptures all gas usage and refunds

func NewTraceGasMeter

func NewTraceGasMeter(o sdk.GasMeter) *TraceGasMeter

NewTraceGasMeter constructor

func (*TraceGasMeter) ConsumeGas

func (t *TraceGasMeter) ConsumeGas(amount storetypes.Gas, descriptor string)

func (TraceGasMeter) GasConsumed

func (t TraceGasMeter) GasConsumed() storetypes.Gas

func (TraceGasMeter) GasConsumedToLimit

func (t TraceGasMeter) GasConsumedToLimit() storetypes.Gas

func (TraceGasMeter) GasRemaining

func (t TraceGasMeter) GasRemaining() storetypes.Gas

func (TraceGasMeter) IsOutOfGas

func (t TraceGasMeter) IsOutOfGas() bool

func (TraceGasMeter) IsPastLimit

func (t TraceGasMeter) IsPastLimit() bool

func (TraceGasMeter) Limit

func (t TraceGasMeter) Limit() storetypes.Gas

func (*TraceGasMeter) RefundGas

func (t *TraceGasMeter) RefundGas(amount storetypes.Gas, descriptor string)

func (TraceGasMeter) String

func (t TraceGasMeter) String() string

type TraceGovRouter

type TraceGovRouter struct {
	// contains filtered or unexported fields
}

TraceGovRouter is a decorator to the sdk gov router that adds call tracing functionality

func (TraceGovRouter) AddRoute

func (t TraceGovRouter) AddRoute(r string, h govv1beta1.Handler) (rtr govv1beta1.Router)

func (TraceGovRouter) GetRoute

func (t TraceGovRouter) GetRoute(path string) (h govv1beta1.Handler)

func (TraceGovRouter) HasRoute

func (t TraceGovRouter) HasRoute(r string) bool

func (TraceGovRouter) Seal

func (t TraceGovRouter) Seal()

type TraceIBCHandler

type TraceIBCHandler struct {
	// contains filtered or unexported fields
}

TraceIBCHandler is a decorator to the ibc module handler that adds call tracing functionality

func (TraceIBCHandler) OnAcknowledgementPacket

func (t TraceIBCHandler) OnAcknowledgementPacket(rootCtx sdk.Context, packet channeltypes.Packet, acknowledgement []byte, relayer sdk.AccAddress) (err error)

func (TraceIBCHandler) OnChanCloseConfirm

func (t TraceIBCHandler) OnChanCloseConfirm(rootCtx sdk.Context, portID, channelID string) (err error)

func (TraceIBCHandler) OnChanCloseInit

func (t TraceIBCHandler) OnChanCloseInit(rootCtx sdk.Context, portID, channelID string) (err error)

func (TraceIBCHandler) OnChanOpenAck

func (t TraceIBCHandler) OnChanOpenAck(
	rootCtx sdk.Context,
	portID, channelID string,
	counterpartyChannelID string,
	counterpartyVersion string,
) (err error)

func (TraceIBCHandler) OnChanOpenConfirm

func (t TraceIBCHandler) OnChanOpenConfirm(rootCtx sdk.Context, portID, channelID string) (err error)

func (TraceIBCHandler) OnChanOpenInit

func (t TraceIBCHandler) OnChanOpenInit(
	rootCtx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID string,
	channelID string,
	channelCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	version string,
) (v string, err error)

func (TraceIBCHandler) OnChanOpenTry

func (t TraceIBCHandler) OnChanOpenTry(
	rootCtx sdk.Context,
	order channeltypes.Order,
	connectionHops []string,
	portID, channelID string,
	channelCap *capabilitytypes.Capability,
	counterparty channeltypes.Counterparty,
	counterpartyVersion string,
) (version string, err error)

func (TraceIBCHandler) OnRecvPacket

func (t TraceIBCHandler) OnRecvPacket(rootCtx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) (result exported.Acknowledgement)

func (TraceIBCHandler) OnTimeoutPacket

func (t TraceIBCHandler) OnTimeoutPacket(rootCtx sdk.Context, packet channeltypes.Packet, relayer sdk.AccAddress) (err error)

type TraceMessageHandler

type TraceMessageHandler struct {
	// contains filtered or unexported fields
}

TraceMessageHandler is a decorator to another message handler adds call tracing functionality

func (TraceMessageHandler) DispatchMsg

func (h TraceMessageHandler) DispatchMsg(rootCtx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error)

type TraceMessageRouter

type TraceMessageRouter struct {
	// contains filtered or unexported fields
}

func (TraceMessageRouter) Handler

type TraceModuleConfigurator

type TraceModuleConfigurator struct {
	// contains filtered or unexported fields
}

func NewTraceModuleConfigurator

func NewTraceModuleConfigurator(cdc codec.Codec, nested module.Configurator) *TraceModuleConfigurator

func (*TraceModuleConfigurator) MsgServer

func (t *TraceModuleConfigurator) MsgServer() grpc.Server

func (*TraceModuleConfigurator) QueryServer

func (t *TraceModuleConfigurator) QueryServer() grpc.Server

func (*TraceModuleConfigurator) RegisterMigration

func (t *TraceModuleConfigurator) RegisterMigration(moduleName string, forVersion uint64, handler module.MigrationHandler) error

type TraceModuleManager

type TraceModuleManager struct {
	// contains filtered or unexported fields
}

func NewTraceModuleManager

func NewTraceModuleManager(other *module.Manager, cdc codec.Codec) *TraceModuleManager

func (TraceModuleManager) BeginBlock

func (TraceModuleManager) EndBlock

func (TraceModuleManager) ExportGenesis

func (t TraceModuleManager) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) map[string]json.RawMessage

func (TraceModuleManager) ExportGenesisForModules

func (t TraceModuleManager) ExportGenesisForModules(ctx sdk.Context, cdc codec.JSONCodec, modulesToExport []string) map[string]json.RawMessage

func (TraceModuleManager) GetConsensusVersion

func (t TraceModuleManager) GetConsensusVersion(module string) uint64

func (TraceModuleManager) GetModules

func (t TraceModuleManager) GetModules() map[string]any

func (TraceModuleManager) GetVersionMap

func (t TraceModuleManager) GetVersionMap() module.VersionMap

func (TraceModuleManager) InitGenesis

func (t TraceModuleManager) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, genesisData map[string]json.RawMessage) abci.ResponseInitChain

func (TraceModuleManager) ModuleNames

func (t TraceModuleManager) ModuleNames() []string

func (TraceModuleManager) RegisterInvariants

func (t TraceModuleManager) RegisterInvariants(ir sdk.InvariantRegistry)

func (TraceModuleManager) RegisterServices

func (t TraceModuleManager) RegisterServices(cfg module.Configurator)

func (TraceModuleManager) RunMigrations

func (t TraceModuleManager) RunMigrations(rootCtx sdk.Context, cfg module.Configurator, fromVM module.VersionMap) (migrations module.VersionMap, err error)

func (TraceModuleManager) SetOrderBeginBlockers

func (t TraceModuleManager) SetOrderBeginBlockers(moduleNames ...string)

func (TraceModuleManager) SetOrderEndBlockers

func (t TraceModuleManager) SetOrderEndBlockers(moduleNames ...string)

func (TraceModuleManager) SetOrderExportGenesis

func (t TraceModuleManager) SetOrderExportGenesis(moduleNames ...string)

func (TraceModuleManager) SetOrderInitGenesis

func (t TraceModuleManager) SetOrderInitGenesis(moduleNames ...string)

func (TraceModuleManager) SetOrderMigrations

func (t TraceModuleManager) SetOrderMigrations(moduleNames ...string)

type TraceQueryPlugin

type TraceQueryPlugin struct {
	// contains filtered or unexported fields
}

TraceQueryPlugin is a decorator to a WASMVMQueryHandler that adds tracing functionality

func (TraceQueryPlugin) HandleQuery

func (t TraceQueryPlugin) HandleQuery(rootCtx sdk.Context, caller sdk.AccAddress, request wasmvmtypes.QueryRequest) (result []byte, err error)

type TraceWasmVm

type TraceWasmVm struct {
	// contains filtered or unexported fields
}

func (TraceWasmVm) AnalyzeCode

func (t TraceWasmVm) AnalyzeCode(checksum cosmwasm.Checksum) (*wasmvmtypes.AnalysisReport, error)

func (TraceWasmVm) Cleanup

func (t TraceWasmVm) Cleanup()

func (TraceWasmVm) Create

func (t TraceWasmVm) Create(code cosmwasm.WasmCode) (cosmwasm.Checksum, error)

func (TraceWasmVm) Execute

func (t TraceWasmVm) Execute(checksum cosmwasm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (resp *wasmvmtypes.Response, gasUsed uint64, err error)

func (TraceWasmVm) GetCode

func (t TraceWasmVm) GetCode(checksum cosmwasm.Checksum) (cosmwasm.WasmCode, error)

func (TraceWasmVm) GetMetrics

func (t TraceWasmVm) GetMetrics() (*wasmvmtypes.Metrics, error)

func (TraceWasmVm) IBCChannelClose

func (t TraceWasmVm) IBCChannelClose(checksum cosmwasm.Checksum, env wasmvmtypes.Env, channel wasmvmtypes.IBCChannelCloseMsg, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error)

func (TraceWasmVm) IBCChannelConnect

func (t TraceWasmVm) IBCChannelConnect(checksum cosmwasm.Checksum, env wasmvmtypes.Env, channel wasmvmtypes.IBCChannelConnectMsg, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error)

func (TraceWasmVm) IBCChannelOpen

func (TraceWasmVm) IBCPacketAck

func (TraceWasmVm) IBCPacketReceive

func (t TraceWasmVm) IBCPacketReceive(checksum cosmwasm.Checksum, env wasmvmtypes.Env, packet wasmvmtypes.IBCPacketReceiveMsg, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCReceiveResult, uint64, error)

func (TraceWasmVm) IBCPacketTimeout

func (t TraceWasmVm) IBCPacketTimeout(checksum cosmwasm.Checksum, env wasmvmtypes.Env, packet wasmvmtypes.IBCPacketTimeoutMsg, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error)

func (TraceWasmVm) Instantiate

func (t TraceWasmVm) Instantiate(checksum cosmwasm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (resp *wasmvmtypes.Response, gasUsed uint64, err error)

func (TraceWasmVm) Migrate

func (t TraceWasmVm) Migrate(checksum cosmwasm.Checksum, env wasmvmtypes.Env, migrateMsg []byte, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (resp *wasmvmtypes.Response, gasUsed uint64, err error)

func (TraceWasmVm) Pin

func (t TraceWasmVm) Pin(checksum cosmwasm.Checksum) error

func (TraceWasmVm) Query

func (t TraceWasmVm) Query(checksum cosmwasm.Checksum, env wasmvmtypes.Env, queryMsg []byte, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (resp []byte, gasUsed uint64, err error)

func (TraceWasmVm) Reply

func (t TraceWasmVm) Reply(checksum cosmwasm.Checksum, env wasmvmtypes.Env, reply wasmvmtypes.Reply, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (resp *wasmvmtypes.Response, gasUsed uint64, err error)

func (TraceWasmVm) StoreCode

func (t TraceWasmVm) StoreCode(code cosmwasm.WasmCode) (cosmwasm.Checksum, error)

func (TraceWasmVm) StoreCodeUnchecked

func (t TraceWasmVm) StoreCodeUnchecked(code cosmwasm.WasmCode) (cosmwasm.Checksum, error)

func (TraceWasmVm) Sudo

func (t TraceWasmVm) Sudo(checksum cosmwasm.Checksum, env wasmvmtypes.Env, sudoMsg []byte, store cosmwasm.KVStore, goapi cosmwasm.GoAPI, querier cosmwasm.Querier, gasMeter cosmwasm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (resp *wasmvmtypes.Response, gasUsed uint64, err error)

func (TraceWasmVm) Unpin

func (t TraceWasmVm) Unpin(checksum cosmwasm.Checksum) error

type TraceWritesKVStore

type TraceWritesKVStore struct {
	*tracekv.Store
	// contains filtered or unexported fields
}

TraceWritesKVStore decorator to log only write operations

func NewTraceWritesOnlyStore

func NewTraceWritesOnlyStore(parent sdk.KVStore, traceStore *tracekv.Store) *TraceWritesKVStore

NewTraceWritesOnlyStore constructor

func (*TraceWritesKVStore) Delete

func (t *TraceWritesKVStore) Delete(key []byte)

func (*TraceWritesKVStore) Get

func (t *TraceWritesKVStore) Get(key []byte) []byte

func (*TraceWritesKVStore) Has

func (t *TraceWritesKVStore) Has(key []byte) bool

func (*TraceWritesKVStore) Iterator

func (t *TraceWritesKVStore) Iterator(start, end []byte) storetypes.Iterator

func (*TraceWritesKVStore) ReverseIterator

func (t *TraceWritesKVStore) ReverseIterator(start, end []byte) storetypes.Iterator

func (*TraceWritesKVStore) Set

func (t *TraceWritesKVStore) Set(key, value []byte)

type TracingMultiStore

type TracingMultiStore struct {
	sdk.MultiStore
	// contains filtered or unexported fields
}

TracingMultiStore Multistore that traces all operations

func NewTracingMultiStore

func NewTracingMultiStore(store sdk.MultiStore, traceWritesOnly bool) *TracingMultiStore

NewTracingMultiStore constructor

func (*TracingMultiStore) GetKVStore

func (t *TracingMultiStore) GetKVStore(k storetypes.StoreKey) sdk.KVStore

func (*TracingMultiStore) GetStore

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL