cosmos-sdk/store/kv/trace
2023-11-22 14:17:48 +00:00
..
doc.go chore(store/v2): move kv stores to kv sub-package (#18243) 2023-10-24 21:02:53 +00:00
iterator.go chore(store/v2): move kv stores to kv sub-package (#18243) 2023-10-24 21:02:53 +00:00
README.md chore(store/v2): move kv stores to kv sub-package (#18243) 2023-10-24 21:02:53 +00:00
store_test.go feat(store/v2): add the commitment store (#18526) 2023-11-22 14:17:48 +00:00
store.go feat(store/v2): handle store upgrades in RootStore (#18277) 2023-11-01 18:09:54 +00:00

Trace KVStore

The trace.Store implementation defines a store which wraps a parent KVStore and traces all operations performed on it. Each trace operation is written to a provided io.Writer object. Specifically, a TraceOperation object is JSON encoded and written to the writer. The TraceOperation object contains the exact operation, e.g. a read or write, and the corresponding key and value pair.

A trace.Store can also be instantiated with a store.TraceContext which can allow each traced operation to include additional metadata, e.g. a block height or hash.

Note, trace.Store is not meant to be branched or written to. The parent KVStore is responsible for all branching and writing operations, while a trace.Store wraps such a store and traces all relevant operations on it.