Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultProofRuntime() (prt *merkle.ProofRuntime)
- func GetLatestStoredMptHeight() uint64
- func GetPruningHeights(db dbm.DB) ([]int64, error)
- func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
- func RequireProof(subpath string) bool
- func SetPruningHeights(db dbm.DB, pruneHeights []int64)
- type MultiStoreProof
- type MultiStoreProofOp
- type Store
- func (rs *Store) AppendCommitFilters(filters []storetypes.StoreFilter)
- func (rs *Store) AppendPruneFilters(filters []storetypes.StoreFilter)
- func (rs *Store) AppendVersionFilters(filters []storetypes.VersionFilter)
- func (rs *Store) CacheMultiStore() types.CacheMultiStore
- func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)
- func (rs *Store) CacheWrap() types.CacheWrap
- func (rs *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap
- func (rs *Store) CommitterCommit(*iavltree.TreeDelta) (_ types.CommitID, _ *iavltree.TreeDelta)
- func (rs *Store) CommitterCommitMap(inputDeltaMap iavltree.TreeDeltaMap) (types.CommitID, iavltree.TreeDeltaMap)
- func (src Store) Copy() *Store
- func (rs *Store) CurrentVersion() int64
- func (rs *Store) Export(to *Store, initVersion int64) error
- func (rs *Store) FlushPruneHeights(pruneHeights []int64, versions []int64)
- func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore
- func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore
- func (rs *Store) GetCommitVersion() (int64, error)
- func (rs *Store) GetDBReadCount() int
- func (rs *Store) GetDBReadTime() int
- func (rs *Store) GetDBWriteCount() int
- func (rs *Store) GetFlatKVReadCount() int
- func (rs *Store) GetFlatKVReadTime() int
- func (rs *Store) GetFlatKVWriteCount() int
- func (rs *Store) GetFlatKVWriteTime() int
- func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore
- func (rs *Store) GetLatestVersion() int64
- func (rs *Store) GetNodeReadCount() int
- func (rs *Store) GetPruningHeights() []int64
- func (rs *Store) GetStore(key types.StoreKey) types.Store
- func (rs *Store) GetStoreType() types.StoreType
- func (rs *Store) GetStores() map[types.StoreKey]types.CommitKVStore
- func (rs *Store) GetVersions() []int64
- func (rs *Store) LastCommitID() types.CommitID
- func (rs *Store) LastCommitVersion() int64
- func (rs *Store) LoadLatestVersion() error
- func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) error
- func (rs *Store) LoadVersion(ver int64) error
- func (rs *Store) LoadVersionAndUpgrade(ver int64, upgrades *types.StoreUpgrades) error
- func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db dbm.DB)
- func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery
- func (rs *Store) ResetCount()
- func (rs *Store) SetInterBlockCache(c types.MultiStorePersistentCache)
- func (rs *Store) SetLazyLoading(lazyLoading bool)
- func (rs *Store) SetLogger(log tmlog.Logger)
- func (rs *Store) SetPruning(pruningOpts types.PruningOptions)
- func (rs *Store) SetTracer(w io.Writer) types.MultiStore
- func (rs *Store) SetTracingContext(tc types.TraceContext) types.MultiStore
- func (rs *Store) SetUpgradeVersion(version int64)
- func (rs *Store) StopStore()
- func (rs *Store) TracingEnabled() bool
- type StoreSort
- type StoreSorts
Constants ¶
const ( AccStore = "acc" EvmStore = "evm" MptStore = "mpt" // new store for acc module, will use mpt instead of iavl as store engine )
const ProofOpMultiStore = "multistore"
the multi-store proof operation constant value
Variables ¶
var (
IgPruneHeightsLen = false
)
Functions ¶
func DefaultProofRuntime ¶
func DefaultProofRuntime() (prt *merkle.ProofRuntime)
XXX: This should be managed by the rootMultiStore which may want to register more proof ops?
func GetLatestStoredMptHeight ¶ added in v1.5.0
func GetLatestStoredMptHeight() uint64
GetLatestStoredMptHeight get latest mpt storage height
func MultiStoreProofOpDecoder ¶
func MultiStoreProofOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
MultiStoreProofOpDecoder returns a multi-store merkle proof operator from a given proof operation.
func RequireProof ¶
RequireProof returns whether proof is required for the subpath.
func SetPruningHeights ¶ added in v0.19.17
Types ¶
type MultiStoreProof ¶
type MultiStoreProof struct {
StoreInfos []storeInfo
}
MultiStoreProof defines a collection of store proofs in a multi-store
func NewMultiStoreProof ¶
func NewMultiStoreProof(storeInfos []storeInfo) *MultiStoreProof
func (*MultiStoreProof) ComputeRootHash ¶
func (proof *MultiStoreProof) ComputeRootHash() []byte
ComputeRootHash returns the root hash for a given multi-store proof.
type MultiStoreProofOp ¶
type MultiStoreProofOp struct { // To encode in ProofOp.Data. Proof *MultiStoreProof `json:"proof"` // contains filtered or unexported fields }
TODO: document
func NewMultiStoreProofOp ¶
func NewMultiStoreProofOp(key []byte, proof *MultiStoreProof) MultiStoreProofOp
func (MultiStoreProofOp) GetKey ¶
func (op MultiStoreProofOp) GetKey() []byte
GetKey returns the key for a multi-store proof operation.
func (MultiStoreProofOp) ProofOp ¶
func (op MultiStoreProofOp) ProofOp() merkle.ProofOp
ProofOp return a merkle proof operation from a given multi-store proof operation.
func (MultiStoreProofOp) Run ¶
func (op MultiStoreProofOp) Run(args [][]byte) ([][]byte, error)
Run executes a multi-store proof operation for a given value. It returns the root hash if the value matches all the store's commitID's hash or an error otherwise.
func (MultiStoreProofOp) String ¶
func (op MultiStoreProofOp) String() string
String implements the Stringer interface for a mult-store proof operation.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is composed of many CommitStores. Name contrasts with cacheMultiStore which is for cache-wrapping other MultiStores. It implements the CommitMultiStore interface.
func NewStore ¶
NewStore returns a reference to a new Store object with the provided DB. The store will be created with a PruneNothing pruning strategy by default. After a store is created, KVStores must be mounted and finally LoadLatestVersion or LoadVersion must be called.
func (*Store) AppendCommitFilters ¶ added in v1.3.0
func (rs *Store) AppendCommitFilters(filters []storetypes.StoreFilter)
func (*Store) AppendPruneFilters ¶ added in v1.3.0
func (rs *Store) AppendPruneFilters(filters []storetypes.StoreFilter)
func (*Store) AppendVersionFilters ¶ added in v1.3.0
func (rs *Store) AppendVersionFilters(filters []storetypes.VersionFilter)
func (*Store) CacheMultiStore ¶
func (rs *Store) CacheMultiStore() types.CacheMultiStore
CacheMultiStore cache-wraps the multi-store and returns a CacheMultiStore. It implements the MultiStore interface.
func (*Store) CacheMultiStoreWithVersion ¶
func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error)
CacheMultiStoreWithVersion is analogous to CacheMultiStore except that it attempts to load stores at a given version (height). An error is returned if any store cannot be loaded. This should only be used for querying and iterating at past heights.
func (*Store) CacheWrapWithTrace ¶
CacheWrapWithTrace implements the CacheWrapper interface.
func (*Store) CommitterCommit ¶ added in v1.1.6
func (*Store) CommitterCommitMap ¶ added in v1.1.6
func (rs *Store) CommitterCommitMap(inputDeltaMap iavltree.TreeDeltaMap) (types.CommitID, iavltree.TreeDeltaMap)
Implements Committer/CommitStore.
func (*Store) CurrentVersion ¶ added in v1.6.1
func (*Store) Export ¶
Snapshot implements snapshottypes.Snapshotter. The snapshot output for a given format must be identical across nodes such that chunks from different sources fit together. If the output for a given format changes (at the byte level), the snapshot format must be bumped - see TestMultistoreSnapshot_Checksum test.
func (*Store) FlushPruneHeights ¶
func (*Store) GetCommitKVStore ¶
func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore
GetCommitKVStore returns a mounted CommitKVStore for a given StoreKey. If the store is wrapped in an inter-block cache, it will be unwrapped before returning.
func (*Store) GetCommitStore ¶
func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore
GetCommitStore returns a mounted CommitStore for a given StoreKey. If the store is wrapped in an inter-block cache, it will be unwrapped before returning.
func (*Store) GetCommitVersion ¶ added in v1.0.0
func (*Store) GetDBReadCount ¶
func (*Store) GetDBReadTime ¶
func (*Store) GetDBWriteCount ¶
func (*Store) GetFlatKVReadCount ¶ added in v1.1.5
func (*Store) GetFlatKVReadTime ¶ added in v1.1.5
func (*Store) GetFlatKVWriteCount ¶ added in v1.1.5
func (*Store) GetFlatKVWriteTime ¶ added in v1.1.5
func (*Store) GetKVStore ¶
GetKVStore returns a mounted KVStore for a given StoreKey. If tracing is enabled on the KVStore, a wrapped TraceKVStore will be returned with the root store's tracer, otherwise, the original KVStore will be returned.
NOTE: The returned KVStore may be wrapped in an inter-block cache if it is set on the root store.
func (*Store) GetLatestVersion ¶
func (*Store) GetNodeReadCount ¶
func (*Store) GetPruningHeights ¶
func (*Store) GetStore ¶
GetStore returns a mounted Store for a given StoreKey. If the StoreKey does not exist, it will panic. If the Store is wrapped in an inter-block cache, it will be unwrapped prior to being returned.
TODO: This isn't used directly upstream. Consider returning the Store as-is instead of unwrapping.
func (*Store) GetVersions ¶
func (*Store) LastCommitID ¶
Implements Committer/CommitStore.
func (*Store) LastCommitVersion ¶ added in v1.6.3
func (*Store) LoadLatestVersion ¶
LoadLatestVersion implements CommitMultiStore.
func (*Store) LoadLatestVersionAndUpgrade ¶
func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) error
LoadLatestVersionAndUpgrade implements CommitMultiStore
func (*Store) LoadVersion ¶
LoadVersion implements CommitMultiStore.
func (*Store) LoadVersionAndUpgrade ¶
func (rs *Store) LoadVersionAndUpgrade(ver int64, upgrades *types.StoreUpgrades) error
LoadVersionAndUpgrade allows us to rename substores while loading an older version
func (*Store) MountStoreWithDB ¶
Implements CommitMultiStore.
func (*Store) Query ¶
func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery
Query calls substore.Query with the same `req` where `req.Path` is modified to remove the substore prefix. Ie. `req.Path` here is `/<substore>/<path>`, and trimmed to `/<path>` for the substore. TODO: add proof for `multistore -> substore`.
func (*Store) ResetCount ¶
func (rs *Store) ResetCount()
func (*Store) SetInterBlockCache ¶
func (rs *Store) SetInterBlockCache(c types.MultiStorePersistentCache)
SetInterBlockCache sets the Store's internal inter-block (persistent) cache. When this is defined, all CommitKVStores will be wrapped with their respective inter-block cache.
func (*Store) SetLazyLoading ¶
SetLazyLoading sets if the iavl store should be loaded lazily or not
func (*Store) SetPruning ¶
func (rs *Store) SetPruning(pruningOpts types.PruningOptions)
SetPruning sets the pruning strategy on the root store and all the sub-stores. Note, calling SetPruning on the root store prior to LoadVersion or LoadLatestVersion performs a no-op as the stores aren't mounted yet.
func (*Store) SetTracer ¶
func (rs *Store) SetTracer(w io.Writer) types.MultiStore
SetTracer sets the tracer for the MultiStore that the underlying stores will utilize to trace operations. A MultiStore is returned.
func (*Store) SetTracingContext ¶
func (rs *Store) SetTracingContext(tc types.TraceContext) types.MultiStore
SetTracingContext updates the tracing context for the MultiStore by merging the given context with the existing context by key. Any existing keys will be overwritten. It is implied that the caller should update the context when necessary between tracing operations. It returns a modified MultiStore.
func (*Store) SetUpgradeVersion ¶ added in v1.3.0
func (*Store) TracingEnabled ¶
TracingEnabled returns if tracing is enabled for the MultiStore.
type StoreSort ¶ added in v1.3.0
type StoreSort struct {
// contains filtered or unexported fields
}
type StoreSorts ¶ added in v1.3.0
type StoreSorts []StoreSort
func (StoreSorts) Len ¶ added in v1.3.0
func (s StoreSorts) Len() int
func (StoreSorts) Less ¶ added in v1.3.0
func (s StoreSorts) Less(i, j int) bool
func (StoreSorts) Swap ¶ added in v1.3.0
func (s StoreSorts) Swap(i, j int)