Documentation ¶
Index ¶
- Variables
- func NewIterator(trie data.Trie) (*iterator, error)
- func NewTrie(trieStorage data.StorageManager, msh marshal.Marshalizer, hsh hashing.Hasher) (*patriciaMerkleTrie, error)
- func NewTrieStorageManager(db data.DBWriteCacher, snapshotDbCfg config.DBConfig, ewl data.DBRemoveCacher) (*trieStorageManager, error)
- func NewTrieStorageManagerWithoutPruning(db data.DBWriteCacher) (*trieStorageManagerWithoutPruning, error)
- func NewTrieSyncer(resolver dataRetriever.Resolver, interceptedNodes storage.Cacher, ...) (*trieSyncer, error)
- type CollapsedBn
- func (*CollapsedBn) Descriptor() ([]byte, []int)
- func (this *CollapsedBn) Equal(that interface{}) bool
- func (m *CollapsedBn) GetEncodedChildren() [][]byte
- func (this *CollapsedBn) GoString() string
- func (m *CollapsedBn) Marshal() (dAtA []byte, err error)
- func (m *CollapsedBn) MarshalTo(dAtA []byte) (int, error)
- func (m *CollapsedBn) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CollapsedBn) ProtoMessage()
- func (m *CollapsedBn) Reset()
- func (m *CollapsedBn) Size() (n int)
- func (this *CollapsedBn) String() string
- func (m *CollapsedBn) Unmarshal(dAtA []byte) error
- func (m *CollapsedBn) XXX_DiscardUnknown()
- func (m *CollapsedBn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CollapsedBn) XXX_Merge(src proto.Message)
- func (m *CollapsedBn) XXX_Size() int
- func (m *CollapsedBn) XXX_Unmarshal(b []byte) error
- type CollapsedEn
- func (*CollapsedEn) Descriptor() ([]byte, []int)
- func (this *CollapsedEn) Equal(that interface{}) bool
- func (m *CollapsedEn) GetEncodedChild() []byte
- func (m *CollapsedEn) GetKey() []byte
- func (this *CollapsedEn) GoString() string
- func (m *CollapsedEn) Marshal() (dAtA []byte, err error)
- func (m *CollapsedEn) MarshalTo(dAtA []byte) (int, error)
- func (m *CollapsedEn) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CollapsedEn) ProtoMessage()
- func (m *CollapsedEn) Reset()
- func (m *CollapsedEn) Size() (n int)
- func (this *CollapsedEn) String() string
- func (m *CollapsedEn) Unmarshal(dAtA []byte) error
- func (m *CollapsedEn) XXX_DiscardUnknown()
- func (m *CollapsedEn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CollapsedEn) XXX_Merge(src proto.Message)
- func (m *CollapsedEn) XXX_Size() int
- func (m *CollapsedEn) XXX_Unmarshal(b []byte) error
- type CollapsedLn
- func (*CollapsedLn) Descriptor() ([]byte, []int)
- func (this *CollapsedLn) Equal(that interface{}) bool
- func (m *CollapsedLn) GetKey() []byte
- func (m *CollapsedLn) GetValue() []byte
- func (this *CollapsedLn) GoString() string
- func (m *CollapsedLn) Marshal() (dAtA []byte, err error)
- func (m *CollapsedLn) MarshalTo(dAtA []byte) (int, error)
- func (m *CollapsedLn) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CollapsedLn) ProtoMessage()
- func (m *CollapsedLn) Reset()
- func (m *CollapsedLn) Size() (n int)
- func (this *CollapsedLn) String() string
- func (m *CollapsedLn) Unmarshal(dAtA []byte) error
- func (m *CollapsedLn) XXX_DiscardUnknown()
- func (m *CollapsedLn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CollapsedLn) XXX_Merge(src proto.Message)
- func (m *CollapsedLn) XXX_Size() int
- func (m *CollapsedLn) XXX_Unmarshal(b []byte) error
- type InterceptedTrieNode
- func (inTn *InterceptedTrieNode) CheckValidity() error
- func (inTn *InterceptedTrieNode) CreateEndOfProcessingTriggerNode()
- func (inTn *InterceptedTrieNode) EncodedNode() []byte
- func (inTn *InterceptedTrieNode) Hash() []byte
- func (inTn *InterceptedTrieNode) IsForCurrentShard() bool
- func (inTn *InterceptedTrieNode) IsInterfaceNil() bool
- func (inTn *InterceptedTrieNode) Type() string
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthNode = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowNode = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupNode = fmt.Errorf("proto: unexpected end of group") )
var ErrChildPosOutOfRange = errors.New("the position of the child is out of range")
ErrChildPosOutOfRange is raised when the position of a child in a branch node is less than 0 or greater than 16
var ErrEmptyNode = errors.New("the node is empty")
ErrEmptyNode is raised when we reach an empty node (a node with no children or no value)
var ErrHashNotFound = errors.New("hash not found")
ErrHashNotFound signals that the given hash was not found in db or snapshots
var ErrInvalidEncoding = errors.New("cannot decode this invalid encoding")
ErrInvalidEncoding is raised when the encoded information cannot be decoded
var ErrInvalidHash = errors.New("the received hash is invalid")
ErrInvalidHash is raised when the given hash is invalid
var ErrInvalidLength = errors.New("invalid array length")
ErrInvalidLength signals that length of the array is invalid
var ErrInvalidNode = errors.New("invalid node")
ErrInvalidNode is raised when we reach an invalid node
var ErrNilDatabase = errors.New("no database provided")
ErrNilDatabase is raised when a database operation is called, but no database is provided
var ErrNilEvictionWaitingList = errors.New("nil eviction waiting list provided")
ErrNilEvictionWaitingList is raised when a nil eviction waiting list is provided
var ErrNilHasher = errors.New("no hasher provided")
ErrNilHasher is raised when the NewTrie() function is called, but a hasher isn't provided
var ErrNilMarshalizer = errors.New("no marshalizer provided")
ErrNilMarshalizer is raised when the NewTrie() function is called, but a marshalizer isn't provided
var ErrNilNode = errors.New("the node is nil")
ErrNilNode is raised when we reach a nil node
var ErrNilPathManager = errors.New("nil path manager")
ErrNilPathManager signals that a nil path manager has been provided
var ErrNilResolver = errors.New("the resolver is nil")
ErrNilResolver is raised when the given resolver is nil
var ErrNilSnapshotDbConfig = errors.New("nil snapshot db config provided")
ErrNilSnapshotDbConfig is raised when a nil snapshot db config is provided
var ErrNilTrie = errors.New("the trie is nil")
ErrNilTrie is raised when the trie is nil
var ErrNilTrieStorage = errors.New("nil trie storage provided")
ErrNilTrieStorage is raised when a nil trie storage is provided
var ErrNodeNotFound = errors.New("the node is not present in the trie")
ErrNodeNotFound is raised when we try to get a node that is not present in the trie
var ErrTimeIsOut = errors.New("time is out")
ErrTimeIsOut signals that time is out
var ErrValueTooShort = errors.New("cannot remove bytes from value because value is too short")
ErrValueTooShort is raised when we try to remove something from a value, and the value is too short
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
ErrWrongTypeAssertion signals that wrong type was provided
Functions ¶
func NewIterator ¶
NewIterator creates a new instance of trie iterator
func NewTrie ¶
func NewTrie( trieStorage data.StorageManager, msh marshal.Marshalizer, hsh hashing.Hasher, ) (*patriciaMerkleTrie, error)
NewTrie creates a new Patricia Merkle Trie
func NewTrieStorageManager ¶
func NewTrieStorageManager(db data.DBWriteCacher, snapshotDbCfg config.DBConfig, ewl data.DBRemoveCacher) (*trieStorageManager, error)
NewTrieStorageManager creates a new instance of trieStorageManager
func NewTrieStorageManagerWithoutPruning ¶
func NewTrieStorageManagerWithoutPruning(db data.DBWriteCacher) (*trieStorageManagerWithoutPruning, error)
NewTrieStorageManagerWithoutPruning creates a new instance of trieStorageManagerWithoutPruning
Types ¶
type CollapsedBn ¶
type CollapsedBn struct {
EncodedChildren [][]byte `protobuf:"bytes,1,rep,name=EncodedChildren,proto3" json:"EncodedChildren,omitempty"`
}
func (*CollapsedBn) Descriptor ¶
func (*CollapsedBn) Descriptor() ([]byte, []int)
func (*CollapsedBn) Equal ¶
func (this *CollapsedBn) Equal(that interface{}) bool
func (*CollapsedBn) GetEncodedChildren ¶
func (m *CollapsedBn) GetEncodedChildren() [][]byte
func (*CollapsedBn) GoString ¶
func (this *CollapsedBn) GoString() string
func (*CollapsedBn) Marshal ¶
func (m *CollapsedBn) Marshal() (dAtA []byte, err error)
func (*CollapsedBn) MarshalToSizedBuffer ¶
func (m *CollapsedBn) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CollapsedBn) ProtoMessage ¶
func (*CollapsedBn) ProtoMessage()
func (*CollapsedBn) Reset ¶
func (m *CollapsedBn) Reset()
func (*CollapsedBn) Size ¶
func (m *CollapsedBn) Size() (n int)
func (*CollapsedBn) String ¶
func (this *CollapsedBn) String() string
func (*CollapsedBn) Unmarshal ¶
func (m *CollapsedBn) Unmarshal(dAtA []byte) error
func (*CollapsedBn) XXX_DiscardUnknown ¶
func (m *CollapsedBn) XXX_DiscardUnknown()
func (*CollapsedBn) XXX_Marshal ¶
func (m *CollapsedBn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CollapsedBn) XXX_Merge ¶
func (m *CollapsedBn) XXX_Merge(src proto.Message)
func (*CollapsedBn) XXX_Size ¶
func (m *CollapsedBn) XXX_Size() int
func (*CollapsedBn) XXX_Unmarshal ¶
func (m *CollapsedBn) XXX_Unmarshal(b []byte) error
type CollapsedEn ¶
type CollapsedEn struct { Key []byte `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` EncodedChild []byte `protobuf:"bytes,2,opt,name=EncodedChild,proto3" json:"EncodedChild,omitempty"` }
func (*CollapsedEn) Descriptor ¶
func (*CollapsedEn) Descriptor() ([]byte, []int)
func (*CollapsedEn) Equal ¶
func (this *CollapsedEn) Equal(that interface{}) bool
func (*CollapsedEn) GetEncodedChild ¶
func (m *CollapsedEn) GetEncodedChild() []byte
func (*CollapsedEn) GetKey ¶
func (m *CollapsedEn) GetKey() []byte
func (*CollapsedEn) GoString ¶
func (this *CollapsedEn) GoString() string
func (*CollapsedEn) Marshal ¶
func (m *CollapsedEn) Marshal() (dAtA []byte, err error)
func (*CollapsedEn) MarshalToSizedBuffer ¶
func (m *CollapsedEn) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CollapsedEn) ProtoMessage ¶
func (*CollapsedEn) ProtoMessage()
func (*CollapsedEn) Reset ¶
func (m *CollapsedEn) Reset()
func (*CollapsedEn) Size ¶
func (m *CollapsedEn) Size() (n int)
func (*CollapsedEn) String ¶
func (this *CollapsedEn) String() string
func (*CollapsedEn) Unmarshal ¶
func (m *CollapsedEn) Unmarshal(dAtA []byte) error
func (*CollapsedEn) XXX_DiscardUnknown ¶
func (m *CollapsedEn) XXX_DiscardUnknown()
func (*CollapsedEn) XXX_Marshal ¶
func (m *CollapsedEn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CollapsedEn) XXX_Merge ¶
func (m *CollapsedEn) XXX_Merge(src proto.Message)
func (*CollapsedEn) XXX_Size ¶
func (m *CollapsedEn) XXX_Size() int
func (*CollapsedEn) XXX_Unmarshal ¶
func (m *CollapsedEn) XXX_Unmarshal(b []byte) error
type CollapsedLn ¶
type CollapsedLn struct { Key []byte `protobuf:"bytes,1,opt,name=Key,proto3" json:"Key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=Value,proto3" json:"Value,omitempty"` }
func (*CollapsedLn) Descriptor ¶
func (*CollapsedLn) Descriptor() ([]byte, []int)
func (*CollapsedLn) Equal ¶
func (this *CollapsedLn) Equal(that interface{}) bool
func (*CollapsedLn) GetKey ¶
func (m *CollapsedLn) GetKey() []byte
func (*CollapsedLn) GetValue ¶
func (m *CollapsedLn) GetValue() []byte
func (*CollapsedLn) GoString ¶
func (this *CollapsedLn) GoString() string
func (*CollapsedLn) Marshal ¶
func (m *CollapsedLn) Marshal() (dAtA []byte, err error)
func (*CollapsedLn) MarshalToSizedBuffer ¶
func (m *CollapsedLn) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CollapsedLn) ProtoMessage ¶
func (*CollapsedLn) ProtoMessage()
func (*CollapsedLn) Reset ¶
func (m *CollapsedLn) Reset()
func (*CollapsedLn) Size ¶
func (m *CollapsedLn) Size() (n int)
func (*CollapsedLn) String ¶
func (this *CollapsedLn) String() string
func (*CollapsedLn) Unmarshal ¶
func (m *CollapsedLn) Unmarshal(dAtA []byte) error
func (*CollapsedLn) XXX_DiscardUnknown ¶
func (m *CollapsedLn) XXX_DiscardUnknown()
func (*CollapsedLn) XXX_Marshal ¶
func (m *CollapsedLn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CollapsedLn) XXX_Merge ¶
func (m *CollapsedLn) XXX_Merge(src proto.Message)
func (*CollapsedLn) XXX_Size ¶
func (m *CollapsedLn) XXX_Size() int
func (*CollapsedLn) XXX_Unmarshal ¶
func (m *CollapsedLn) XXX_Unmarshal(b []byte) error
type InterceptedTrieNode ¶
type InterceptedTrieNode struct {
// contains filtered or unexported fields
}
InterceptedTrieNode implements intercepted data interface and is used when trie nodes are intercepted
func NewInterceptedTrieNode ¶
func NewInterceptedTrieNode( buff []byte, marshalizer marshal.Marshalizer, hasher hashing.Hasher, ) (*InterceptedTrieNode, error)
NewInterceptedTrieNode creates a new instance of InterceptedTrieNode
func (*InterceptedTrieNode) CheckValidity ¶
func (inTn *InterceptedTrieNode) CheckValidity() error
CheckValidity checks if the intercepted data is valid
func (*InterceptedTrieNode) CreateEndOfProcessingTriggerNode ¶
func (inTn *InterceptedTrieNode) CreateEndOfProcessingTriggerNode()
CreateEndOfProcessingTriggerNode changes the hash of the current node by appending the hash to the current hash. This construction will be used to trigger the end of processing for all of the received data
func (*InterceptedTrieNode) EncodedNode ¶
func (inTn *InterceptedTrieNode) EncodedNode() []byte
EncodedNode returns the intercepted encoded node
func (*InterceptedTrieNode) Hash ¶
func (inTn *InterceptedTrieNode) Hash() []byte
Hash returns the hash of the intercepted node
func (*InterceptedTrieNode) IsForCurrentShard ¶
func (inTn *InterceptedTrieNode) IsForCurrentShard() bool
IsForCurrentShard checks if the intercepted data is for the current shard
func (*InterceptedTrieNode) IsInterfaceNil ¶
func (inTn *InterceptedTrieNode) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*InterceptedTrieNode) Type ¶
func (inTn *InterceptedTrieNode) Type() string
Type returns the type of this intercepted data