Documentation
¶
Index ¶
- Variables
- func AppendBOCWithOptions(dst []byte, roots []*Cell, opts BOCSerializeOptions) ([]byte, error)
- func ApplyMerkleUpdate(from, update *Cell) (*Cell, MerkleUpdateReuse, error)
- func CheckProof(proof *Cell, hash []byte) error
- func CheckProofVirtualized(proof *Cell, hash []byte) error
- func CompressBOC(roots []*Cell, algo CompressionAlgorithm, state *Cell) ([]byte, error)
- func ComputeFileHash(root *Cell) []byte
- func FromBOCMultiRootReader(reader io.Reader, options BOCParseOptions) ([]*Cell, []Cell, error)
- func IsNotEnoughDataError(err error) bool
- func MayApplyMerkleUpdate(from, update *Cell) error
- func NeedStateForDecompression(data []byte) (bool, error)
- func ToBOCWithFlags(roots []*Cell, flags ...bool) []bytedeprecated
- func ToBOCWithOptions(roots []*Cell, opts BOCSerializeOptions) []byte
- func ToBOCWithOptionsErr(roots []*Cell, opts BOCSerializeOptions) ([]byte, error)
- func ToLargeBOC(w io.Writer, rootHashes []Hash, opts BOCSerializeOptions, ...) error
- func ToLargeBOCOnePass(w io.Writer, rootHashes []Hash, opts BOCSerializeOptions, ...) error
- func ValidateMerkleUpdate(update *Cell) error
- func WriteBOCWithOptions(w io.Writer, roots []*Cell, opts BOCSerializeOptions) error
- type AugDictFilterFunc
- type AugDictForeachFunc
- type AugDictItem
- type AugDictIterator
- type AugDictTraverseFunc
- type Augmentation
- type AugmentedDictionary
- func (d *AugmentedDictionary) AsCell() *Cell
- func (d *AugmentedDictionary) CheckForEach(fn DictForeachFunc, invertFirst bool, shuffle bool) (bool, error)
- func (d *AugmentedDictionary) CheckForEachExtra(fn AugDictForeachFunc, invertFirst bool) (bool, error)
- func (d *AugmentedDictionary) CombineWith(other *AugmentedDictionary) (bool, error)
- func (d *AugmentedDictionary) Copy() *AugmentedDictionary
- func (d *AugmentedDictionary) Count() (int, error)
- func (d *AugmentedDictionary) CutPrefixSubdict(prefix *Cell, removePrefix bool) (bool, error)
- func (d *AugmentedDictionary) Delete(key *Cell) error
- func (d *AugmentedDictionary) DeleteIntKey(key *big.Int) error
- func (d *AugmentedDictionary) ExtractPrefixSubdictRoot(prefix *Cell, removePrefix bool) (*Cell, error)
- func (d *AugmentedDictionary) Filter(fn AugDictFilterFunc) (int, error)
- func (d *AugmentedDictionary) ForEachValueExtra(fn func(value, extra *Slice) (bool, error)) error
- func (d *AugmentedDictionary) Get(key *Cell) *Cell
- func (d *AugmentedDictionary) GetCommonPrefix(limit ...uint) (*Cell, error)
- func (d *AugmentedDictionary) GetKeySize() uint
- func (d *AugmentedDictionary) GetRootExtra() *Cell
- func (d *AugmentedDictionary) GetWithExtra(key *Cell) *Cell
- func (d *AugmentedDictionary) HasCommonPrefix(prefix *Cell) (bool, error)
- func (d *AugmentedDictionary) IsEmpty() bool
- func (d *AugmentedDictionary) Iterator(rev bool, sgnd bool) (*DictIterator, error)
- func (d *AugmentedDictionary) IteratorAt(key *Cell, rev bool, sgnd bool, allowEq bool) (*DictIterator, error)
- func (d *AugmentedDictionary) IteratorExtra(rev bool, sgnd bool) (*AugDictIterator, error)
- func (d *AugmentedDictionary) IteratorExtraAt(key *Cell, rev bool, sgnd bool, allowEq bool) (*AugDictIterator, error)
- func (d *AugmentedDictionary) LoadRootExtra() (*Slice, error)
- func (d *AugmentedDictionary) LoadValue(key *Cell) (*Slice, error)
- func (d *AugmentedDictionary) LoadValueAndDelete(key *Cell) (*Slice, error)
- func (d *AugmentedDictionary) LoadValueByIntKey(key *big.Int) (*Slice, error)
- func (d *AugmentedDictionary) LoadValueExtra(key *Cell) (*Slice, *Slice, error)
- func (d *AugmentedDictionary) LoadValueExtraAndDelete(key *Cell) (*Slice, *Slice, error)
- func (d *AugmentedDictionary) LoadValueExtraByIntKey(key *big.Int) (*Slice, *Slice, error)
- func (d *AugmentedDictionary) LoadValueWithExtra(key *Cell) (*Slice, error)
- func (d *AugmentedDictionary) LoadValueWithExtraAndDelete(key *Cell) (*Slice, error)
- func (d *AugmentedDictionary) LoadValueWithExtraByIntKey(key *big.Int) (*Slice, error)
- func (d *AugmentedDictionary) LookupNearestKey(key *Cell, fetchNext bool, allowEq bool, invertFirst bool) (*Cell, *Slice, error)
- func (d *AugmentedDictionary) MustToCell() *Cell
- func (d *AugmentedDictionary) Range(rev bool, sgnd bool) ([]DictItem, error)
- func (d *AugmentedDictionary) RangeExtra(rev bool, sgnd bool) ([]AugDictItem, error)
- func (d *AugmentedDictionary) Set(key, value *Cell) error
- func (d *AugmentedDictionary) SetBuilder(key *Cell, value *Builder) error
- func (d *AugmentedDictionary) SetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (bool, error)
- func (d *AugmentedDictionary) SetIntKey(key *big.Int, value *Cell) error
- func (d *AugmentedDictionary) SetTrace(trace *Trace) *AugmentedDictionary
- func (d *AugmentedDictionary) SetWithMode(key, value *Cell, mode DictSetMode) (bool, error)
- func (d *AugmentedDictionary) ToCell() (*Cell, error)
- func (d *AugmentedDictionary) TraverseExtra(fn AugDictTraverseFunc) (*Slice, *Slice, error)
- func (d *AugmentedDictionary) ValidateAll() bool
- func (d *AugmentedDictionary) ValidateCheck(fn DictForeachFunc, invertFirst bool) (bool, error)
- func (d *AugmentedDictionary) ValidateCheckExtra(fn AugDictForeachFunc, invertFirst bool) (bool, error)
- type AugmentedExtraSkipper
- type BOCCellMeta
- type BOCCellRefs
- type BOCCellView
- type BOCNoCopyReader
- type BOCParseOptions
- type BOCSerializeOptions
- type BOCView
- func (v *BOCView) Cell(idx uint32) (BOCCellView, error)
- func (v *BOCView) CellMeta(idx uint32) (BOCCellMeta, error)
- func (v *BOCView) Cells() uint32
- func (v *BOCView) NewReader() *BOCViewReader
- func (v *BOCView) ReadCell(idx uint32, scratch []byte) (BOCCellView, []byte, error)
- func (v *BOCView) Roots() []uint32
- type BOCViewOptions
- type BOCViewReader
- type Builder
- func (b *Builder) BitsLeft() uint
- func (b *Builder) BitsUsed() uint
- func (b *Builder) CanExtendBy(bits uint, refs uint) bool
- func (b *Builder) Copy() *Builder
- func (b *Builder) Depth() uint16
- func (b *Builder) EndCell() *Cell
- func (b *Builder) EndCellSpecial(special bool) (*Cell, error)
- func (b *Builder) MustStoreAddr(addr *address.Address) *Builder
- func (b *Builder) MustStoreBigCoins(value *big.Int) *Builder
- func (b *Builder) MustStoreBigInt(value *big.Int, sz uint) *Builder
- func (b *Builder) MustStoreBigUInt(value *big.Int, sz uint) *Builder
- func (b *Builder) MustStoreBigVarInt(val *big.Int, sz uint) *Builder
- func (b *Builder) MustStoreBigVarUInt(val *big.Int, sz uint) *Builder
- func (b *Builder) MustStoreBinarySnake(data []byte) *Builder
- func (b *Builder) MustStoreBoolBit(value bool) *Builder
- func (b *Builder) MustStoreBuilder(builder *Builder) *Builder
- func (b *Builder) MustStoreCoins(value uint64) *Builder
- func (b *Builder) MustStoreDict(dict SerializableToCell) *Builder
- func (b *Builder) MustStoreInt(value int64, sz uint) *Builder
- func (b *Builder) MustStoreMaybeRef(ref *Cell) *Builder
- func (b *Builder) MustStoreRef(ref *Cell) *Builder
- func (b *Builder) MustStoreSlice(bytes []byte, sz uint) *Builder
- func (b *Builder) MustStoreStringSnake(str string) *Builder
- func (b *Builder) MustStoreUInt(value uint64, sz uint) *Builder
- func (b *Builder) MustStoreVarInt(val int64, sz uint) *Builder
- func (b *Builder) MustStoreVarUInt(val uint64, sz uint) *Builder
- func (b *Builder) RefsLeft() uint
- func (b *Builder) RefsUsed() int
- func (b *Builder) SetTrace(trace *Trace) *Builder
- func (b *Builder) StoreAddr(addr *address.Address) error
- func (b *Builder) StoreBigCoins(value *big.Int) error
- func (b *Builder) StoreBigInt(value *big.Int, sz uint) error
- func (b *Builder) StoreBigUInt(value *big.Int, sz uint) error
- func (b *Builder) StoreBigVarInt(val *big.Int, sz uint) error
- func (b *Builder) StoreBigVarUInt(val *big.Int, sz uint) error
- func (b *Builder) StoreBinarySnake(data []byte) error
- func (b *Builder) StoreBoolBit(value bool) error
- func (b *Builder) StoreBuilder(builder *Builder) error
- func (b *Builder) StoreBuilderUncheckedDepth(builder *Builder) error
- func (b *Builder) StoreCoins(value uint64) error
- func (b *Builder) StoreDict(dict SerializableToCell) error
- func (b *Builder) StoreInt(value int64, sz uint) error
- func (b *Builder) StoreMaybeRef(ref *Cell) error
- func (b *Builder) StoreMaybeRefUncheckedDepth(ref *Cell) error
- func (b *Builder) StoreRef(ref *Cell) error
- func (b *Builder) StoreRefUncheckedDepth(ref *Cell) error
- func (b *Builder) StoreSameBit(bit bool, bits uint) error
- func (b *Builder) StoreSlice(bytes []byte, sz uint) error
- func (b *Builder) StoreStringSnake(str string) error
- func (b *Builder) StoreUInt(value uint64, sz uint) error
- func (b *Builder) StoreVarInt(val int64, sz uint) error
- func (b *Builder) StoreVarUInt(val uint64, sz uint) error
- func (b *Builder) String() string
- func (b *Builder) ToSlice() *Slice
- func (b *Builder) Trace() *Trace
- func (b *Builder) WithoutTrace() *Builder
- type Cell
- func CombineMerkleUpdate(ab, bc *Cell) (*Cell, error)
- func CreateMerkleProof(body *Cell) (*Cell, error)
- func CreateMerkleUpdate(left, right *Cell) (*Cell, error)
- func CreatePrunedBranch(source *Cell, newLevel, virtualLevel int) (*Cell, error)
- func CreateWithLazyRefsUnsafe(descriptors uint16, data, hashes []byte, depths []uint16, refs []LazyRef, ...) (*Cell, error)
- func DecompressBOC(data []byte, maxSize int, state *Cell) ([]*Cell, error)
- func DecompressBOCSerialized(data []byte, maxSize int, state *Cell, opts BOCSerializeOptions) ([]*Cell, []byte, error)
- func FromBOC(data []byte) (*Cell, error)
- func FromBOCMultiRoot(data []byte) ([]*Cell, error)
- func FromBOCMultiRootWithOptions(data []byte, options BOCParseOptions) ([]*Cell, error)
- func FromBOCWithOptions(data []byte, options BOCParseOptions) (*Cell, error)
- func ReserializeBOC(data []byte, opts BOCSerializeOptions) ([]*Cell, []byte, error)
- func UnwrapProof(proof *Cell, hash []byte) (*Cell, error)
- func UnwrapProofVirtualized(proof *Cell, hash []byte) (*Cell, error)
- func (c *Cell) ActualLevel() int
- func (c *Cell) AppendBOCWithOptions(dst []byte, opts BOCSerializeOptions) ([]byte, error)
- func (c *Cell) AsAugDict(keySz uint, aug Augmentation) *AugmentedDictionary
- func (c *Cell) AsDict(keySz uint) *Dictionary
- func (c *Cell) AsPrefixDict(keySz uint) *PrefixDictionary
- func (c *Cell) BeginParse() (*Slice, error)
- func (c *Cell) BeginParseInto(dst *Slice) error
- func (c *Cell) BeginParseIntoWithoutTrace(dst *Slice) error
- func (c *Cell) BeginParseWithTrace(trace *Trace) (*Slice, error)
- func (c *Cell) BeginParseWithoutTrace() (*Slice, error)
- func (c *Cell) BitsSize() uint
- func (c *Cell) CreateProof(skeleton *ProofSkeleton) (*Cell, error)deprecated
- func (c *Cell) CreateUsageProof(usageTree *CellUsageTree) (*Cell, error)
- func (c *Cell) Depth(level ...int) uint16
- func (c *Cell) Dump(limitLength ...int) string
- func (c *Cell) DumpBits(limitLength ...int) string
- func (c *Cell) EffectiveLevel() int
- func (c *Cell) GetMetadata() Metadata
- func (c *Cell) GetType() Type
- func (c *Cell) Hash(level ...int) []byte
- func (c *Cell) HashKey(level ...int) Hash
- func (c *Cell) IsLazy() bool
- func (c *Cell) IsSpecial() bool
- func (c *Cell) IsVirtualized() bool
- func (c *Cell) Level() int
- func (c *Cell) LevelMask() LevelMask
- func (c *Cell) MarshalJSON() ([]byte, error)
- func (c *Cell) MustBeginParse() *Slice
- func (c *Cell) MustPeekRef(i int) *Cell
- func (c *Cell) PeekRef(i int) (*Cell, error)
- func (c *Cell) Prewarm() (*Cell, error)
- func (c *Cell) PrewarmRecursive(depth int) (*Cell, error)
- func (c *Cell) RebuildWithRefs(refs []*Cell) (*Cell, error)
- func (c *Cell) RefsNum() uint
- func (c *Cell) SerializeBOCBodyTo(dst []byte) int
- func (c *Cell) SerializedBOCBodySize() int
- func (c *Cell) Sign(key ed25519.PrivateKey) []byte
- func (c *Cell) String() string
- func (c *Cell) ToBOC() []byte
- func (c *Cell) ToBOCWithFlags(flags ...bool) []bytedeprecated
- func (c *Cell) ToBOCWithOptions(opts BOCSerializeOptions) []byte
- func (c *Cell) ToBOCWithOptionsErr(opts BOCSerializeOptions) ([]byte, error)
- func (c *Cell) ToBuilder() *Builder
- func (c *Cell) Trace() *Trace
- func (c *Cell) UnmarshalJSON(bytes []byte) error
- func (c *Cell) Verify(key ed25519.PublicKey, signature []byte) bool
- func (c *Cell) Virtualize(effectiveLevel uint8) *Cell
- func (c *Cell) WithTrace(trace *Trace) *Cell
- func (c *Cell) WithoutTrace() *Cell
- type CellUsageTree
- func (t *CellUsageTree) CreateChild(node TraceNode, refIdx int) TraceNode
- func (t *CellUsageTree) CreateMerkleUpdate(from, to *Cell) (*Cell, error)
- func (t *CellUsageTree) GetChild(node TraceNode, refIdx int) TraceNode
- func (t *CellUsageTree) HasMark(node TraceNode) bool
- func (t *CellUsageTree) IsLoaded(node TraceNode) bool
- func (t *CellUsageTree) MarkPath(node TraceNode) bool
- func (t *CellUsageTree) NodeCount() int
- func (t *CellUsageTree) NodeForCell(c *Cell) (TraceNode, bool)
- func (t *CellUsageTree) NodeForTrace(trace *Trace) (TraceNode, bool)
- func (t *CellUsageTree) OnLoad(node TraceNode, c *Cell)
- func (t *CellUsageTree) Parent(node TraceNode) TraceNode
- func (t *CellUsageTree) RootNode() TraceNode
- func (t *CellUsageTree) RootTrace() *Trace
- func (t *CellUsageTree) SetCellLoadCallback(fn func(*Cell))
- func (t *CellUsageTree) SetIgnoreLoads(ignore bool)
- func (t *CellUsageTree) SetMark(node TraceNode, mark bool)
- func (t *CellUsageTree) SetUseMarkForIsLoaded(useMark bool)
- func (t *CellUsageTree) Trace(node TraceNode) *Trace
- type CompressionAlgorithm
- type DictBulkKV
- type DictFilterAction
- type DictFilterFunc
- type DictForeachFunc
- type DictItem
- type DictIterator
- type DictKV
- type DictSetMode
- type Dictionary
- func (d *Dictionary) AsCell() *Cell
- func (d *Dictionary) CheckForEach(fn DictForeachFunc, invertFirst bool, shuffle bool) (bool, error)
- func (d *Dictionary) Copy() *Dictionary
- func (d *Dictionary) CutPrefixSubdict(prefix *Cell, removePrefix bool) (bool, error)
- func (d *Dictionary) Delete(key *Cell) error
- func (d *Dictionary) DeleteByBytesKey(key []byte) error
- func (d *Dictionary) DeleteIntKey(key *big.Int) error
- func (d *Dictionary) ExtractPrefixSubdictRoot(prefix *Cell, removePrefix bool) (*Cell, error)
- func (d *Dictionary) Filter(fn DictFilterFunc) (int, error)
- func (d *Dictionary) Get(key *Cell) *Celldeprecated
- func (d *Dictionary) GetCommonPrefix(limit ...uint) (*Cell, error)
- func (d *Dictionary) GetKeySize() uint
- func (d *Dictionary) HasCommonPrefix(prefix *Cell) (bool, error)
- func (d *Dictionary) IsEmpty() bool
- func (d *Dictionary) Iterator(rev bool, sgnd bool) (*DictIterator, error)
- func (d *Dictionary) IteratorAt(key *Cell, rev bool, sgnd bool, allowEq bool) (*DictIterator, error)
- func (d *Dictionary) LoadAll(skipPruned ...bool) ([]DictKV, error)
- func (d *Dictionary) LoadMax() (*Cell, *Slice, error)
- func (d *Dictionary) LoadMaxAndDelete() (*Cell, *Slice, error)
- func (d *Dictionary) LoadMin() (*Cell, *Slice, error)
- func (d *Dictionary) LoadMinAndDelete() (*Cell, *Slice, error)
- func (d *Dictionary) LoadMinMax(fetchMax bool, invertFirst bool) (*Cell, *Slice, error)
- func (d *Dictionary) LoadMinMaxAndDelete(fetchMax bool, invertFirst bool) (*Cell, *Slice, error)
- func (d *Dictionary) LoadValue(key *Cell) (*Slice, error)
- func (d *Dictionary) LoadValueAndDelete(key *Cell) (*Slice, error)
- func (d *Dictionary) LoadValueAndSet(key, value *Cell) (*Slice, bool, error)
- func (d *Dictionary) LoadValueAndSetBuilder(key *Cell, value *Builder) (*Slice, bool, error)
- func (d *Dictionary) LoadValueAndSetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (*Slice, bool, error)
- func (d *Dictionary) LoadValueAndSetWithMode(key, value *Cell, mode DictSetMode) (*Slice, bool, error)
- func (d *Dictionary) LoadValueByBytesKey(key []byte) (*Slice, error)
- func (d *Dictionary) LoadValueByIntKey(key *big.Int) (*Slice, error)
- func (d *Dictionary) LoadValueByUintKey(key uint64) (*Slice, error)
- func (d *Dictionary) LookupNearestKey(key *Cell, fetchNext bool, allowEq bool, invertFirst bool) (*Cell, *Slice, error)
- func (d *Dictionary) Range(rev bool, sgnd bool) ([]DictItem, error)
- func (d *Dictionary) Set(key, value *Cell) error
- func (d *Dictionary) SetBuilder(key *Cell, value *Builder) error
- func (d *Dictionary) SetBuilderByBytesKey(key []byte, value *Builder) error
- func (d *Dictionary) SetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (bool, error)
- func (d *Dictionary) SetIntKey(key *big.Int, value *Cell) error
- func (d *Dictionary) SetTrace(trace *Trace) *Dictionary
- func (d *Dictionary) SetWithMode(key, value *Cell, mode DictSetMode) (bool, error)
- func (d *Dictionary) String() string
- func (d *Dictionary) ToCell() (*Cell, error)
- func (d *Dictionary) ValidateAll() bool
- func (d *Dictionary) ValidateCheck(fn DictForeachFunc, invertFirst bool) (bool, error)
- type Hash
- type HashmapKV
- type LargeBOCLoader
- type LargeBOCMetaRecord
- type LargeBOCOnePassLoader
- type LargeBOCPayloadRecord
- type LargeBOCRecord
- type LazyCellLoader
- type LazyRef
- type LevelMask
- type MerkleProofBuilder
- type MerkleUpdateReuse
- type MerkleUpdateReusedCell
- type MerkleUpdateReusedRef
- type Metadata
- type NotEnoughDataError
- type PrefixDictionary
- func (d *PrefixDictionary) AsCell() *Cell
- func (d *PrefixDictionary) Copy() *PrefixDictionary
- func (d *PrefixDictionary) Delete(key *Cell) error
- func (d *PrefixDictionary) DeleteIntKey(key *big.Int) error
- func (d *PrefixDictionary) Get(key *Cell) *Cell
- func (d *PrefixDictionary) GetKeySize() uint
- func (d *PrefixDictionary) IsEmpty() bool
- func (d *PrefixDictionary) LoadValue(key *Cell) (*Slice, error)
- func (d *PrefixDictionary) LoadValueAndDelete(key *Cell) (*Slice, error)
- func (d *PrefixDictionary) LoadValueByIntKey(key *big.Int) (*Slice, error)
- func (d *PrefixDictionary) LookupPrefix(key *Cell) (*Slice, uint, error)
- func (d *PrefixDictionary) MustToCell() *Cell
- func (d *PrefixDictionary) Set(key, value *Cell) error
- func (d *PrefixDictionary) SetBuilder(key *Cell, value *Builder) error
- func (d *PrefixDictionary) SetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (bool, error)
- func (d *PrefixDictionary) SetIntKey(key *big.Int, value *Cell) error
- func (d *PrefixDictionary) SetTrace(trace *Trace) *PrefixDictionary
- func (d *PrefixDictionary) SetWithMode(key, value *Cell, mode DictSetMode) (bool, error)
- func (d *PrefixDictionary) ToCell() (*Cell, error)
- type ProofSkeletondeprecated
- type ReadOnlyAugmentation
- type RefMetadata
- type SerializableToCell
- type Slice
- func (c *Slice) AugDictInlineIterator(keySz uint, aug Augmentation, skipValue AugmentedExtraSkipper, rev bool, ...) (*AugDictIterator, error)
- func (c *Slice) AugDictInlineIteratorAt(keySz uint, aug Augmentation, skipValue AugmentedExtraSkipper, key *Cell, ...) (*AugDictIterator, error)
- func (c *Slice) BaseCell() *Cell
- func (c *Slice) BitAt(offset uint) (uint8, error)
- func (c *Slice) BitRange() (start, end uint)
- func (c *Slice) BitsEqual(other *Slice) bool
- func (c *Slice) BitsLeft() uint
- func (c *Slice) Copy() *Slice
- func (c *Slice) CountInlineDictLeaves(keySz uint) (int, error)
- func (c *Slice) CountLeading(bit bool) int
- func (c *Slice) CountTrailing(bit bool) int
- func (c *Slice) Depth() uint16
- func (c *Slice) FetchSubslice(bits uint, refs int) (*Slice, error)
- func (c *Slice) HasPrefix(prefix *Slice) bool
- func (c *Slice) IsPrefixOf(other *Slice) bool
- func (c *Slice) IsProperPrefixOf(other *Slice) bool
- func (c *Slice) IsProperSuffixOf(other *Slice) bool
- func (c *Slice) IsSpecial() bool
- func (c *Slice) IsSuffixOf(other *Slice) bool
- func (c *Slice) LexCompare(other *Slice) int
- func (c *Slice) LoadAddr() (*address.Address, error)
- func (c *Slice) LoadAugDict(keySz uint, aug Augmentation, asProof bool) (*AugmentedDictionary, error)
- func (c *Slice) LoadBigCoins() (*big.Int, error)
- func (c *Slice) LoadBigInt(sz uint) (*big.Int, error)
- func (c *Slice) LoadBigUInt(sz uint) (*big.Int, error)
- func (c *Slice) LoadBigUIntInto(dst *big.Int, sz uint) error
- func (c *Slice) LoadBinarySnake() ([]byte, error)
- func (c *Slice) LoadBoolBit() (bool, error)
- func (c *Slice) LoadCoins() (uint64, error)
- func (c *Slice) LoadDict(keySz uint) (*Dictionary, error)
- func (c *Slice) LoadInt(sz uint) (int64, error)
- func (c *Slice) LoadMaybeRef() (*Slice, error)
- func (c *Slice) LoadPrefixDict(keySz uint) (*PrefixDictionary, error)
- func (c *Slice) LoadRef() (*Slice, error)
- func (c *Slice) LoadRefCell() (*Cell, error)
- func (c *Slice) LoadSlice(sz uint) ([]byte, error)
- func (c *Slice) LoadSliceInto(dst []byte, sz uint) error
- func (c *Slice) LoadStringSnake() (string, error)
- func (c *Slice) LoadUInt(sz uint) (uint64, error)
- func (c *Slice) LoadVarInt(sz uint) (*big.Int, error)
- func (c *Slice) LoadVarUInt(sz uint) (*big.Int, error)
- func (c *Slice) MustLoadAddr() *address.Address
- func (c *Slice) MustLoadBigCoins() *big.Int
- func (c *Slice) MustLoadBigUInt(sz uint) *big.Int
- func (c *Slice) MustLoadBinarySnake() []byte
- func (c *Slice) MustLoadBoolBit() bool
- func (c *Slice) MustLoadCoins() uint64
- func (c *Slice) MustLoadDict(keySz uint) *Dictionary
- func (c *Slice) MustLoadInt(sz uint) int64
- func (c *Slice) MustLoadMaybeRef() *Slice
- func (c *Slice) MustLoadPrefixDict(keySz uint) *PrefixDictionary
- func (c *Slice) MustLoadRef() *Slice
- func (c *Slice) MustLoadSlice(sz uint) []byte
- func (c *Slice) MustLoadStringSnake() string
- func (c *Slice) MustLoadUInt(sz uint) uint64
- func (c *Slice) MustLoadVarInt(sz uint) *big.Int
- func (c *Slice) MustLoadVarUInt(sz uint) *big.Int
- func (c *Slice) MustPreloadBigUInt(sz uint) *big.Int
- func (c *Slice) MustPreloadSlice(sz uint) []byte
- func (c *Slice) MustPreloadUInt(sz uint) uint64
- func (c *Slice) MustToCell() *Cell
- func (c *Slice) MustToPrefixDict(keySz uint) *PrefixDictionary
- func (c *Slice) OnlyFirst(bits uint, refs int) bool
- func (c *Slice) OnlyLast(bits uint, refs int) bool
- func (c *Slice) PeekRefCell() (*Cell, error)
- func (c *Slice) PeekRefCellAt(i int) (*Cell, error)
- func (c *Slice) PreloadBigInt(sz uint) (*big.Int, error)
- func (c *Slice) PreloadBigUInt(sz uint) (*big.Int, error)
- func (c *Slice) PreloadBigUIntInto(dst *big.Int, sz uint) error
- func (c *Slice) PreloadRef() (*Slice, error)
- func (c *Slice) PreloadRefCell() (*Cell, error)
- func (c *Slice) PreloadSlice(sz uint) ([]byte, error)
- func (c *Slice) PreloadSliceInto(dst []byte, sz uint) error
- func (c *Slice) PreloadSubslice(bits uint, refs int) (*Slice, error)
- func (c *Slice) PreloadUInt(sz uint) (uint64, error)
- func (c *Slice) RefRange() (start, end int)
- func (c *Slice) RefsNum() int
- func (c *Slice) RemoveTrailing() int
- func (c *Slice) RestBits() (uint, []byte, error)
- func (c *Slice) SetTrace(trace *Trace) *Slice
- func (c *Slice) SkipBits(bits uint) error
- func (c *Slice) SkipBitsAndRefs(bits uint, refs int) error
- func (c *Slice) SkipFirst(bits uint, refs int) bool
- func (c *Slice) SkipLast(bits uint, refs int) bool
- func (c *Slice) String() string
- func (c *Slice) Subslice(offsetBits uint, offsetRefs int, bits uint, refs int) (*Slice, error)
- func (c *Slice) ToAugDict(keySz uint, skipExtra AugmentedExtraSkipper) (*AugmentedDictionary, error)
- func (c *Slice) ToAugDictWithAugmentation(keySz uint, aug Augmentation) (*AugmentedDictionary, error)
- func (c *Slice) ToAugDictWithValue(keySz uint, skipExtra AugmentedExtraSkipper, skipValue AugmentedExtraSkipper) (*AugmentedDictionary, error)
- func (c *Slice) ToAugDictWithValueAndAugmentation(keySz uint, aug Augmentation, skipValue AugmentedExtraSkipper) (*AugmentedDictionary, error)
- func (c *Slice) ToBuilder() *Builder
- func (c *Slice) ToCell() (*Cell, error)
- func (c *Slice) ToDict(keySz uint) (*Dictionary, error)
- func (c *Slice) ToPrefixDict(keySz uint) (*PrefixDictionary, error)
- func (c *Slice) Trace() *Trace
- func (c *Slice) WithoutTrace() *Slice
- type Trace
- type TraceHooks
- type TraceListener
- type TraceNode
- type Type
Constants ¶
This section is empty.
Variables ¶
var ErrAddressTypeNotSupported = errors.New("address type is not supported")
var ErrCellDepthLimit = errors.New("cell depth exceeds max depth")
var ErrDictHasSpecialCells = errors.New("has special cells in tree structure")
var ErrInvalidSize = errors.New("size should be positive")
var ErrLabelExceedsKeyBits = errors.New("label exceeds remaining key bits")
var ErrLazyLoaderNotSet = errors.New("lazy pruned ref loader is not set")
var ErrLazyRefNotFound = errors.New("lazy pruned ref not found")
var ErrNegative = errors.New("value should be non negative")
var ErrNilBigInt = errors.New("value cannot be nil")
var ErrNoMoreRefs = errors.New("no more refs exists")
var ErrNoSuchKeyInDict = errors.New("no such key in dict")
var ErrNotEnoughData = func(has, need int) error { return NotEnoughDataError{Has: has, Need: need} }
var ErrNotFit1023 = errors.New("cell data size should fit into 1023 bits")
var ErrRefCannotBeNil = errors.New("ref cannot be nil")
var ErrSmallSlice = errors.New("too small slice for this size")
var ErrTooBigSize = errors.New("too big size")
var ErrTooBigValue = errors.New("too big value")
var ErrTooMuchRefs = errors.New("too much refs")
var MaxBOCCells = 1 << 20
MaxBOCCells limits how many cells may be decoded from a single BOC payload, including the improved compression/decompression path. Set it to 0 or a negative value to disable the limit.
var MaxBOCRoots = 16384
MaxBOCRoots limits how many roots may be decoded from a single BOC payload, including the improved compression/decompression path. Set it to 0 or a negative value to disable the limit.
var ParallelBOCMinCells = 16384
ParallelBOCMinCells sets the minimum number of cells in a parsed BoC before hash finalization is spread across CPU cores. Set it to 0 or a negative value to always finalize sequentially.
Functions ¶
func AppendBOCWithOptions ¶ added in v1.18.0
func AppendBOCWithOptions(dst []byte, roots []*Cell, opts BOCSerializeOptions) ([]byte, error)
AppendBOCWithOptions serializes roots into BoC and appends the result to dst.
func ApplyMerkleUpdate ¶ added in v1.17.0
func ApplyMerkleUpdate(from, update *Cell) (*Cell, MerkleUpdateReuse, error)
ApplyMerkleUpdate applies update to from and returns the new root with hashes of old-state subtrees reused through pruned boundaries.
func CheckProof ¶ added in v1.6.0
func CheckProofVirtualized ¶ added in v1.17.0
func CompressBOC ¶ added in v1.17.0
func CompressBOC(roots []*Cell, algo CompressionAlgorithm, state *Cell) ([]byte, error)
func ComputeFileHash ¶ added in v1.17.0
func FromBOCMultiRootReader ¶ added in v1.17.0
func IsNotEnoughDataError ¶ added in v1.18.0
IsNotEnoughDataError reports whether err wraps a NotEnoughDataError. It walks the unwrap chain manually to avoid errors.As target boxing.
func MayApplyMerkleUpdate ¶ added in v1.17.0
func NeedStateForDecompression ¶ added in v1.17.0
func ToBOCWithFlags
deprecated
added in
v1.8.0
ToBOCWithFlags serializes roots into BOC using the legacy boolean-flag API. Flags are: first - withCRC, second - withIndex, third - withCache, fourth - withTopHash, fifth - withIntHashes.
Deprecated: use ToBOCWithOptions instead.
func ToBOCWithOptions ¶ added in v1.17.0
func ToBOCWithOptions(roots []*Cell, opts BOCSerializeOptions) []byte
func ToBOCWithOptionsErr ¶ added in v1.17.0
func ToBOCWithOptionsErr(roots []*Cell, opts BOCSerializeOptions) ([]byte, error)
func ToLargeBOC ¶ added in v1.17.0
func ToLargeBOC(w io.Writer, rootHashes []Hash, opts BOCSerializeOptions, loader LargeBOCLoader, cellsCountHint uint64, loadBatchSize int) error
ToLargeBOC serializes roots into BoC and writes the result to w. It follows the same large-BOC shape as the C++ serializer: cells are imported by hash in batches, only compact metadata is retained, and payload records are loaded again in final serialization order. loadBatchSize controls the maximum number of cell records loaded by one loader call.
func ToLargeBOCOnePass ¶ added in v1.17.0
func ToLargeBOCOnePass(w io.Writer, rootHashes []Hash, opts BOCSerializeOptions, loader LargeBOCOnePassLoader, cellsCountHint uint64, loadBatchSize int) error
ToLargeBOCOnePass serializes roots into BoC and writes the result to w. It imports cell metadata and payload data together, so backing storage is read once. Payloads are retained until final serialization, which uses more memory than ToLargeBOC but avoids the second storage pass.
func ValidateMerkleUpdate ¶ added in v1.17.0
func WriteBOCWithOptions ¶ added in v1.17.0
func WriteBOCWithOptions(w io.Writer, roots []*Cell, opts BOCSerializeOptions) error
WriteBOCWithOptions serializes roots into BoC and writes the result to w. It avoids allocating the final BoC byte slice, but still performs the normal prepass needed to order cells, resolve lazy refs, deduplicate cells, and build optional indexes.
Types ¶
type AugDictFilterFunc ¶ added in v1.17.0
type AugDictFilterFunc func(value, extra *Slice, key *Cell) (DictFilterAction, error)
type AugDictForeachFunc ¶ added in v1.17.0
type AugDictItem ¶ added in v1.17.0
type AugDictIterator ¶ added in v1.17.0
type AugDictIterator struct {
// contains filtered or unexported fields
}
func (*AugDictIterator) Err ¶ added in v1.18.0
func (it *AugDictIterator) Err() error
func (*AugDictIterator) Extra ¶ added in v1.17.0
func (it *AugDictIterator) Extra() *Slice
func (*AugDictIterator) Item ¶ added in v1.17.0
func (it *AugDictIterator) Item() AugDictItem
func (*AugDictIterator) Key ¶ added in v1.17.0
func (it *AugDictIterator) Key() *Cell
func (*AugDictIterator) Next ¶ added in v1.17.0
func (it *AugDictIterator) Next() bool
func (*AugDictIterator) Reset ¶ added in v1.17.0
func (it *AugDictIterator) Reset()
func (*AugDictIterator) Value ¶ added in v1.17.0
func (it *AugDictIterator) Value() *Slice
type AugDictTraverseFunc ¶ added in v1.17.0
type Augmentation ¶ added in v1.17.0
type AugmentedDictionary ¶ added in v1.17.0
type AugmentedDictionary struct {
// contains filtered or unexported fields
}
func NewAugDict ¶ added in v1.17.0
func NewAugDict(keySz uint, aug Augmentation) (*AugmentedDictionary, error)
func (*AugmentedDictionary) AsCell ¶ added in v1.17.0
func (d *AugmentedDictionary) AsCell() *Cell
func (*AugmentedDictionary) CheckForEach ¶ added in v1.17.0
func (d *AugmentedDictionary) CheckForEach(fn DictForeachFunc, invertFirst bool, shuffle bool) (bool, error)
func (*AugmentedDictionary) CheckForEachExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) CheckForEachExtra(fn AugDictForeachFunc, invertFirst bool) (bool, error)
func (*AugmentedDictionary) CombineWith ¶ added in v1.17.0
func (d *AugmentedDictionary) CombineWith(other *AugmentedDictionary) (bool, error)
CombineWith structurally merges other into d.
It returns false, nil when both dictionaries contain the same key. The receiver is mutated only after the whole merge succeeds.
func (*AugmentedDictionary) Copy ¶ added in v1.17.0
func (d *AugmentedDictionary) Copy() *AugmentedDictionary
func (*AugmentedDictionary) Count ¶ added in v1.18.0
func (d *AugmentedDictionary) Count() (int, error)
Count returns the number of dictionary leaves without materializing keys or values.
func (*AugmentedDictionary) CutPrefixSubdict ¶ added in v1.17.0
func (d *AugmentedDictionary) CutPrefixSubdict(prefix *Cell, removePrefix bool) (bool, error)
func (*AugmentedDictionary) Delete ¶ added in v1.17.0
func (d *AugmentedDictionary) Delete(key *Cell) error
func (*AugmentedDictionary) DeleteIntKey ¶ added in v1.17.0
func (d *AugmentedDictionary) DeleteIntKey(key *big.Int) error
func (*AugmentedDictionary) ExtractPrefixSubdictRoot ¶ added in v1.17.0
func (d *AugmentedDictionary) ExtractPrefixSubdictRoot(prefix *Cell, removePrefix bool) (*Cell, error)
func (*AugmentedDictionary) Filter ¶ added in v1.17.0
func (d *AugmentedDictionary) Filter(fn AugDictFilterFunc) (int, error)
func (*AugmentedDictionary) ForEachValueExtra ¶ added in v1.18.0
func (d *AugmentedDictionary) ForEachValueExtra(fn func(value, extra *Slice) (bool, error)) error
ForEachValueExtra visits every leaf's decomposed value and extra in key order without materializing key cells — cheaper than IteratorExtra when keys are not needed. fn returns false to stop the walk early.
func (*AugmentedDictionary) Get ¶ added in v1.17.0
func (d *AugmentedDictionary) Get(key *Cell) *Cell
func (*AugmentedDictionary) GetCommonPrefix ¶ added in v1.17.0
func (d *AugmentedDictionary) GetCommonPrefix(limit ...uint) (*Cell, error)
func (*AugmentedDictionary) GetKeySize ¶ added in v1.17.0
func (d *AugmentedDictionary) GetKeySize() uint
func (*AugmentedDictionary) GetRootExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) GetRootExtra() *Cell
func (*AugmentedDictionary) GetWithExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) GetWithExtra(key *Cell) *Cell
func (*AugmentedDictionary) HasCommonPrefix ¶ added in v1.17.0
func (d *AugmentedDictionary) HasCommonPrefix(prefix *Cell) (bool, error)
func (*AugmentedDictionary) IsEmpty ¶ added in v1.17.0
func (d *AugmentedDictionary) IsEmpty() bool
func (*AugmentedDictionary) Iterator ¶ added in v1.17.0
func (d *AugmentedDictionary) Iterator(rev bool, sgnd bool) (*DictIterator, error)
Iterator creates a lazy depth-first raw value+extra iterator. Inspect Err after Next returns false to catch failures discovered in deeper children.
func (*AugmentedDictionary) IteratorAt ¶ added in v1.18.0
func (d *AugmentedDictionary) IteratorAt(key *Cell, rev bool, sgnd bool, allowEq bool) (*DictIterator, error)
IteratorAt creates a lazy raw iterator positioned at the nearest key to `key` in iteration order: for rev=false the first item is the smallest key >= key (> key when allowEq is false), for rev=true the largest key <= key (< key). Reset rewinds to the full range, not to the seek position.
func (*AugmentedDictionary) IteratorExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) IteratorExtra(rev bool, sgnd bool) (*AugDictIterator, error)
IteratorExtra creates a lazy depth-first decomposed iterator. Inspect Err after Next returns false to catch traversal or extra-decoding failures.
func (*AugmentedDictionary) IteratorExtraAt ¶ added in v1.18.0
func (d *AugmentedDictionary) IteratorExtraAt(key *Cell, rev bool, sgnd bool, allowEq bool) (*AugDictIterator, error)
IteratorExtraAt is IteratorAt with values decomposed into value and extra.
func (*AugmentedDictionary) LoadRootExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadRootExtra() (*Slice, error)
func (*AugmentedDictionary) LoadValue ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValue(key *Cell) (*Slice, error)
func (*AugmentedDictionary) LoadValueAndDelete ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValueAndDelete(key *Cell) (*Slice, error)
func (*AugmentedDictionary) LoadValueByIntKey ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValueByIntKey(key *big.Int) (*Slice, error)
func (*AugmentedDictionary) LoadValueExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValueExtra(key *Cell) (*Slice, *Slice, error)
func (*AugmentedDictionary) LoadValueExtraAndDelete ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValueExtraAndDelete(key *Cell) (*Slice, *Slice, error)
func (*AugmentedDictionary) LoadValueExtraByIntKey ¶ added in v1.17.0
func (*AugmentedDictionary) LoadValueWithExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValueWithExtra(key *Cell) (*Slice, error)
func (*AugmentedDictionary) LoadValueWithExtraAndDelete ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValueWithExtraAndDelete(key *Cell) (*Slice, error)
func (*AugmentedDictionary) LoadValueWithExtraByIntKey ¶ added in v1.17.0
func (d *AugmentedDictionary) LoadValueWithExtraByIntKey(key *big.Int) (*Slice, error)
func (*AugmentedDictionary) LookupNearestKey ¶ added in v1.17.0
func (*AugmentedDictionary) MustToCell ¶ added in v1.17.0
func (d *AugmentedDictionary) MustToCell() *Cell
func (*AugmentedDictionary) Range ¶ added in v1.17.0
func (d *AugmentedDictionary) Range(rev bool, sgnd bool) ([]DictItem, error)
func (*AugmentedDictionary) RangeExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) RangeExtra(rev bool, sgnd bool) ([]AugDictItem, error)
func (*AugmentedDictionary) Set ¶ added in v1.17.0
func (d *AugmentedDictionary) Set(key, value *Cell) error
func (*AugmentedDictionary) SetBuilder ¶ added in v1.17.0
func (d *AugmentedDictionary) SetBuilder(key *Cell, value *Builder) error
func (*AugmentedDictionary) SetBuilderWithMode ¶ added in v1.17.0
func (d *AugmentedDictionary) SetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (bool, error)
func (*AugmentedDictionary) SetIntKey ¶ added in v1.17.0
func (d *AugmentedDictionary) SetIntKey(key *big.Int, value *Cell) error
func (*AugmentedDictionary) SetTrace ¶ added in v1.17.0
func (d *AugmentedDictionary) SetTrace(trace *Trace) *AugmentedDictionary
func (*AugmentedDictionary) SetWithMode ¶ added in v1.17.0
func (d *AugmentedDictionary) SetWithMode(key, value *Cell, mode DictSetMode) (bool, error)
func (*AugmentedDictionary) ToCell ¶ added in v1.17.0
func (d *AugmentedDictionary) ToCell() (*Cell, error)
func (*AugmentedDictionary) TraverseExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) TraverseExtra(fn AugDictTraverseFunc) (*Slice, *Slice, error)
func (*AugmentedDictionary) ValidateAll ¶ added in v1.17.0
func (d *AugmentedDictionary) ValidateAll() bool
func (*AugmentedDictionary) ValidateCheck ¶ added in v1.17.0
func (d *AugmentedDictionary) ValidateCheck(fn DictForeachFunc, invertFirst bool) (bool, error)
func (*AugmentedDictionary) ValidateCheckExtra ¶ added in v1.17.0
func (d *AugmentedDictionary) ValidateCheckExtra(fn AugDictForeachFunc, invertFirst bool) (bool, error)
type AugmentedExtraSkipper ¶ added in v1.17.0
type BOCCellMeta ¶ added in v1.17.1
type BOCCellMeta struct {
Hash Hash
LevelMask LevelMask
Hashes [4]Hash
Depths [4]uint16
Count uint8
Stored bool
}
BOCCellMeta is the storage-visible metadata of a BoC cell.
func (BOCCellMeta) DepthAtLevel ¶ added in v1.17.1
func (m BOCCellMeta) DepthAtLevel(level int) uint16
DepthAtLevel returns the cell depth visible at the requested level.
func (BOCCellMeta) HashAtLevel ¶ added in v1.17.1
func (m BOCCellMeta) HashAtLevel(level int) Hash
HashAtLevel returns the cell hash visible at the requested level.
type BOCCellRefs ¶ added in v1.17.1
BOCCellRefs is the compact list of referenced BoC cell indexes.
type BOCCellView ¶ added in v1.17.1
type BOCCellView struct {
Index uint32
D1 byte
D2 byte
Bits uint16
Body []byte
Refs BOCCellRefs
Meta BOCCellMeta
}
BOCCellView is a decoded BoC cell record.
Body points into the scratch buffer returned by BOCView.ReadCell. Callers should consume it before reusing that buffer.
type BOCNoCopyReader ¶ added in v1.17.0
type BOCNoCopyReader struct {
// contains filtered or unexported fields
}
BOCNoCopyReader wraps in-memory BoC bytes for the parser's direct read path.
func NewBOCNoCopyReader ¶ added in v1.17.0
func NewBOCNoCopyReader(data []byte) *BOCNoCopyReader
NewBOCNoCopyReader creates a BoC reader over in-memory bytes.
func (*BOCNoCopyReader) Len ¶ added in v1.17.0
func (r *BOCNoCopyReader) Len() int
type BOCParseOptions ¶ added in v1.17.0
type BOCParseOptions struct {
// TrustedHashes trusts serialized hashes/depths when a cell stores them in
// the BoC payload. Cells without serialized hashes are still hashed normally.
TrustedHashes bool
// NoCopyPayload lets parsed cells reference the BoC payload directly.
// The caller must keep the source immutable while returned cells are alive.
NoCopyPayload bool
// Lazy keeps BoC subtrees behind lazy pruned boundaries. When TrustedHashes
// is false, lazy parsing computes hashes/depths from the BoC payload and
// validates serialized hashes instead of trusting them.
Lazy bool
// DisableLazyCache disables lazy BoC materialized-cell caching, even when
// the BoC carries cache bits for shared cells.
DisableLazyCache bool
// MaxCells limits how many cells may be decoded from this BoC payload.
// Zero or a negative value uses the package-level MaxBOCCells limit.
MaxCells int
// contains filtered or unexported fields
}
BOCParseOptions configures BoC parsing.
type BOCSerializeOptions ¶ added in v1.17.0
type BOCSerializeOptions struct {
WithCRC32C bool
WithIndex bool
WithCacheBits bool
WithTopHash bool
WithIntHashes bool
// CellsCountHint pre-sizes serializer dedup structures for the expected
// number of unique cells, avoiding rehash and regrow work on large BoCs.
// Zero or a negative value uses default sizing.
CellsCountHint int
}
BOCSerializeOptions configures BoC serialization.
type BOCView ¶ added in v1.17.1
type BOCView struct {
// contains filtered or unexported fields
}
BOCView exposes random-access cells from a BoC without loading the full BoC payload or materializing a Cell tree.
func OpenBOCView ¶ added in v1.17.1
OpenBOCView opens a random-access BoC view over r.
func (*BOCView) Cell ¶ added in v1.17.1
func (v *BOCView) Cell(idx uint32) (BOCCellView, error)
Cell loads one BoC cell using an internal scratch allocation.
func (*BOCView) CellMeta ¶ added in v1.17.1
func (v *BOCView) CellMeta(idx uint32) (BOCCellMeta, error)
CellMeta returns precomputed metadata for a BoC cell without reading its serialized body again.
func (*BOCView) NewReader ¶ added in v1.18.0
func (v *BOCView) NewReader() *BOCViewReader
NewReader creates a cell reader with an independent read window and scratch buffer. Use one reader per goroutine when reading a view concurrently.
type BOCViewOptions ¶ added in v1.17.1
type BOCViewOptions struct {
// TrustedHashes trusts serialized hashes/depths when a cell stores them in
// the BoC payload. Cells without serialized hashes are still hashed normally.
TrustedHashes bool
// RequireIndex rejects BoCs without an index table.
RequireIndex bool
// ValidateCRC validates the CRC32C trailer when the BoC carries one.
ValidateCRC bool
// BuildIndex scans non-indexed BoCs and builds an in-memory index.
BuildIndex bool
}
BOCViewOptions configures a random-access BoC view.
type BOCViewReader ¶ added in v1.18.0
type BOCViewReader struct {
// contains filtered or unexported fields
}
BOCViewReader reads cells from a BOCView with a private read window and scratch buffer. Separate readers can be used concurrently after the view is opened. Body returned by ReadCell remains valid until the reader's next call.
func (*BOCViewReader) ReadCell ¶ added in v1.18.0
func (r *BOCViewReader) ReadCell(idx uint32) (BOCCellView, error)
ReadCell loads one cell. Body in the returned view remains valid until the next ReadCell call on this reader.
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) CanExtendBy ¶ added in v1.17.0
func (*Builder) EndCellSpecial ¶ added in v1.17.0
func (*Builder) MustStoreAddr ¶ added in v0.4.0
func (*Builder) MustStoreBigInt ¶
func (*Builder) MustStoreBigUInt ¶ added in v1.0.0
func (*Builder) MustStoreBigVarInt ¶ added in v1.17.0
func (*Builder) MustStoreBigVarUInt ¶ added in v1.7.0
func (*Builder) MustStoreBinarySnake ¶ added in v1.1.0
func (*Builder) MustStoreBoolBit ¶ added in v0.6.0
func (*Builder) MustStoreBuilder ¶ added in v0.6.0
func (*Builder) MustStoreCoins ¶
func (*Builder) MustStoreDict ¶ added in v1.0.0
func (b *Builder) MustStoreDict(dict SerializableToCell) *Builder
func (*Builder) MustStoreInt ¶ added in v1.0.0
func (*Builder) MustStoreMaybeRef ¶ added in v0.7.0
func (*Builder) MustStoreRef ¶
func (*Builder) MustStoreStringSnake ¶ added in v1.1.0
func (*Builder) MustStoreVarInt ¶ added in v1.17.0
func (*Builder) MustStoreVarUInt ¶ added in v1.7.0
func (*Builder) StoreBigUInt ¶ added in v1.0.0
func (*Builder) StoreBigVarInt ¶ added in v1.17.0
func (*Builder) StoreBigVarUInt ¶ added in v1.7.0
func (*Builder) StoreBinarySnake ¶ added in v1.1.0
func (*Builder) StoreBoolBit ¶ added in v0.6.0
func (*Builder) StoreBuilder ¶ added in v0.6.0
func (*Builder) StoreBuilderUncheckedDepth ¶ added in v1.17.0
func (*Builder) StoreCoins ¶
func (*Builder) StoreDict ¶ added in v1.0.0
func (b *Builder) StoreDict(dict SerializableToCell) error
func (*Builder) StoreMaybeRef ¶ added in v0.7.0
func (*Builder) StoreMaybeRefUncheckedDepth ¶ added in v1.17.0
func (*Builder) StoreRefUncheckedDepth ¶ added in v1.17.0
func (*Builder) StoreSameBit ¶ added in v1.17.0
func (*Builder) StoreStringSnake ¶ added in v1.1.0
func (*Builder) StoreVarInt ¶ added in v1.17.0
func (*Builder) StoreVarUInt ¶ added in v1.7.0
func (*Builder) WithoutTrace ¶ added in v1.17.0
type Cell ¶
type Cell struct {
// contains filtered or unexported fields
}
func CombineMerkleUpdate ¶ added in v1.17.0
func CreateMerkleProof ¶ added in v1.17.2
CreateMerkleProof wraps an already-built proof body into a MerkleProof special cell.
func CreateMerkleUpdate ¶ added in v1.17.2
CreateMerkleUpdate wraps already-built old and new update bodies into a MerkleUpdate special cell.
func CreatePrunedBranch ¶ added in v1.17.2
CreatePrunedBranch returns a pruned-branch boundary for source as seen at virtualLevel and bounded by newLevel. Loaded leaf cells are returned as-is.
func CreateWithLazyRefsUnsafe ¶ added in v1.17.0
func CreateWithLazyRefsUnsafe(descriptors uint16, data, hashes []byte, depths []uint16, refs []LazyRef, loader LazyCellLoader) (*Cell, error)
CreateWithLazyRefsUnsafe creates a regular cell with trusted precomputed hashes and lazy pruned refs. The parent cell is not marked lazy; only its pruned references are lazy boundaries. descriptors must be encoded as d1<<8 | d2, and data must contain the serialized cell body, including the top-up bit for non-byte-aligned cells. loader is captured by the lazy references; pass nil to create unresolved placeholders which return ErrLazyLoaderNotSet when loaded.
func DecompressBOC ¶ added in v1.17.0
func DecompressBOCSerialized ¶ added in v1.18.0
func DecompressBOCSerialized(data []byte, maxSize int, state *Cell, opts BOCSerializeOptions) ([]*Cell, []byte, error)
DecompressBOCSerialized decompresses like DecompressBOC and additionally serializes the result with opts in one go. For structure-aware payloads the serializer is fed the already-deduplicated decompression graph directly, skipping the per-cell hash lookups a fresh ToBOCWithOptions pass would do. The produced bytes are identical to ToBOCWithOptions over the same roots.
func FromBOCMultiRoot ¶ added in v0.5.0
func FromBOCMultiRootWithOptions ¶ added in v1.18.0
func FromBOCMultiRootWithOptions(data []byte, options BOCParseOptions) ([]*Cell, error)
func FromBOCWithOptions ¶ added in v1.18.0
func FromBOCWithOptions(data []byte, options BOCParseOptions) (*Cell, error)
func ReserializeBOC ¶ added in v1.18.0
func ReserializeBOC(data []byte, opts BOCSerializeOptions) ([]*Cell, []byte, error)
ReserializeBOC parses a BoC and serializes the same cells with opts in one go, feeding the serializer the parser's reference graph directly so the generic per-cell hash-dedup import pass is skipped. For deduplicated inputs (the only kind standard serializers produce) the output is byte-identical to ToBOCWithOptions over the parsed roots; inputs carrying duplicate cells keep their duplicates, so callers that verify an exact file hash should fall back to ToBOCWithOptions on mismatch.
func UnwrapProofVirtualized ¶ added in v1.17.0
func (*Cell) ActualLevel ¶ added in v1.17.0
func (*Cell) AppendBOCWithOptions ¶ added in v1.18.0
func (c *Cell) AppendBOCWithOptions(dst []byte, opts BOCSerializeOptions) ([]byte, error)
AppendBOCWithOptions serializes c into BoC and appends the result to dst.
func (*Cell) AsAugDict ¶ added in v1.17.0
func (c *Cell) AsAugDict(keySz uint, aug Augmentation) *AugmentedDictionary
func (*Cell) AsDict ¶ added in v1.9.0
func (c *Cell) AsDict(keySz uint) *Dictionary
func (*Cell) AsPrefixDict ¶ added in v1.17.0
func (c *Cell) AsPrefixDict(keySz uint) *PrefixDictionary
func (*Cell) BeginParse ¶
func (*Cell) BeginParseInto ¶ added in v1.18.0
BeginParseInto is the value-form of BeginParse for tight descent loops: the caller owns dst and reuses it across iterations, so parsing does not allocate a new Slice per visited cell. Traces attached to the cell are honored the same way BeginParse does.
func (*Cell) BeginParseIntoWithoutTrace ¶ added in v1.18.0
BeginParseIntoWithoutTrace is the value-form of BeginParseWithoutTrace: like BeginParseInto, but without attaching any trace to the parsed Slice.
func (*Cell) BeginParseWithTrace ¶ added in v1.17.0
BeginParseWithTrace parses the cell using trace instead of the trace attached to the cell wrapper.
func (*Cell) BeginParseWithoutTrace ¶ added in v1.17.0
func (*Cell) CreateProof
deprecated
added in
v1.6.0
func (c *Cell) CreateProof(skeleton *ProofSkeleton) (*Cell, error)
CreateProof creates a Merkle proof from the old manual proof skeleton.
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
func (*Cell) CreateUsageProof ¶ added in v1.17.0
func (c *Cell) CreateUsageProof(usageTree *CellUsageTree) (*Cell, error)
func (*Cell) EffectiveLevel ¶ added in v1.17.0
func (*Cell) GetMetadata ¶ added in v1.17.0
func (*Cell) Hash ¶ added in v0.5.0
Hash - calculates a hash of cell recursively Once calculated, it is cached and can be reused cheap.
func (*Cell) IsVirtualized ¶ added in v1.17.0
func (*Cell) MarshalJSON ¶ added in v1.7.1
func (*Cell) MustBeginParse ¶ added in v1.17.0
func (*Cell) MustPeekRef ¶ added in v1.8.0
func (*Cell) Prewarm ¶ added in v1.17.1
Prewarm prepares the lazy Cell by loading its data and returns the loaded Cell or an error on failure.
func (*Cell) PrewarmRecursive ¶ added in v1.17.0
PrewarmRecursive returns a new cell tree with lazy references loaded up to depth. depth limits how many reference edges are traversed; 0 means no limit. References beyond the depth boundary are kept as boundary refs, so lazy tips stay lazy while all cells above them are materialized.
func (*Cell) RebuildWithRefs ¶ added in v1.17.2
RebuildWithRefs returns a cell with the same bits and special flag as c, but with all references replaced by refs.
func (*Cell) SerializeBOCBodyTo ¶ added in v1.17.0
func (*Cell) SerializedBOCBodySize ¶ added in v1.17.0
func (*Cell) ToBOCWithFlags
deprecated
func (*Cell) ToBOCWithOptions ¶ added in v1.17.0
func (c *Cell) ToBOCWithOptions(opts BOCSerializeOptions) []byte
func (*Cell) ToBOCWithOptionsErr ¶ added in v1.17.0
func (c *Cell) ToBOCWithOptionsErr(opts BOCSerializeOptions) ([]byte, error)
func (*Cell) UnmarshalJSON ¶ added in v1.7.1
func (*Cell) Virtualize ¶ added in v1.17.0
func (*Cell) WithoutTrace ¶ added in v1.17.0
type CellUsageTree ¶ added in v1.17.0
type CellUsageTree struct {
// contains filtered or unexported fields
}
CellUsageTree records which cells were loaded through traced wrappers so that Merkle proofs and updates can later be built from the visited paths.
Concurrent cell loads through traces of one tree are safe: node creation, load marking and loaded-cell caching are lock-free or briefly locked. The proof/update building phase (CreateUsageProof, CreateMerkleUpdate, SetMark/MarkPath/SetUseMarkForIsLoaded) is not synchronized against concurrent loads and must run after all traced readers are done.
func NewCellUsageTree ¶ added in v1.17.0
func NewCellUsageTree() *CellUsageTree
func (*CellUsageTree) CreateChild ¶ added in v1.17.0
func (t *CellUsageTree) CreateChild(node TraceNode, refIdx int) TraceNode
func (*CellUsageTree) CreateMerkleUpdate ¶ added in v1.17.0
func (t *CellUsageTree) CreateMerkleUpdate(from, to *Cell) (*Cell, error)
CreateMerkleUpdate creates a MerkleUpdate using the same usage-tree flow as the reference VM: the destination proof marks reused source paths, then the source proof is generated from these marks.
func (*CellUsageTree) GetChild ¶ added in v1.17.0
func (t *CellUsageTree) GetChild(node TraceNode, refIdx int) TraceNode
func (*CellUsageTree) HasMark ¶ added in v1.17.0
func (t *CellUsageTree) HasMark(node TraceNode) bool
func (*CellUsageTree) IsLoaded ¶ added in v1.17.0
func (t *CellUsageTree) IsLoaded(node TraceNode) bool
func (*CellUsageTree) MarkPath ¶ added in v1.17.0
func (t *CellUsageTree) MarkPath(node TraceNode) bool
func (*CellUsageTree) NodeCount ¶ added in v1.18.0
func (t *CellUsageTree) NodeCount() int
NodeCount returns the number of arena nodes allocated so far — an upper bound on the distinct cells a proof built from this tree can include, useful for presizing build state.
func (*CellUsageTree) NodeForCell ¶ added in v1.17.0
func (t *CellUsageTree) NodeForCell(c *Cell) (TraceNode, bool)
func (*CellUsageTree) NodeForTrace ¶ added in v1.17.0
func (t *CellUsageTree) NodeForTrace(trace *Trace) (TraceNode, bool)
func (*CellUsageTree) OnLoad ¶ added in v1.17.0
func (t *CellUsageTree) OnLoad(node TraceNode, c *Cell)
func (*CellUsageTree) Parent ¶ added in v1.17.0
func (t *CellUsageTree) Parent(node TraceNode) TraceNode
func (*CellUsageTree) RootNode ¶ added in v1.17.0
func (t *CellUsageTree) RootNode() TraceNode
func (*CellUsageTree) RootTrace ¶ added in v1.17.0
func (t *CellUsageTree) RootTrace() *Trace
func (*CellUsageTree) SetCellLoadCallback ¶ added in v1.17.0
func (t *CellUsageTree) SetCellLoadCallback(fn func(*Cell))
SetCellLoadCallback registers fn to be called on the first load of every node. It must be set before loads start; fn may be called concurrently when traced readers run on multiple goroutines.
func (*CellUsageTree) SetIgnoreLoads ¶ added in v1.17.0
func (t *CellUsageTree) SetIgnoreLoads(ignore bool)
func (*CellUsageTree) SetMark ¶ added in v1.17.0
func (t *CellUsageTree) SetMark(node TraceNode, mark bool)
func (*CellUsageTree) SetUseMarkForIsLoaded ¶ added in v1.17.0
func (t *CellUsageTree) SetUseMarkForIsLoaded(useMark bool)
func (*CellUsageTree) Trace ¶ added in v1.17.0
func (t *CellUsageTree) Trace(node TraceNode) *Trace
type CompressionAlgorithm ¶ added in v1.17.0
type CompressionAlgorithm byte
const ( CompressionBaselineLZ4 CompressionAlgorithm = iota CompressionImprovedStructureLZ4 CompressionImprovedStructureLZ4WithState )
type DictBulkKV ¶ added in v1.18.0
DictBulkKV is a key/value pair for NewDictFromItems. Only the first key-size bits of Key are used as the key.
type DictFilterAction ¶ added in v1.17.0
type DictFilterAction uint8
const ( DictFilterKeep DictFilterAction = iota DictFilterRemove DictFilterKeepRest DictFilterRemoveRest )
type DictFilterFunc ¶ added in v1.17.0
type DictFilterFunc func(value *Slice, key *Cell) (DictFilterAction, error)
type DictForeachFunc ¶ added in v1.17.0
type DictIterator ¶ added in v1.17.0
type DictIterator struct {
// contains filtered or unexported fields
}
func (*DictIterator) Err ¶ added in v1.18.0
func (it *DictIterator) Err() error
Err reports a malformed/lazy-cell error discovered after iterator construction. Next remains source compatible with the historical bool-only API; callers that consume untrusted dictionaries can inspect Err afterwards.
func (*DictIterator) Item ¶ added in v1.17.0
func (it *DictIterator) Item() DictItem
func (*DictIterator) Key ¶ added in v1.17.0
func (it *DictIterator) Key() *Cell
func (*DictIterator) Next ¶ added in v1.17.0
func (it *DictIterator) Next() bool
func (*DictIterator) Reset ¶ added in v1.17.0
func (it *DictIterator) Reset()
func (*DictIterator) Value ¶ added in v1.17.0
func (it *DictIterator) Value() *Slice
type DictSetMode ¶ added in v1.17.0
type DictSetMode uint8
const ( DictSetModeReplace DictSetMode = 1 DictSetModeAdd DictSetMode = 2 DictSetModeSet DictSetMode = DictSetModeReplace | DictSetModeAdd )
type Dictionary ¶ added in v0.5.0
type Dictionary struct {
// contains filtered or unexported fields
}
func NewDict ¶ added in v1.0.0
func NewDict(keySz uint) *Dictionary
func NewDictFromItems ¶ added in v1.18.0
func NewDictFromItems(keySz uint, items []DictBulkKV) (*Dictionary, error)
NewDictFromItems builds a dictionary from all key/value pairs at once, constructing the tree bottom-up so every node is finalized (hashed) exactly once instead of re-hashing the insert path per key. Dict serialization is canonical, so the result is bit-identical to sequential Set calls over the same items; on duplicate keys the last item wins, matching sequential Set. The items slice is reordered in place.
func (*Dictionary) AsCell ¶ added in v1.9.0
func (d *Dictionary) AsCell() *Cell
func (*Dictionary) CheckForEach ¶ added in v1.17.0
func (d *Dictionary) CheckForEach(fn DictForeachFunc, invertFirst bool, shuffle bool) (bool, error)
func (*Dictionary) Copy ¶ added in v1.9.7
func (d *Dictionary) Copy() *Dictionary
func (*Dictionary) CutPrefixSubdict ¶ added in v1.17.0
func (d *Dictionary) CutPrefixSubdict(prefix *Cell, removePrefix bool) (bool, error)
func (*Dictionary) Delete ¶ added in v1.8.2
func (d *Dictionary) Delete(key *Cell) error
func (*Dictionary) DeleteByBytesKey ¶ added in v1.18.0
func (d *Dictionary) DeleteByBytesKey(key []byte) error
DeleteByBytesKey is the same as Delete, but takes the key as raw big-endian bytes (the first key-size bits), without building and hashing a key cell.
func (*Dictionary) DeleteIntKey ¶ added in v1.8.2
func (d *Dictionary) DeleteIntKey(key *big.Int) error
func (*Dictionary) ExtractPrefixSubdictRoot ¶ added in v1.17.0
func (d *Dictionary) ExtractPrefixSubdictRoot(prefix *Cell, removePrefix bool) (*Cell, error)
func (*Dictionary) Filter ¶ added in v1.17.0
func (d *Dictionary) Filter(fn DictFilterFunc) (int, error)
func (*Dictionary) Get
deprecated
added in
v0.5.0
func (d *Dictionary) Get(key *Cell) *Cell
Deprecated: use LoadValue
func (*Dictionary) GetCommonPrefix ¶ added in v1.17.0
func (d *Dictionary) GetCommonPrefix(limit ...uint) (*Cell, error)
func (*Dictionary) GetKeySize ¶ added in v1.9.7
func (d *Dictionary) GetKeySize() uint
func (*Dictionary) HasCommonPrefix ¶ added in v1.17.0
func (d *Dictionary) HasCommonPrefix(prefix *Cell) (bool, error)
func (*Dictionary) IsEmpty ¶ added in v1.9.0
func (d *Dictionary) IsEmpty() bool
func (*Dictionary) Iterator ¶ added in v1.17.0
func (d *Dictionary) Iterator(rev bool, sgnd bool) (*DictIterator, error)
Iterator creates a lazy depth-first iterator. If a lazy or malformed child fails after construction, Next returns false and Err reports that failure.
func (*Dictionary) IteratorAt ¶ added in v1.18.0
func (d *Dictionary) IteratorAt(key *Cell, rev bool, sgnd bool, allowEq bool) (*DictIterator, error)
IteratorAt creates a lazy iterator positioned at the nearest key to `key` in iteration order: for rev=false the first item is the smallest key >= key (> key when allowEq is false), for rev=true the largest key <= key (< key). Reset rewinds to the full range, not to the seek position.
func (*Dictionary) LoadAll ¶ added in v1.9.0
func (d *Dictionary) LoadAll(skipPruned ...bool) ([]DictKV, error)
func (*Dictionary) LoadMaxAndDelete ¶ added in v1.17.0
func (d *Dictionary) LoadMaxAndDelete() (*Cell, *Slice, error)
func (*Dictionary) LoadMinAndDelete ¶ added in v1.17.0
func (d *Dictionary) LoadMinAndDelete() (*Cell, *Slice, error)
func (*Dictionary) LoadMinMax ¶ added in v1.17.0
func (*Dictionary) LoadMinMaxAndDelete ¶ added in v1.17.0
func (*Dictionary) LoadValue ¶ added in v1.9.0
func (d *Dictionary) LoadValue(key *Cell) (*Slice, error)
LoadValue - searches key in the underline dict cell and returns its value
If key is not found ErrNoSuchKeyInDict will be returned
func (*Dictionary) LoadValueAndDelete ¶ added in v1.17.0
func (d *Dictionary) LoadValueAndDelete(key *Cell) (*Slice, error)
func (*Dictionary) LoadValueAndSet ¶ added in v1.17.0
func (d *Dictionary) LoadValueAndSet(key, value *Cell) (*Slice, bool, error)
func (*Dictionary) LoadValueAndSetBuilder ¶ added in v1.17.0
func (*Dictionary) LoadValueAndSetBuilderWithMode ¶ added in v1.17.0
func (d *Dictionary) LoadValueAndSetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (*Slice, bool, error)
func (*Dictionary) LoadValueAndSetWithMode ¶ added in v1.17.0
func (d *Dictionary) LoadValueAndSetWithMode(key, value *Cell, mode DictSetMode) (*Slice, bool, error)
func (*Dictionary) LoadValueByBytesKey ¶ added in v1.18.0
func (d *Dictionary) LoadValueByBytesKey(key []byte) (*Slice, error)
LoadValueByBytesKey is the same as LoadValue, but takes the key as raw big-endian bytes (the first key-size bits), without building and hashing a key cell.
func (*Dictionary) LoadValueByIntKey ¶ added in v1.9.0
func (d *Dictionary) LoadValueByIntKey(key *big.Int) (*Slice, error)
LoadValueByIntKey is the same as LoadValue, but constructs the key cell from int.
func (*Dictionary) LoadValueByUintKey ¶ added in v1.18.0
func (d *Dictionary) LoadValueByUintKey(key uint64) (*Slice, error)
LoadValueByUintKey is the same as LoadValue, but constructs the key cell from uint, without a big.Int allocation.
func (*Dictionary) LookupNearestKey ¶ added in v1.17.0
func (*Dictionary) Range ¶ added in v1.17.0
func (d *Dictionary) Range(rev bool, sgnd bool) ([]DictItem, error)
func (*Dictionary) Set ¶ added in v1.0.0
func (d *Dictionary) Set(key, value *Cell) error
func (*Dictionary) SetBuilder ¶ added in v1.17.0
func (d *Dictionary) SetBuilder(key *Cell, value *Builder) error
func (*Dictionary) SetBuilderByBytesKey ¶ added in v1.18.0
func (d *Dictionary) SetBuilderByBytesKey(key []byte, value *Builder) error
SetBuilderByBytesKey is the same as SetBuilder, but takes the key as raw big-endian bytes (the first key-size bits), without building and hashing a key cell.
func (*Dictionary) SetBuilderWithMode ¶ added in v1.17.0
func (d *Dictionary) SetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (bool, error)
func (*Dictionary) SetIntKey ¶ added in v1.1.0
func (d *Dictionary) SetIntKey(key *big.Int, value *Cell) error
func (*Dictionary) SetTrace ¶ added in v1.17.0
func (d *Dictionary) SetTrace(trace *Trace) *Dictionary
func (*Dictionary) SetWithMode ¶ added in v1.17.0
func (d *Dictionary) SetWithMode(key, value *Cell, mode DictSetMode) (bool, error)
func (*Dictionary) String ¶ added in v1.11.1
func (d *Dictionary) String() string
func (*Dictionary) ToCell ¶ added in v1.0.0
func (d *Dictionary) ToCell() (*Cell, error)
func (*Dictionary) ValidateAll ¶ added in v1.17.0
func (d *Dictionary) ValidateAll() bool
func (*Dictionary) ValidateCheck ¶ added in v1.17.0
func (d *Dictionary) ValidateCheck(fn DictForeachFunc, invertFirst bool) (bool, error)
type LargeBOCLoader ¶ added in v1.17.0
type LargeBOCLoader interface {
// LoadMeta must append exactly one LargeBOCMetaRecord per input hash to
// dst, in the same order as hashes. Returned records must stay valid while
// the following batch may already be loading.
LoadMeta(hashes []Hash, dst []LargeBOCMetaRecord) ([]LargeBOCMetaRecord, error)
// LoadPayload must append exactly one LargeBOCPayloadRecord per input hash
// to dst, in the same order as hashes. The returned records may borrow Data
// from the loader; Data must stay valid while the following batch may
// already be loading.
LoadPayload(hashes []Hash, dst []LargeBOCPayloadRecord) ([]LargeBOCPayloadRecord, error)
}
LargeBOCLoader provides two-phase large BoC loading. LoadMeta is used during graph import and should avoid loading payload bytes when the backing storage can do that cheaply. LoadPayload is used during final serialization order and must provide only raw cell payload bytes.
type LargeBOCMetaRecord ¶ added in v1.17.0
type LargeBOCMetaRecord struct {
D1 byte
BitsSz uint16
Refs [4]Hash
Hashes [4]Hash
Depths [4]uint16
}
LargeBOCMetaRecord is a compact storage-shaped cell metadata record for large BoC import. D1 is the ordinary BoC descriptor byte without the "with hashes" bit. BitsSz is the exact payload bit length, without the BoC terminator bit. Refs must contain top hashes in descriptor order.
Depths[0] must always be filled. Hashes/Depths for higher significant levels are required only when D1 carries a non-zero level mask.
type LargeBOCOnePassLoader ¶ added in v1.17.0
type LargeBOCOnePassLoader interface {
LoadCells(hashes []Hash, dst []LargeBOCRecord) ([]LargeBOCRecord, error)
}
LargeBOCOnePassLoader provides one-pass large BoC loading. LoadCells must append exactly one LargeBOCRecord per input hash to dst, in the same order as hashes. ToLargeBOCOnePass may prefetch the next batch in a goroutine while the current batch is being imported, so LoadCells calls can overlap and implementations must synchronize any shared state they touch. Payload data must stay valid until ToLargeBOCOnePass returns.
type LargeBOCPayloadRecord ¶ added in v1.17.0
type LargeBOCPayloadRecord struct {
Data []byte
}
LargeBOCPayloadRecord is a compact storage-shaped cell payload record. Data must contain raw cell data bytes without the BoC terminator bit.
type LargeBOCRecord ¶ added in v1.17.0
type LargeBOCRecord struct {
Meta LargeBOCMetaRecord
Payload LargeBOCPayloadRecord
}
LargeBOCRecord is a one-pass large BoC storage record. Meta is used to import the graph, while Payload is retained until final serialization.
type LazyCellLoader ¶ added in v1.17.0
LazyCellLoader resolves lazy pruned references by the hash of the represented cell.
type LazyRef ¶ added in v1.17.0
LazyRef describes a lazy reference placeholder. Hashes and depths must be ordered by significant levels, starting from level 0.
type LevelMask ¶ added in v1.7.1
type LevelMask struct {
Mask byte
}
func (LevelMask) IsSignificant ¶ added in v1.8.0
type MerkleProofBuilder ¶ added in v1.17.0
type MerkleProofBuilder struct {
// contains filtered or unexported fields
}
func NewMerkleProofBuilder ¶ added in v1.17.0
func NewMerkleProofBuilder(root *Cell) *MerkleProofBuilder
func (*MerkleProofBuilder) Clear ¶ added in v1.17.0
func (b *MerkleProofBuilder) Clear()
func (*MerkleProofBuilder) CreateProof ¶ added in v1.17.0
func (b *MerkleProofBuilder) CreateProof() (*Cell, error)
func (*MerkleProofBuilder) Init ¶ added in v1.17.0
func (b *MerkleProofBuilder) Init(root *Cell) *Cell
func (*MerkleProofBuilder) OriginalRoot ¶ added in v1.17.0
func (b *MerkleProofBuilder) OriginalRoot() *Cell
func (*MerkleProofBuilder) Root ¶ added in v1.17.0
func (b *MerkleProofBuilder) Root() *Cell
func (*MerkleProofBuilder) UsageTree ¶ added in v1.17.0
func (b *MerkleProofBuilder) UsageTree() *CellUsageTree
type MerkleUpdateReuse ¶ added in v1.17.0
type MerkleUpdateReuse struct {
Cells []MerkleUpdateReusedCell
Refs []MerkleUpdateReusedRef
}
type MerkleUpdateReusedCell ¶ added in v1.17.0
type MerkleUpdateReusedCell struct {
// Hash is the logical hash of the reused subtree as it appears in the
// returned root. It can be a virtual hash.
Hash Hash
// Cell carries the reference identity for storage and serialization. It may
// be a full source cell or a pruned placeholder with the same hashes/depths.
Cell *Cell
}
MerkleUpdateReusedCell describes an old-state subtree reused through a pruned boundary while applying a Merkle update.
type MerkleUpdateReusedRef ¶ added in v1.17.0
MerkleUpdateReusedRef describes a parent->child edge where the child was reused through a pruned boundary while applying a Merkle update.
type Metadata ¶ added in v1.17.0
type Metadata struct {
Hash Hash
LevelMask LevelMask
Hashes []Hash
Depths []uint16
Refs []RefMetadata
}
Metadata is the storage-visible representation of a cell.
It exposes hashes and depths exactly as they are visible from the cell's current effective level. Lazy pruned references are represented as metadata boundaries: their hash/depth data is available, while Lazy is true.
type NotEnoughDataError ¶ added in v1.18.0
NotEnoughDataError is returned when a read needs more bits/bytes than left. The message is formatted lazily: cell underflow is a regular control-flow path for TVM programs, so constructing it must stay cheap.
func (NotEnoughDataError) Error ¶ added in v1.18.0
func (e NotEnoughDataError) Error() string
type PrefixDictionary ¶ added in v1.17.0
type PrefixDictionary struct {
// contains filtered or unexported fields
}
func NewPrefixDict ¶ added in v1.17.0
func NewPrefixDict(keySz uint) *PrefixDictionary
func (*PrefixDictionary) AsCell ¶ added in v1.17.0
func (d *PrefixDictionary) AsCell() *Cell
func (*PrefixDictionary) Copy ¶ added in v1.17.0
func (d *PrefixDictionary) Copy() *PrefixDictionary
func (*PrefixDictionary) Delete ¶ added in v1.17.0
func (d *PrefixDictionary) Delete(key *Cell) error
func (*PrefixDictionary) DeleteIntKey ¶ added in v1.18.0
func (d *PrefixDictionary) DeleteIntKey(key *big.Int) error
DeleteIntKey removes a full-width prefix-dictionary key.
func (*PrefixDictionary) Get ¶ added in v1.17.0
func (d *PrefixDictionary) Get(key *Cell) *Cell
func (*PrefixDictionary) GetKeySize ¶ added in v1.17.0
func (d *PrefixDictionary) GetKeySize() uint
func (*PrefixDictionary) IsEmpty ¶ added in v1.17.0
func (d *PrefixDictionary) IsEmpty() bool
func (*PrefixDictionary) LoadValue ¶ added in v1.17.0
func (d *PrefixDictionary) LoadValue(key *Cell) (*Slice, error)
func (*PrefixDictionary) LoadValueAndDelete ¶ added in v1.17.0
func (d *PrefixDictionary) LoadValueAndDelete(key *Cell) (*Slice, error)
func (*PrefixDictionary) LoadValueByIntKey ¶ added in v1.18.0
func (d *PrefixDictionary) LoadValueByIntKey(key *big.Int) (*Slice, error)
LoadValueByIntKey loads a full-width prefix-dictionary key without finalizing and hashing an intermediate key cell.
func (*PrefixDictionary) LookupPrefix ¶ added in v1.17.0
func (d *PrefixDictionary) LookupPrefix(key *Cell) (*Slice, uint, error)
func (*PrefixDictionary) MustToCell ¶ added in v1.17.0
func (d *PrefixDictionary) MustToCell() *Cell
func (*PrefixDictionary) Set ¶ added in v1.17.0
func (d *PrefixDictionary) Set(key, value *Cell) error
func (*PrefixDictionary) SetBuilder ¶ added in v1.17.0
func (d *PrefixDictionary) SetBuilder(key *Cell, value *Builder) error
func (*PrefixDictionary) SetBuilderWithMode ¶ added in v1.17.0
func (d *PrefixDictionary) SetBuilderWithMode(key *Cell, value *Builder, mode DictSetMode) (bool, error)
func (*PrefixDictionary) SetIntKey ¶ added in v1.18.0
func (d *PrefixDictionary) SetIntKey(key *big.Int, value *Cell) error
SetIntKey stores a full-width prefix-dictionary key.
func (*PrefixDictionary) SetTrace ¶ added in v1.17.0
func (d *PrefixDictionary) SetTrace(trace *Trace) *PrefixDictionary
func (*PrefixDictionary) SetWithMode ¶ added in v1.17.0
func (d *PrefixDictionary) SetWithMode(key, value *Cell, mode DictSetMode) (bool, error)
func (*PrefixDictionary) ToCell ¶ added in v1.17.0
func (d *PrefixDictionary) ToCell() (*Cell, error)
type ProofSkeleton
deprecated
added in
v1.9.0
type ProofSkeleton struct {
// contains filtered or unexported fields
}
ProofSkeleton describes the old manual Merkle proof selection tree.
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
func CreateProofSkeleton
deprecated
added in
v1.9.0
func CreateProofSkeleton() *ProofSkeleton
CreateProofSkeleton creates the old manual Merkle proof selection tree.
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
func (*ProofSkeleton) AttachAt
deprecated
added in
v1.9.0
func (s *ProofSkeleton) AttachAt(i int, sk *ProofSkeleton)
AttachAt - attach skeleton chain at specific ref slot
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
func (*ProofSkeleton) Copy
deprecated
added in
v1.9.0
func (s *ProofSkeleton) Copy() *ProofSkeleton
Copy returns a shallow copy of the old manual Merkle proof selection tree.
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
func (*ProofSkeleton) Merge
deprecated
added in
v1.9.0
func (s *ProofSkeleton) Merge(sk *ProofSkeleton)
Merge - merge 2 proof chains in a single proof tree
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
func (*ProofSkeleton) ProofRef
deprecated
added in
v1.9.0
func (s *ProofSkeleton) ProofRef(i int) *ProofSkeleton
ProofRef - include ref with index i to proof
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
func (*ProofSkeleton) SetRecursive
deprecated
added in
v1.9.0
func (s *ProofSkeleton) SetRecursive()
SetRecursive - include all underlying refs recursively in ordinary form to proof
Deprecated: use NewMerkleProofBuilder with traced cell loads, or Cell.CreateUsageProof with CellUsageTree.
type ReadOnlyAugmentation ¶ added in v1.17.0
type ReadOnlyAugmentation struct {
SkipExtraFn AugmentedExtraSkipper
}
func (ReadOnlyAugmentation) CombineExtra ¶ added in v1.17.0
func (a ReadOnlyAugmentation) CombineExtra(*Slice, *Slice) (*Cell, error)
func (ReadOnlyAugmentation) EmptyExtra ¶ added in v1.17.0
func (a ReadOnlyAugmentation) EmptyExtra() (*Cell, error)
func (ReadOnlyAugmentation) LeafExtra ¶ added in v1.17.0
func (a ReadOnlyAugmentation) LeafExtra(*Slice) (*Cell, error)
func (ReadOnlyAugmentation) SkipExtra ¶ added in v1.17.0
func (a ReadOnlyAugmentation) SkipExtra(loader *Slice) error
type RefMetadata ¶ added in v1.17.0
type SerializableToCell ¶ added in v1.17.0
type Slice ¶ added in v1.0.0
type Slice struct {
// contains filtered or unexported fields
}
func (*Slice) AugDictInlineIterator ¶ added in v1.18.0
func (c *Slice) AugDictInlineIterator(keySz uint, aug Augmentation, skipValue AugmentedExtraSkipper, rev bool, sgnd bool) (*AugDictIterator, error)
AugDictInlineIterator iterates a non-empty HashmapAug whose root node is serialized inline starting at the slice's current position (as in an AccountBlock's transactions field). The slice is advanced past the dictionary. skipValue must consume a leaf value that does not occupy the rest of the node; pass nil when it does. Unlike ToAugDictWithValue no synthetic root cell is built, so no hashing happens. Reset is unsupported on the returned iterator: the inline root has no standalone cell to rewind to.
func (*Slice) AugDictInlineIteratorAt ¶ added in v1.18.0
func (c *Slice) AugDictInlineIteratorAt(keySz uint, aug Augmentation, skipValue AugmentedExtraSkipper, key *Cell, rev bool, sgnd bool, allowEq bool) (*AugDictIterator, error)
AugDictInlineIteratorAt is AugDictInlineIterator positioned at the nearest key to `key` in iteration order; see (*AugmentedDictionary).IteratorExtraAt for the positioning semantics.
func (*Slice) CountInlineDictLeaves ¶ added in v1.18.0
CountInlineDictLeaves counts the leaves of a non-empty Hashmap/HashmapAug whose root node is serialized inline at the slice's current position, like the transactions dict of an AccountBlock. Neither keys nor values are materialized and the slice is not advanced. Fork children occupy the first two refs in both plain and augmented dictionaries, so no augmentation knowledge is needed.
func (*Slice) CountLeading ¶ added in v1.17.0
func (*Slice) CountTrailing ¶ added in v1.17.0
func (*Slice) FetchSubslice ¶ added in v1.17.0
func (*Slice) IsPrefixOf ¶ added in v1.17.0
func (*Slice) IsProperPrefixOf ¶ added in v1.17.0
func (*Slice) IsProperSuffixOf ¶ added in v1.17.0
func (*Slice) IsSuffixOf ¶ added in v1.17.0
func (*Slice) LexCompare ¶ added in v1.17.0
func (*Slice) LoadAugDict ¶ added in v1.17.0
func (c *Slice) LoadAugDict(keySz uint, aug Augmentation, asProof bool) (*AugmentedDictionary, error)
func (*Slice) LoadBigUIntInto ¶ added in v1.18.0
LoadBigUIntInto decodes sz bits into dst and advances the slice. Reusing dst avoids the allocation performed by LoadBigUInt. On error, neither dst nor the slice cursor is changed.
func (*Slice) LoadBinarySnake ¶ added in v1.1.0
func (*Slice) LoadBoolBit ¶ added in v1.0.0
func (*Slice) LoadMaybeRef ¶ added in v1.0.0
func (*Slice) LoadPrefixDict ¶ added in v1.17.0
func (c *Slice) LoadPrefixDict(keySz uint) (*PrefixDictionary, error)
func (*Slice) LoadRefCell ¶ added in v1.8.0
func (*Slice) LoadSliceInto ¶ added in v1.18.0
LoadSliceInto copies sz bits into dst and advances the slice. The copied bits are left-aligned in dst, matching LoadSlice. It returns io.ErrShortBuffer when dst cannot hold the result and leaves the slice cursor unchanged on every error.
func (*Slice) LoadStringSnake ¶ added in v1.1.0
func (*Slice) MustLoadAddr ¶ added in v1.0.0
func (*Slice) MustLoadBigCoins ¶ added in v1.0.0
func (*Slice) MustLoadBinarySnake ¶ added in v1.1.0
func (*Slice) MustLoadBoolBit ¶ added in v1.0.0
func (*Slice) MustLoadCoins ¶ added in v1.0.0
func (*Slice) MustLoadDict ¶ added in v1.0.1
func (c *Slice) MustLoadDict(keySz uint) *Dictionary
func (*Slice) MustLoadInt ¶ added in v1.0.0
func (*Slice) MustLoadMaybeRef ¶ added in v1.0.0
func (*Slice) MustLoadPrefixDict ¶ added in v1.17.0
func (c *Slice) MustLoadPrefixDict(keySz uint) *PrefixDictionary
func (*Slice) MustLoadRef ¶ added in v1.0.0
func (*Slice) MustLoadSlice ¶ added in v1.0.0
func (*Slice) MustLoadStringSnake ¶ added in v1.1.0
func (*Slice) MustLoadUInt ¶ added in v1.0.0
func (*Slice) MustPreloadBigUInt ¶ added in v1.9.6
func (*Slice) MustPreloadSlice ¶ added in v1.9.6
func (*Slice) MustPreloadUInt ¶ added in v1.9.6
func (*Slice) MustToCell ¶ added in v1.0.0
func (*Slice) MustToPrefixDict ¶ added in v1.17.0
func (c *Slice) MustToPrefixDict(keySz uint) *PrefixDictionary
func (*Slice) PeekRefCell ¶ added in v1.17.0
func (*Slice) PreloadBigInt ¶ added in v1.17.0
func (*Slice) PreloadBigUInt ¶ added in v1.9.6
func (*Slice) PreloadBigUIntInto ¶ added in v1.18.0
PreloadBigUIntInto decodes sz bits into dst without advancing the slice. Reusing dst avoids the allocation performed by PreloadBigUInt. On error, dst is not changed.
func (*Slice) PreloadRef ¶ added in v1.9.6
func (*Slice) PreloadRefCell ¶ added in v1.9.6
func (*Slice) PreloadSliceInto ¶ added in v1.18.0
PreloadSliceInto copies sz bits into dst without advancing the slice. The copied bits are left-aligned in dst, matching PreloadSlice. It returns io.ErrShortBuffer when dst cannot hold the result.
func (*Slice) PreloadSubslice ¶ added in v1.17.0
func (*Slice) RemoveTrailing ¶ added in v1.17.0
func (*Slice) SkipBitsAndRefs ¶ added in v1.17.0
func (*Slice) ToAugDict ¶ added in v1.17.0
func (c *Slice) ToAugDict(keySz uint, skipExtra AugmentedExtraSkipper) (*AugmentedDictionary, error)
func (*Slice) ToAugDictWithAugmentation ¶ added in v1.17.0
func (c *Slice) ToAugDictWithAugmentation(keySz uint, aug Augmentation) (*AugmentedDictionary, error)
func (*Slice) ToAugDictWithValue ¶ added in v1.17.0
func (c *Slice) ToAugDictWithValue(keySz uint, skipExtra AugmentedExtraSkipper, skipValue AugmentedExtraSkipper) (*AugmentedDictionary, error)
ToAugDictWithValue is the safe inline HashmapAug loader when the augmented leaf value does not consume the whole remainder of the current slice. Pass nil skipValue only when the augmented dict occupies the rest of the slice.
func (*Slice) ToAugDictWithValueAndAugmentation ¶ added in v1.17.0
func (c *Slice) ToAugDictWithValueAndAugmentation(keySz uint, aug Augmentation, skipValue AugmentedExtraSkipper) (*AugmentedDictionary, error)
func (*Slice) ToPrefixDict ¶ added in v1.17.0
func (c *Slice) ToPrefixDict(keySz uint) (*PrefixDictionary, error)
func (*Slice) WithoutTrace ¶ added in v1.17.0
type Trace ¶ added in v1.17.0
type Trace struct {
// contains filtered or unexported fields
}
func CombineTraces ¶ added in v1.17.0
func NewTrace ¶ added in v1.17.0
func NewTrace(hooks TraceHooks) *Trace
func NewTraceForListener ¶ added in v1.18.0
func NewTraceForListener(l TraceListener) *Trace
NewTraceForListener wires a Trace directly to the listener, allocating only the Trace itself.
func (*Trace) NotifyCreate ¶ added in v1.17.0
func (*Trace) NotifyLoad ¶ added in v1.17.0
func (*Trace) PendingError ¶ added in v1.17.0
func (*Trace) WithoutTrace ¶ added in v1.17.0
type TraceHooks ¶ added in v1.17.0
type TraceListener ¶ added in v1.18.0
type TraceListener interface {
OnLoad(*Cell)
OnCreate()
ChildTrace(refIdx int) *Trace
PendingError() error
}
TraceListener receives the same events as TraceHooks through interface dispatch, letting a single object back a Trace without allocating a closure per hook.
Source Files
¶
- aug_dict.go
- aug_dict_combine.go
- aug_dict_fixed_api.go
- boc_hash_index.go
- boc_large.go
- boc_lazy.go
- boc_view.go
- builder.go
- builder_ops.go
- cell.go
- cell_layout.go
- cell_meta.go
- compression.go
- compression_decode.go
- dict.go
- dict_core.go
- dict_fixed.go
- dict_fixed_api.go
- dict_label.go
- dict_validate.go
- dict_value.go
- finalize.go
- lazy.go
- level.go
- merkle_update.go
- metadata.go
- parse.go
- parse_finalize.go
- prefix_dict.go
- proof.go
- proof_usage.go
- reader.go
- ref_view.go
- serialize.go
- serialize_options.go
- slice.go
- slice_ops.go
- trace.go
- usage_tree.go
- validate.go
- virtual.go