Versions in this module Expand all Collapse all v0 v0.1.0 Jan 19, 2024 Changes in this version + const ANSIBright + const ANSIFgBlue + const ANSIFgCyan + const ANSIFgGreen + const ANSIReset + const DefaultIavlFastStorageCacheSize + const FlagIavlCacheInitRatio + const FlagIavlCommitAsyncNoBatch + const FlagIavlCommitIntervalHeight + const FlagIavlDiscardFastStorage + const FlagIavlFastStorageCacheSize + const FlagIavlHeightOrphansCacheSize + const FlagIavlMaxCommittedHeightNum + const FlagIavlMinCommitItemCount + const FlagOutputModules + const IavlDebug + const IavlErr + const IavlInfo + const PreChangeNop + const PreChangeOpDelete + const PreChangeOpSet + const PreloadConcurrencyThreshold + const ProofOpIAVLAbsence + const ProofOpIAVLValue + var Branch = "" + var Commit = "" + var CommitGapHeight int64 = config.DefaultCommitGapHeight + var CommitIntervalHeight int64 = 100 + var EnableAsyncCommit = false + var EnablePruningHistoryState = true + var ErrInvalidInputs = fmt.Errorf("invalid inputs") + var ErrInvalidProof = fmt.Errorf("invalid proof") + var ErrInvalidRoot = fmt.Errorf("invalid root") + var ErrNoImport = errors.New("no import in progress") + var ErrVersionDoesNotExist = errors.New("version does not exist") + var ExportDone = errors.New("export is complete") + var HeightOrphansCacheSize = 8 + var IavlCacheInitRatio float64 = 0 + var IavlCommitAsyncNoBatch bool = false + var MaxCommittedHeightNum = minHistoryStateNum + var MinCommitItemCount int64 = 500000 + var OutputModules map[string]int + var PruningChannelSize = 10 + var Version = "" + func AbsenceOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error) + func Blue(args ...interface{}) string + func ColoredBytes(data []byte, textColor, bytesColor func(...interface{}) string) string + func Cyan(args ...interface{}) string + func GetEnableFastStorage() bool + func GetFastNodeCacheSize() int + func GetFastStorageVersion(db dbm.DB) (int64, error) + func GetFinalCommitGapOffset() int64 + func GetIgnoreVersionCheck() bool + func Green(args ...interface{}) string + func IsFastStorageStrategy(db dbm.DB) bool + func NewIterator(start, end []byte, ascending bool, tree *ImmutableTree) dbm.Iterator + func ParseDBName(db dbm.DB) string + func PrintTree(tree *ImmutableTree) + func RegisterWire(cdc *amino.Codec) + func Repair013Orphans(db dbm.DB) (uint64, error) + func SetEnableFastStorage(enable bool) + func SetFinalCommitGapOffset(offset int64) + func SetForceReadIavl(enable bool) + func SetIgnoreAutoUpgrade(enable bool) + func SetIgnoreVersionCheck(check bool) + func SetLogFunc(l LogFuncType) + func SetLogger(l logger) + func SetProduceDelta(pd bool) + func UpdateCommitGapHeight(gap int64) + func ValueOpDecoder(pop merkle.ProofOp) (merkle.ProofOperator, error) + func WriteDOTGraph(w io.Writer, tree *ImmutableTree, paths []PathToLeaf) + type AbsenceOp struct + Proof *RangeProof + func NewAbsenceOp(key []byte, proof *RangeProof) AbsenceOp + func (op AbsenceOp) GetKey() []byte + func (op AbsenceOp) ProofOp() merkle.ProofOp + func (op AbsenceOp) Run(args [][]byte) ([][]byte, error) + func (op AbsenceOp) String() string + type CommitOrphansImp struct + CommitValue int64 + Key string + func (ci *CommitOrphansImp) MarshalToAmino(cdc *amino.Codec) ([]byte, error) + func (ci *CommitOrphansImp) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error + type ExportNode struct + Height int8 + Key []byte + Value []byte + Version int64 + type Exporter struct + func (e *Exporter) Close() + func (e *Exporter) Next() (*ExportNode, error) + type FastIterator struct + func (iter *FastIterator) Close() + func (iter *FastIterator) Domain() ([]byte, []byte) + func (iter *FastIterator) Error() error + func (iter *FastIterator) Key() []byte + func (iter *FastIterator) Next() + func (iter *FastIterator) Valid() bool + func (iter *FastIterator) Value() []byte + type FastIteratorWithCache struct + func NewFastIteratorWithCache(start, end []byte, ascending bool, ndb *nodeDB) *FastIteratorWithCache + type FastNode struct + func DeserializeFastNode(key []byte, buf []byte) (*FastNode, error) + func NewFastNode(key []byte, value []byte, version int64) *FastNode + type FastNodeCache struct + type ImmutableTree struct + func NewImmutableTree(db dbm.DB, cacheSize int) *ImmutableTree + func NewImmutableTreeWithOpts(db dbm.DB, cacheSize int, opts *Options) *ImmutableTree + func (t *ImmutableTree) DebugFssVersion() ([]byte, error) + func (t *ImmutableTree) DebugGetNode(nodeHash []byte) *Node + func (t *ImmutableTree) Export() *Exporter + func (t *ImmutableTree) Get(key []byte) []byte + func (t *ImmutableTree) GetByIndex(index int64) (key []byte, value []byte) + func (t *ImmutableTree) GetMembershipProof(key []byte) (*ics23.CommitmentProof, error) + func (t *ImmutableTree) GetNonMembershipProof(key []byte) (*ics23.CommitmentProof, error) + func (t *ImmutableTree) GetPersistedRoots() map[int64][]byte + func (t *ImmutableTree) GetRangeWithProof(startKey []byte, endKey []byte, limit int) (keys, values [][]byte, proof *RangeProof, err error) + func (t *ImmutableTree) GetUpgradeVersion() int64 + func (t *ImmutableTree) GetWithIndex(key []byte) (index int64, value []byte) + func (t *ImmutableTree) GetWithProof(key []byte) (value []byte, proof *RangeProof, err error) + func (t *ImmutableTree) GetWithProof2(key []byte) (value []byte, proof *RangeProof, err error) + func (t *ImmutableTree) Has(key []byte) bool + func (t *ImmutableTree) Hash() []byte + func (t *ImmutableTree) Height() int8 + func (t *ImmutableTree) IsFastCacheEnabled() bool + func (t *ImmutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool) + func (t *ImmutableTree) IterateRange(start, end []byte, ascending bool, fn func(key []byte, value []byte) bool) (stopped bool) + func (t *ImmutableTree) IterateRangeInclusive(start, end []byte, ascending bool, ...) (stopped bool) + func (t *ImmutableTree) Iterator(start, end []byte, ascending bool) dbm.Iterator + func (t *ImmutableTree) RenderShape(indent string, encoder NodeEncoder) []string + func (t *ImmutableTree) SetUpgradeVersion(version int64) + func (t *ImmutableTree) Size() int64 + func (t *ImmutableTree) String() string + func (t *ImmutableTree) Version() int64 + type Importer struct + func (i *Importer) Add(exportNode *ExportNode) error + func (i *Importer) Close() + func (i *Importer) Commit() error + type Iterator struct + func (iter *Iterator) Close() + func (iter *Iterator) Domain() ([]byte, []byte) + func (iter *Iterator) Error() error + func (iter *Iterator) IsFast() bool + func (iter *Iterator) Key() []byte + func (iter *Iterator) Next() + func (iter *Iterator) Valid() bool + func (iter *Iterator) Value() []byte + type KeyFormat struct + func NewKeyFormat(prefix byte, layout ...int) *KeyFormat + func (kf *KeyFormat) Key(args ...interface{}) []byte + func (kf *KeyFormat) KeyBytes(segments ...[]byte) []byte + func (kf *KeyFormat) Prefix() string + func (kf *KeyFormat) Scan(key []byte, args ...interface{}) + func (kf *KeyFormat) ScanBytes(key []byte) [][]byte + type LogFuncType func(level int, format string, args ...interface{}) + type MutableTree struct + func NewMutableTree(db dbm.DB, cacheSize int) (*MutableTree, error) + func NewMutableTreeWithOpts(db dbm.DB, cacheSize int, opts *Options) (*MutableTree, error) + func (tree *MutableTree) AvailableVersions() []int + func (tree *MutableTree) DeleteVersion(version int64) error + func (tree *MutableTree) DeleteVersions(versions ...int64) error + func (tree *MutableTree) DeleteVersionsRange(fromVersion, toVersion int64, enforce ...bool) error + func (tree *MutableTree) Get(key []byte) []byte + func (tree *MutableTree) GetCommitVersion() int64 + func (tree *MutableTree) GetDBReadCount() int + func (tree *MutableTree) GetDBReadTime() int + func (tree *MutableTree) GetDBWriteCount() int + func (tree *MutableTree) GetDelta() + func (tree *MutableTree) GetImmutable(version int64) (*ImmutableTree, error) + func (tree *MutableTree) GetModuleName() string + func (tree *MutableTree) GetNodeReadCount() int + func (tree *MutableTree) GetUpgradeVersion() int64 + func (tree *MutableTree) GetVersioned(key []byte, version int64) (index int64, value []byte) + func (tree *MutableTree) GetVersionedRangeWithProof(startKey, endKey []byte, limit int, version int64) (keys, values [][]byte, proof *RangeProof, err error) + func (tree *MutableTree) GetVersionedWithProof(key []byte, version int64) ([]byte, *RangeProof, error) + func (tree *MutableTree) GetVersions() ([]int64, error) + func (tree *MutableTree) Hash() []byte + func (tree *MutableTree) Import(version int64) (*Importer, error) + func (tree *MutableTree) IsEmpty() bool + func (tree *MutableTree) IsUpgradeable() bool + func (tree *MutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool) + func (tree *MutableTree) Iterator(start, end []byte, ascending bool) dbm.Iterator + func (tree *MutableTree) LazyLoadVersion(targetVersion int64) (int64, error) + func (tree *MutableTree) Load() (int64, error) + func (tree *MutableTree) LoadVersion(targetVersion int64) (int64, error) + func (tree *MutableTree) LoadVersionForOverwriting(targetVersion int64) (int64, error) + func (tree *MutableTree) NewBatch() dbm.Batch + func (tree *MutableTree) PreChanges(keys []string, setOrDel []byte) + func (tree *MutableTree) Remove(key []byte) ([]byte, bool) + func (tree *MutableTree) ResetCount() + func (tree *MutableTree) Rollback() + func (tree *MutableTree) SaveBranch(batch dbm.Batch, node *Node) []byte + func (tree *MutableTree) SaveVersion(useDeltas bool) ([]byte, int64, TreeDelta, error) + func (tree *MutableTree) SaveVersionAsync(version int64, useDeltas bool) ([]byte, int64, error) + func (tree *MutableTree) SaveVersionSync(version int64, useDeltas bool) ([]byte, int64, error) + func (tree *MutableTree) Set(key, value []byte) bool + func (tree *MutableTree) SetDelta(delta *TreeDelta) + func (tree *MutableTree) SetInitialVersion(version uint64) + func (tree *MutableTree) SetUpgradeVersion(version int64) + func (tree *MutableTree) StopTree() + func (tree *MutableTree) StopTreeWithVersion(version int64) + func (tree *MutableTree) String() string + func (tree *MutableTree) VersionExists(version int64) bool + func (tree *MutableTree) VersionExistsInDb(version int64) bool + func (tree *MutableTree) WorkingHash() []byte + type Node struct + func MakeNode(buf []byte) (*Node, error) + func NewNode(key []byte, value []byte, version int64) *Node + func NodeJsonToNode(nj *NodeJson) *Node + func (node *Node) PathToLeaf(t *ImmutableTree, key []byte) (PathToLeaf, *Node, error) + func (node *Node) String() string + type NodeCache struct + type NodeEncoder func(id []byte, depth int, isLeaf bool) string + type NodeJson struct + Hash []byte + Height int8 + Key []byte + LeftHash []byte + Persisted bool + PrePersisted bool + RightHash []byte + Size int64 + Value []byte + Version int64 + func NodeToNodeJson(node *Node) *NodeJson + func (nj *NodeJson) MarshalToAmino(cdc *amino.Codec) ([]byte, error) + func (nj *NodeJson) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error + type NodeJsonImp struct + Key string + NodeValue *NodeJson + func (ni *NodeJsonImp) MarshalToAmino(cdc *amino.Codec) ([]byte, error) + func (ni *NodeJsonImp) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error + type Options struct + InitialVersion uint64 + Sync bool + UpgradeVersion uint64 + func DefaultOptions() Options + type OrphanInfo struct + type PathToLeaf []ProofInnerNode + func (pl PathToLeaf) Index() (idx int64) + func (pl PathToLeaf) String() string + type ProofInnerNode struct + Height int8 + Left []byte + Right []byte + Size int64 + Version int64 + func (pin ProofInnerNode) Hash(childHash []byte) []byte + func (pin ProofInnerNode) String() string + type ProofLeafNode struct + Key cmn.HexBytes + ValueHash cmn.HexBytes + Version int64 + func (pln ProofLeafNode) Hash() []byte + func (pln ProofLeafNode) String() string + type RangeProof struct + InnerNodes []PathToLeaf + Leaves []ProofLeafNode + LeftPath PathToLeaf + func (proof *RangeProof) ComputeRootHash() []byte + func (proof *RangeProof) Keys() (keys [][]byte) + func (proof *RangeProof) LeftIndex() int64 + func (proof *RangeProof) String() string + func (proof *RangeProof) StringIndented(indent string) string + func (proof *RangeProof) Verify(root []byte) error + func (proof *RangeProof) VerifyAbsence(key []byte) error + func (proof *RangeProof) VerifyItem(key, value []byte) error + type RuntimeState struct + type SyncMap struct + func NewSyncMap() *SyncMap + func (sm *SyncMap) Clone() map[int64]bool + func (sm *SyncMap) Delete(key int64) + func (sm *SyncMap) DeleteWithoutLock(key int64) + func (sm *SyncMap) Get(key int64) bool + func (sm *SyncMap) Has(key int64) bool + func (sm *SyncMap) Len() int + func (sm *SyncMap) Range(f func(key int64, value bool) bool) + func (sm *SyncMap) Set(key int64, value bool) + type TreeDelta struct + CommitOrphansDelta []*CommitOrphansImp + NodesDelta []*NodeJsonImp + OrphansDelta []*NodeJson + func (td *TreeDelta) MarshalToAmino(cdc *amino.Codec) ([]byte, error) + func (td *TreeDelta) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error + type TreeDeltaMap map[string]*TreeDelta + func (tdm TreeDeltaMap) MarshalAmino() ([]*TreeDeltaMapImp, error) + func (tdm TreeDeltaMap) MarshalToAmino(cdc *amino.Codec) ([]byte, error) + func (tdm TreeDeltaMap) UnmarshalAmino(treeDeltaList []*TreeDeltaMapImp) error + func (tdm TreeDeltaMap) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error + type TreeDeltaMapImp struct + Key string + TreeValue *TreeDelta + func (ti *TreeDeltaMapImp) MarshalToAmino(cdc *amino.Codec) ([]byte, error) + func (ti *TreeDeltaMapImp) UnmarshalFromAmino(cdc *amino.Codec, data []byte) error + type TreeMap struct + type UnsavedFastIterator struct + func (iter *UnsavedFastIterator) Close() + func (iter *UnsavedFastIterator) Domain() ([]byte, []byte) + func (iter *UnsavedFastIterator) Error() error + func (iter *UnsavedFastIterator) Key() []byte + func (iter *UnsavedFastIterator) Next() + func (iter *UnsavedFastIterator) Valid() bool + func (iter *UnsavedFastIterator) Value() []byte + type UnsavedFastIteratorWithCache struct + func NewUnsavedFastIteratorWithCache(start, end []byte, ascending bool, ndb *nodeDB, fncIn *fastNodeChanges) *UnsavedFastIteratorWithCache + type ValueOp struct + Proof *RangeProof + func NewValueOp(key []byte, proof *RangeProof) ValueOp + func (op ValueOp) GetKey() []byte + func (op ValueOp) ProofOp() merkle.ProofOp + func (op ValueOp) Run(args [][]byte) ([][]byte, error) + func (op ValueOp) String() string + type VersionInfo struct + Branch string + GitCommit string + GoVersion string + IAVL string + func GetVersionInfo() VersionInfo + func (v VersionInfo) String() string