Versions in this module Expand all Collapse all v0 v0.0.1 Nov 7, 2024 Changes in this version + const RewardTxPoolName + const TxPoolNumSendersToPreemptivelyEvict + const UnsignedTxPoolName + const ValidatorsInfoPoolName + 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 ErrNilCurrentEpochValidatorInfo = errors.New("nil current epoch validator info holder") + var ErrNilCurrentNetworkEpochProvider = errors.New("nil current network epoch provider") + 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 ErrNilDebugHandler = errors.New("nil debug handler") + var ErrNilEconomicsData = errors.New("nil economics data provided") + var ErrNilEpochHandler = errors.New("nil epoch handler") + var ErrNilEpochNotifier = errors.New("nil EpochNotifier") + var ErrNilGracefullyCloseChannel = errors.New("nil gracefully close channel") + var ErrNilHasher = errors.New("nil hasher") + var ErrNilHeadersDataPool = errors.New("nil headers data pool") + var ErrNilHeadersNoncesStorage = errors.New("nil headers nonces storage") + var ErrNilHeadersStorage = errors.New("nil headers storage") + var ErrNilHeartbeatPool = errors.New("nil heartbeat pool") + 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 ErrNilNodesCoordinator = errors.New("nil nodes coordinator") + var ErrNilPathManager = errors.New("nil path manager") + var ErrNilPayloadValidator = errors.New("nil payload validator") + var ErrNilPeerAuthenticationPool = errors.New("nil peer authentication pool") + var ErrNilPeerChangeBlockDataPool = errors.New("nil peer change block data pool") + var ErrNilPeerListCreator = errors.New("nil peer list creator provided") + var ErrNilPeersRatingHandler = errors.New("nil peers rating handler") + var ErrNilPreferredPeersHolder = errors.New("nil preferred peers holder") + var ErrNilRandomizer = errors.New("nil randomizer") + var ErrNilRequestSender = errors.New("nil request sender") + var ErrNilRequestedItemsHandler = errors.New("nil requested items handler") + var ErrNilRequestersContainer = errors.New("nil requesters container") + var ErrNilRequestersFinder = errors.New("nil requesters finder") + var ErrNilResolverContainer = errors.New("nil resolver container") + var ErrNilResolverSender = errors.New("nil resolver sender") + var ErrNilRewardTransactionPool = errors.New("nil reward transaction data pool") + var ErrNilSelfShardIDProvider = errors.New("nil self shard ID provider") + 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 ErrNilTrieNodesChunksPool = errors.New("nil trie nodes chunks data pool") + var ErrNilTrieNodesPool = errors.New("nil trie nodes data pool") + var ErrNilTrieStorageManager = errors.New("nil trie storage manager") + 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 ErrNilValidatorInfoPool = errors.New("nil validator info pool") + var ErrNilValidatorInfoStorage = errors.New("nil validator info storage") + var ErrNilValue = errors.New("nil value") + var ErrNilWhiteListHandler = errors.New("nil white list handler") + var ErrNoSuchStorageUnit = errors.New("no such unit type") + var ErrPeerAuthNotFound = errors.New("peer authentication not found") + 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 ErrStorerNotFound = errors.New("storer not found") + var ErrSystemBusy = errors.New("system busy") + var ErrTxNotFoundInBlockPool = errors.New("transaction was not found in the current block pool") + var ErrUnexpectedEndOfGroupRequestData = fmt.Errorf("proto: unexpected end of group") + var ErrValidatorInfoNotFound = errors.New("validator info not found") + var ErrValidatorInfoNotFoundInEpochPool = errors.New("validator info was not found in the current epoch pool") + var ErrWrongTypeAssertion = errors.New("wrong type assertion") + var ErrWrongTypeInContainer = errors.New("wrong type of object inside container") + var RequestDataType_name = map[int32]string + var RequestDataType_value = map[string]int32 + func SetEpochHandlerToHdrRequester(requestersContainer RequestersContainer, epochHandler EpochHandler) error + 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) GetAllStorers() map[UnitType]storage.Storer + func (bc *ChainStorer) GetStorer(unitType UnitType) (storage.Storer, error) + 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 CurrentNetworkEpochProviderHandler interface + EpochConfirmed func(newEpoch uint32, newTimestamp uint64) + EpochIsActiveInNetwork func(epoch uint32) bool + IsInterfaceNil func() bool + type DataPacker interface + IsInterfaceNil func() bool + PackDataInChunks func(data [][]byte, limit int) ([][]byte, error) + type DebugHandler 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 EpochHandler interface + IsInterfaceNil func() bool + MetaEpoch func() uint32 + type HeaderRequester interface + SetEpochHandler func(epochHandler EpochHandler) error + type HeaderResolver interface + 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 + ConnectedPeers func() []core.PeerID + ConnectedPeersOnTopic func(topic string) []core.PeerID + ID func() core.PeerID + IsConnected func(peerID core.PeerID) bool + IsInterfaceNil func() bool + SendToConnectedPeer func(topic string, buff []byte, peerID core.PeerID) error + type NodesCoordinator interface + GetAllEligibleValidatorsPublicKeys func(epoch uint32) (map[uint32][][]byte, error) + IsInterfaceNil func() bool + 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 PeerAuthenticationPayloadValidator interface + IsInterfaceNil func() bool + ValidateTimestamp func(payloadTimestamp int64) error + type PeerListCreator interface + CrossShardPeerList func() []core.PeerID + IntraShardPeerList func() []core.PeerID + IsInterfaceNil func() bool + type PeersRatingHandler interface + DecreaseRating func(pid core.PeerID) + GetTopRatedPeersFromList func(peers []core.PeerID, minNumOfPeersExpected int) []core.PeerID + IncreaseRating func(pid core.PeerID) + IsInterfaceNil func() bool + type PoolsHolder interface + Close func() error + CurrentBlockTxs func() TransactionCacher + CurrentEpochValidatorInfo func() ValidatorInfoCacher + Headers func() HeadersPool + Heartbeats func() storage.Cacher + IsInterfaceNil func() bool + MiniBlocks func() storage.Cacher + PeerAuthentications func() storage.Cacher + PeerChangesBlocks func() storage.Cacher + RewardTransactions func() ShardedDataCacherNotifier + SmartContracts func() storage.Cacher + Transactions func() ShardedDataCacherNotifier + TrieNodes func() storage.Cacher + TrieNodesChunks func() storage.Cacher + UnsignedTransactions func() ShardedDataCacherNotifier + ValidatorsInfo func() ShardedDataCacherNotifier + type PreferredPeersHolderHandler interface + Contains func(peerID core.PeerID) bool + Get func() map[uint32][]core.PeerID + IsInterfaceNil func() bool + type RequestData struct + ChunkIndex uint32 + Epoch uint32 + Type RequestDataType + Value []byte + func (*RequestData) Descriptor() ([]byte, []int) + func (*RequestData) ProtoMessage() + func (m *RequestData) GetChunkIndex() uint32 + 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 ChunkType + 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 Requester interface + IsInterfaceNil func() bool + NumPeersToQuery func() (int, int) + RequestDataFromHash func(hash []byte, epoch uint32) error + SetDebugHandler func(handler DebugHandler) error + SetNumPeersToQuery func(intra int, cross int) + type RequestersContainer interface + Add func(key string, val Requester) error + AddMultiple func(keys []string, requesters []Requester) error + Close func() error + Get func(key string) (Requester, error) + IsInterfaceNil func() bool + Iterate func(handler func(key string, requester Requester) bool) + Len func() int + Remove func(key string) + Replace func(key string, val Requester) error + RequesterKeys func() string + type RequestersContainerFactory interface + Create func() (RequestersContainer, error) + IsInterfaceNil func() bool + type RequestersFinder interface + CrossShardRequester func(baseTopic string, crossShard uint32) (Requester, error) + IntraShardRequester func(baseTopic string) (Requester, error) + MetaChainRequester func(baseTopic string) (Requester, error) + MetaCrossShardRequester func(baseTopic string, crossShard uint32) (Requester, error) + type Resolver interface + Close func() error + IsInterfaceNil func() bool + ProcessReceivedMessage func(message p2p.MessageP2P, fromConnectedPeer core.PeerID, ...) error + SetDebugHandler func(handler DebugHandler) error + 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 + Close func() 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 SelfShardIDProvider interface + IsInterfaceNil func() bool + SelfId func() uint32 + 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 + Keys func() [][]byte + 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) + GetAllStorers func() map[UnitType]storage.Storer + GetStorer func(unitType UnitType) (storage.Storer, error) + 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, identifier string, handler p2p.MessageProcessor) error + type TopicRequestSender interface + DebugHandler func() DebugHandler + IsInterfaceNil func() bool + NumPeersToQuery func() (int, int) + RequestTopic func() string + SendOnRequestTopic func(rd *RequestData, originalHashes [][]byte) error + SetDebugHandler func(handler DebugHandler) error + SetNumPeersToQuery func(intra int, cross int) + TargetShardID func() uint32 + type TopicResolverSender interface + DebugHandler func() DebugHandler + IsInterfaceNil func() bool + RequestTopic func() string + Send func(buff []byte, peer core.PeerID, destination p2p.MessageHandler) error + SetDebugHandler func(handler DebugHandler) 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 UnitType uint8 + const BlockHeaderUnit + const BootstrapUnit + const DCDTSuppliesUnit + const EpochByHashUnit + const HeartbeatUnit + const MetaBlockUnit + const MetaHdrNonceHashDataUnit + const MiniBlockUnit + const MiniblockHashByTxHashUnit + const MiniblocksMetadataUnit + const PeerAccountsUnit + const PeerChangesUnit + const ReceiptsUnit + const ResultsHashesByTxHashUnit + const RewardTransactionUnit + const RoundHdrHashDataUnit + const ScheduledSCRsUnit + const ShardHdrNonceHashDataUnit + const StatusMetricsUnit + const TransactionUnit + const TrieEpochRootHashUnit + const TxLogsUnit + const UnsignedTransactionUnit + const UserAccountsUnit + func GetHdrNonceHashDataUnit(shard uint32) UnitType + func GetHeadersDataUnit(shard uint32) UnitType + func (ut UnitType) String() string + type ValidatorInfoCacher interface + AddValidatorInfo func(validatorInfoHash []byte, validatorInfo *state.ShardValidatorInfo) + Clean func() + GetValidatorInfo func(validatorInfoHash []byte) (*state.ShardValidatorInfo, error) + IsInterfaceNil func() bool + type WhiteListHandler interface + Add func(keys [][]byte) + IsInterfaceNil func() bool + Remove func(keys [][]byte)