Versions in this module Expand all Collapse all v1 v1.1.66 Jun 17, 2021 v1.1.65 Jun 17, 2021 Changes in this version + const RewardTxPoolName + const TxPoolNumSendersToPreemptivelyEvict + const TxPoolNumTxsToPreemptivelyEvict + const UnsignedTxPoolName + var ErrBadRequest = errors.New("request should not be done as it doesn't follow the protocol") + var ErrCacheConfigInvalidEconomics = errors.New("cache-economics parameter is not valid") + var ErrCacheConfigInvalidSharding = errors.New("cache-sharding parameter is not valid") + var ErrCacheConfigInvalidShards = errors.New("cache parameter [shards] is not valid, it must be a positive number") + var ErrCacheConfigInvalidSize = errors.New("cache parameter [size] is not valid, it must be a positive number") + var ErrCacheConfigInvalidSizeInBytes = errors.New(...) + var ErrContainerKeyAlreadyExists = errors.New("provided key already exists in container") + var ErrEmptyString = errors.New("empty string") + var ErrIntOverflowRequestData = fmt.Errorf("proto: integer overflow") + var ErrInvalidContainerKey = errors.New("element does not exist in container") + var ErrInvalidLengthRequestData = fmt.Errorf("proto: negative length found during unmarshaling") + var ErrInvalidMaxTxRequest = errors.New("max tx request number is invalid") + var ErrInvalidNonceByteSlice = errors.New("invalid nonce byte slice") + var ErrInvalidValue = errors.New("invalid value") + var ErrLenMismatch = errors.New("lengths mismatch") + var ErrMissingData = errors.New("missing data") + var ErrNilAntifloodHandler = errors.New("nil antiflood handler") + var ErrNilConfig = errors.New("nil config provided") + var ErrNilContainerElement = errors.New("element cannot be nil") + var ErrNilCurrBlockTxs = errors.New("nil current block txs holder") + var ErrNilDataPacker = errors.New("nil data packer provided") + var ErrNilDataPoolHolder = errors.New("nil data pool holder") + var ErrNilDataToProcess = errors.New("nil data to process") + var ErrNilEconomicsData = errors.New("nil economics data provided") + var ErrNilEpochHandler = errors.New("nil epoch handler") + var ErrNilGracefullyCloseChannel = errors.New("nil gracefully close channel") + var ErrNilHeadersDataPool = errors.New("nil headers data pool") + var ErrNilHeadersNoncesStorage = errors.New("nil headers nonces storage") + var ErrNilHeadersStorage = errors.New("nil headers storage") + var ErrNilManualEpochStartNotifier = errors.New("nil manual epoch start notifier") + var ErrNilMarshalizer = errors.New("nil Marshalizer") + var ErrNilMessage = errors.New("nil message") + var ErrNilMessenger = errors.New("nil Messenger") + var ErrNilMiniblocksPool = errors.New("nil miniblocks pool") + var ErrNilMiniblocksStorage = errors.New("nil miniblocks storage") + var ErrNilPeerChangeBlockDataPool = errors.New("nil peer change block data pool") + var ErrNilPeerListCreator = errors.New("nil peer list creator provided") + var ErrNilRandomizer = errors.New("nil randomizer") + var ErrNilRequestedItemsHandler = errors.New("nil requested items handler") + var ErrNilResolverContainer = errors.New("nil resolver container") + var ErrNilResolverDebugHandler = errors.New("nil resolver debug handler") + var ErrNilResolverFinder = errors.New("nil resolvers finder") + var ErrNilResolverSender = errors.New("nil resolver sender") + var ErrNilRewardTransactionPool = errors.New("nil reward transaction data pool") + var ErrNilShardCoordinator = errors.New("nil shard coordinator") + var ErrNilSmartContractsPool = errors.New("nil smart contracts pool") + var ErrNilStore = errors.New("nil data storage service") + var ErrNilThrottler = errors.New("nil throttler") + var ErrNilTrieDataGetter = errors.New("nil trie data getter provided") + var ErrNilTrieNodesPool = errors.New("nil trie nodes data pool") + var ErrNilTxBlockDataPool = errors.New("nil tx block data pool") + var ErrNilTxDataPool = errors.New("nil transaction data pool") + var ErrNilTxGasHandler = errors.New("nil tx gas handler provided") + var ErrNilTxStorage = errors.New("nil transaction storage") + var ErrNilUint64ByteSliceConverter = errors.New("nil byte slice converter") + var ErrNilUnsignedTransactionPool = errors.New("nil unsigned transactions data pool") + var ErrNilValue = errors.New("nil value") + var ErrNilWhiteListHandler = errors.New("nil white list handler") + var ErrNoSuchStorageUnit = errors.New("no such unit type") + var ErrRequestIntervalTooSmall = errors.New("request interval is too small") + var ErrRequestTypeNotImplemented = errors.New("request type is not implemented") + var ErrResolveTypeUnknown = errors.New("unknown resolve type") + var ErrSendRequest = errors.New("cannot send request: peer list is empty or errors during the sending") + var ErrSystemBusy = errors.New("system busy") + var ErrTxNotFoundInBlockPool = errors.New("cannot find tx in current block pool") + var ErrUnexpectedEndOfGroupRequestData = fmt.Errorf("proto: unexpected end of group") + var ErrWrongTypeInContainer = errors.New("wrong type of object inside container") + var RequestDataType_name = map[int32]string + var RequestDataType_value = map[string]int32 + func SetEpochHandlerToHdrResolver(resolversContainer ResolversContainer, epochHandler EpochHandler) error + type ChainStorer struct + func NewChainStorer() *ChainStorer + func (bc *ChainStorer) AddStorer(key UnitType, s storage.Storer) + func (bc *ChainStorer) CloseAll() error + func (bc *ChainStorer) Destroy() error + func (bc *ChainStorer) Get(unitType UnitType, key []byte) ([]byte, error) + func (bc *ChainStorer) GetAll(unitType UnitType, keys [][]byte) (map[string][]byte, error) + func (bc *ChainStorer) GetStorer(unitType UnitType) storage.Storer + func (bc *ChainStorer) Has(unitType UnitType, key []byte) error + func (bc *ChainStorer) IsInterfaceNil() bool + func (bc *ChainStorer) Put(unitType UnitType, key []byte, value []byte) error + func (bc *ChainStorer) SetEpochForPutOperation(epoch uint32) + type DataPacker interface + IsInterfaceNil func() bool + PackDataInChunks func(data [][]byte, limit int) ([][]byte, error) + type EpochHandler interface + IsInterfaceNil func() bool + MetaEpoch func() uint32 + type EpochProviderByNonce interface + EpochForNonce func(nonce uint64) (uint32, error) + IsInterfaceNil func() bool + type HeaderResolver interface + RequestDataFromEpoch func(identifier []byte) error + RequestDataFromNonce func(nonce uint64, epoch uint32) error + SetEpochHandler func(epochHandler EpochHandler) error + type HeadersPool interface + AddHeader func(headerHash []byte, header data.HeaderHandler) + Clear func() + GetHeaderByHash func(hash []byte) (data.HeaderHandler, error) + GetHeadersByNonceAndShardId func(headerNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error) + GetNumHeaders func(shardId uint32) int + IsInterfaceNil func() bool + Len func() int + MaxSize func() int + Nonces func(shardId uint32) []uint64 + RegisterHandler func(handler func(headerHandler data.HeaderHandler, headerHash []byte)) + RemoveHeaderByHash func(headerHash []byte) + RemoveHeaderByNonceAndShardId func(headerNonce uint64, shardId uint32) + type IntRandomizer interface + Intn func(n int) int + IsInterfaceNil func() bool + type ManualEpochStartNotifier interface + CurrentEpoch func() uint32 + IsInterfaceNil func() bool + NewEpoch func(epoch uint32) + type MessageHandler interface + ConnectedPeersOnTopic func(topic string) []core.PeerID + ID func() core.PeerID + IsInterfaceNil func() bool + SendToConnectedPeer func(topic string, buff []byte, peerID core.PeerID) error + type MiniBlocksResolver interface + RequestDataFromHashArray func(hashes [][]byte, epoch uint32) error + type P2PAntifloodHandler interface + BlacklistPeer func(peer core.PeerID, reason string, duration time.Duration) + CanProcessMessage func(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error + CanProcessMessagesOnTopic func(peer core.PeerID, topic string, numMessages uint32, _ uint64, sequence []byte) error + IsInterfaceNil func() bool + type PeerListCreator interface + IntraShardPeerList func() []core.PeerID + IsInterfaceNil func() bool + PeerList func() []core.PeerID + type PoolsHolder interface + CurrentBlockTxs func() TransactionCacher + Headers func() HeadersPool + IsInterfaceNil func() bool + MiniBlocks func() storage.Cacher + PeerChangesBlocks func() storage.Cacher + RewardTransactions func() ShardedDataCacherNotifier + SmartContracts func() storage.Cacher + Transactions func() ShardedDataCacherNotifier + TrieNodes func() storage.Cacher + UnsignedTransactions func() ShardedDataCacherNotifier + type RequestData struct + Epoch uint32 + Type RequestDataType + Value []byte + func (*RequestData) Descriptor() ([]byte, []int) + func (*RequestData) ProtoMessage() + func (m *RequestData) GetEpoch() uint32 + func (m *RequestData) GetType() RequestDataType + func (m *RequestData) GetValue() []byte + func (m *RequestData) Marshal() (dAtA []byte, err error) + func (m *RequestData) MarshalTo(dAtA []byte) (int, error) + func (m *RequestData) MarshalToSizedBuffer(dAtA []byte) (int, error) + func (m *RequestData) Reset() + func (m *RequestData) Size() (n int) + func (m *RequestData) Unmarshal(dAtA []byte) error + func (m *RequestData) XXX_DiscardUnknown() + func (m *RequestData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) + func (m *RequestData) XXX_Merge(src proto.Message) + func (m *RequestData) XXX_Size() int + func (m *RequestData) XXX_Unmarshal(b []byte) error + func (rd *RequestData) UnmarshalWith(marshalizer marshal.Marshalizer, message p2p.MessageP2P) error + func (this *RequestData) Equal(that interface{}) bool + func (this *RequestData) GoString() string + func (this *RequestData) String() string + type RequestDataType int32 + const EpochType + const HashArrayType + const HashType + const InvalidType + const NonceType + func (RequestDataType) EnumDescriptor() ([]byte, []int) + func (x RequestDataType) String() string + type RequestedItemsHandler interface + Add func(key string) error + Has func(key string) bool + IsInterfaceNil func() bool + Sweep func() + type Resolver interface + IsInterfaceNil func() bool + NumPeersToQuery func() (int, int) + ProcessReceivedMessage func(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error + RequestDataFromHash func(hash []byte, epoch uint32) error + SetNumPeersToQuery func(intra int, cross int) + SetResolverDebugHandler func(handler ResolverDebugHandler) error + type ResolverDebugHandler interface + IsInterfaceNil func() bool + LogFailedToResolveData func(topic string, hash []byte, err error) + LogRequestedData func(topic string, hashes [][]byte, numReqIntra int, numReqCross int) + LogSucceededToResolveData func(topic string, hash []byte) + type ResolverThrottler interface + CanProcess func() bool + EndProcessing func() + IsInterfaceNil func() bool + StartProcessing func() + type ResolversContainer interface + Add func(key string, val Resolver) error + AddMultiple func(keys []string, resolvers []Resolver) error + Get func(key string) (Resolver, error) + IsInterfaceNil func() bool + Iterate func(handler func(key string, resolver Resolver) bool) + Len func() int + Remove func(key string) + Replace func(key string, val Resolver) error + ResolverKeys func() string + type ResolversContainerFactory interface + Create func() (ResolversContainer, error) + IsInterfaceNil func() bool + type ResolversFinder interface + CrossShardResolver func(baseTopic string, crossShard uint32) (Resolver, error) + IntraShardResolver func(baseTopic string) (Resolver, error) + MetaChainResolver func(baseTopic string) (Resolver, error) + MetaCrossShardResolver func(baseTopic string, crossShard uint32) (Resolver, error) + type ShardIdHashMap interface + Delete func(shardId uint32) + IsInterfaceNil func() bool + Load func(shardId uint32) ([]byte, bool) + Range func(f func(shardId uint32, hash []byte) bool) + Store func(shardId uint32, hash []byte) + type ShardedDataCacherNotifier interface + AddData func(key []byte, data interface{}, sizeInBytes int, cacheId string) + Clear func() + ClearShardStore func(cacheId string) + GetCounts func() counting.CountsWithSize + ImmunizeSetOfDataAgainstEviction func(keys [][]byte, cacheId string) + IsInterfaceNil func() bool + MergeShardStores func(sourceCacheID, destCacheID string) + RegisterOnAdded func(func(key []byte, value interface{})) + RemoveData func(key []byte, cacheId string) + RemoveDataFromAllShards func(key []byte) + RemoveSetOfDataFromPool func(keys [][]byte, cacheId string) + SearchFirstData func(key []byte) (value interface{}, ok bool) + ShardDataStore func(cacheId string) (c storage.Cacher) + type StorageService interface + AddStorer func(key UnitType, s storage.Storer) + CloseAll func() error + Destroy func() error + Get func(unitType UnitType, key []byte) ([]byte, error) + GetAll func(unitType UnitType, keys [][]byte) (map[string][]byte, error) + GetStorer func(unitType UnitType) storage.Storer + Has func(unitType UnitType, key []byte) error + IsInterfaceNil func() bool + Put func(unitType UnitType, key []byte, value []byte) error + SetEpochForPutOperation func(epoch uint32) + type StorageType uint8 + type TopicHandler interface + CreateTopic func(name string, createChannelForTopic bool) error + HasTopic func(name string) bool + RegisterMessageProcessor func(topic string, handler p2p.MessageProcessor) error + type TopicMessageHandler interface + type TopicResolverSender interface + IsInterfaceNil func() bool + NumPeersToQuery func() (int, int) + RequestTopic func() string + ResolverDebugHandler func() ResolverDebugHandler + Send func(buff []byte, peer core.PeerID) error + SendOnRequestTopic func(rd *RequestData, originalHashes [][]byte) error + SetNumPeersToQuery func(intra int, cross int) + SetResolverDebugHandler func(handler ResolverDebugHandler) error + TargetShardID func() uint32 + type TransactionCacher interface + AddTx func(txHash []byte, tx data.TransactionHandler) + Clean func() + GetTx func(txHash []byte) (data.TransactionHandler, error) + IsInterfaceNil func() bool + type TrieDataGetter interface + GetSerializedNode func([]byte) ([]byte, error) + GetSerializedNodes func([]byte, uint64) ([][]byte, uint64, error) + IsInterfaceNil func() bool + type TrieNodesResolver interface + RequestDataFromHashArray func(hashes [][]byte, epoch uint32) error + type UnitType uint8 + const BlockHeaderUnit + const BootstrapUnit + const EpochByHashUnit + const HeartbeatUnit + const MetaBlockUnit + const MetaHdrNonceHashDataUnit + const MiniBlockUnit + const MiniblockHashByTxHashUnit + const MiniblocksMetadataUnit + const PeerChangesUnit + const ReceiptsUnit + const ResultsHashesByTxHashUnit + const RewardTransactionUnit + const ShardHdrNonceHashDataUnit + const StatusMetricsUnit + const TransactionUnit + const TxLogsUnit + const UnsignedTransactionUnit + func GetHdrNonceHashDataUnit(shard uint32) UnitType + func (ut UnitType) String() string + type WhiteListHandler interface + Add func(keys [][]byte) + IsInterfaceNil func() bool + Remove func(keys [][]byte)