Documentation
¶
Index ¶
- Constants
- Variables
- func BptreeCommitmentOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
- func RegisterProofRuntime(prt *merkle.ProofRuntime)
- func StoreConstructor(db dbm.DB, opts types.StoreOptions) types.CommitStore
- type CommitmentOp
- type Store
- func (st *Store) CacheWrap() types.Store
- func (st *Store) Commit() types.CommitID
- func (st *Store) Delete(gctx *types.GasContext, key []byte)
- func (st *Store) ExpectedGetReadDepth100() int64
- func (st *Store) ExpectedSetReadDepth100() int64
- func (st *Store) ExpectedWriteDepth100() int64
- func (st *Store) Get(gctx *types.GasContext, key []byte) (value []byte)
- func (st *Store) GetImmutable(version int64) (*Store, error)
- func (st *Store) GetStoreOptions() types.StoreOptions
- func (st *Store) Has(gctx *types.GasContext, key []byte) (exists bool)
- func (st *Store) Iterator(gctx *types.GasContext, start, end []byte) types.Iterator
- func (st *Store) LastCommitID() types.CommitID
- func (st *Store) LoadLatestVersion() error
- func (st *Store) LoadVersion(ver int64) error
- func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery)
- func (st *Store) ReverseIterator(gctx *types.GasContext, start, end []byte) types.Iterator
- func (st *Store) Set(gctx *types.GasContext, key, value []byte)
- func (st *Store) SetInitialVersion(v int64)
- func (st *Store) SetStoreOptions(opts types.StoreOptions)
- func (st *Store) VersionExists(version int64) bool
- func (st *Store) Write()
- type Tree
Constants ¶
const (
ProofOpBptreeCommitment = "ics23:bptree"
)
Variables ¶
var FastIndexEnabled bool
FastIndexEnabled controls whether stores built by StoreConstructor enable the bptree fast index — an unauthenticated read accelerator outside the Merkle commitment (see bptree.FastIndexOption). It is a package-level toggle because StoreConstructor's signature is fixed by CommitStoreConstructor and types.StoreOptions is shared with the IAVL store. Set it before stores are mounted (e.g. at process init). Off by default; toggling it does not change the app hash, so nodes may differ without forking.
Functions ¶
func BptreeCommitmentOpDecoder ¶
func BptreeCommitmentOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error)
BptreeCommitmentOpDecoder decodes a merkle.ProofOp into a CommitmentOp.
func RegisterProofRuntime ¶
func RegisterProofRuntime(prt *merkle.ProofRuntime)
RegisterProofRuntime registers the B+ tree proof decoder with the given runtime. This should be called during app initialization alongside the existing IAVL and simple merkle decoders.
func StoreConstructor ¶
func StoreConstructor(db dbm.DB, opts types.StoreOptions) types.CommitStore
StoreConstructor implements store.CommitStoreConstructor.
Types ¶
type CommitmentOp ¶
type CommitmentOp struct {
Key []byte
Proof *ics23.CommitmentProof
}
CommitmentOp wraps an ICS23 proof for the B+ tree.
func NewBptreeCommitmentOp ¶
func NewBptreeCommitmentOp(key []byte, proof *ics23.CommitmentProof) CommitmentOp
func (CommitmentOp) GetKey ¶
func (op CommitmentOp) GetKey() []byte
func (CommitmentOp) ProofOp ¶
func (op CommitmentOp) ProofOp() merkle.ProofOp
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements types.Store and CommitStore backed by a B+ tree.
func UnsafeNewStore ¶
func UnsafeNewStore(tree *bp.MutableTree, opts types.StoreOptions) *Store
func (*Store) ExpectedGetReadDepth100 ¶
For the B+ tree, GET/SET descents and the COW write path all touch one node per level — all three depths equal the traversal depth.
func (*Store) ExpectedSetReadDepth100 ¶
func (*Store) ExpectedWriteDepth100 ¶
func (*Store) GetImmutable ¶
GetImmutable returns a read-only store at a specific version.
func (*Store) GetStoreOptions ¶
func (st *Store) GetStoreOptions() types.StoreOptions
func (*Store) LastCommitID ¶
func (*Store) LoadLatestVersion ¶
func (*Store) LoadVersion ¶
func (*Store) Query ¶
func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery)
func (*Store) ReverseIterator ¶
func (*Store) SetInitialVersion ¶
SetInitialVersion sets the version the first SaveVersion commits as, to align the multistore's commit version with the chain's InitialHeight when starting a hardfork chain at height > 1. Has no effect on the tree once it has any saved versions; the initialVersion field is set unconditionally for the prune guard. Implements types.InitialVersionSetter.
func (*Store) SetStoreOptions ¶
func (st *Store) SetStoreOptions(opts types.StoreOptions)
func (*Store) VersionExists ¶
type Tree ¶
type Tree interface {
Has(key []byte) (bool, error)
Get(key []byte) ([]byte, error)
Set(key, value []byte) (bool, error)
Remove(key []byte) ([]byte, bool, error)
SaveVersion() ([]byte, int64, error)
DeleteVersionsTo(version int64) error
Version() int64
Size() int64
Hash() []byte
GetLatestVersion() (int64, error)
VersionExists(version int64) bool
GetVersioned(key []byte, version int64) ([]byte, error)
GetImmutableTree(version int64) (*bp.ImmutableTree, error)
}
Tree is the interface for both mutable and immutable B+ trees. Mirrors the iavl store's Tree interface but uses bptree types.