Documentation ¶
Index ¶
- Constants
- Variables
- func AddHeaderToBlackList(blackListHandler BlackListHandler, hash []byte)
- func EmptyChannel(ch chan bool) int
- func GetHeaderFromStorageWithNonce(nonce uint64, shardId uint32, storageService dataRetriever.StorageService, ...) (data.HeaderHandler, []byte, error)
- func GetMarshalizedHeaderFromStorage(blockUnit dataRetriever.UnitType, hash []byte, marshalizer marshal.Marshalizer, ...) ([]byte, error)
- func GetMetaHeader(hash []byte, headersCacher dataRetriever.HeadersPool, ...) (*block.MetaBlock, error)
- func GetMetaHeaderFromPool(hash []byte, headersCacher dataRetriever.HeadersPool) (*block.MetaBlock, error)
- func GetMetaHeaderFromPoolWithNonce(nonce uint64, headersCacher dataRetriever.HeadersPool) (*block.MetaBlock, []byte, error)
- func GetMetaHeaderFromStorage(hash []byte, marshalizer marshal.Marshalizer, ...) (*block.MetaBlock, error)
- func GetMetaHeaderFromStorageWithNonce(nonce uint64, storageService dataRetriever.StorageService, ...) (*block.MetaBlock, []byte, error)
- func GetMetaHeaderWithNonce(nonce uint64, headersCacher dataRetriever.HeadersPool, ...) (*block.MetaBlock, []byte, error)
- func GetShardHeader(hash []byte, headersCacher dataRetriever.HeadersPool, ...) (*block.Header, error)
- func GetShardHeaderFromPool(hash []byte, headersCacher dataRetriever.HeadersPool) (*block.Header, error)
- func GetShardHeaderFromPoolWithNonce(nonce uint64, shardId uint32, headersCacher dataRetriever.HeadersPool) (*block.Header, []byte, error)
- func GetShardHeaderFromStorage(hash []byte, marshalizer marshal.Marshalizer, ...) (*block.Header, error)
- func GetShardHeaderFromStorageWithNonce(nonce uint64, shardId uint32, storageService dataRetriever.StorageService, ...) (*block.Header, []byte, error)
- func GetShardHeaderWithNonce(nonce uint64, shardId uint32, headersCacher dataRetriever.HeadersPool, ...) (*block.Header, []byte, error)
- func GetTransactionHandler(senderShardID uint32, destShardID uint32, txHash []byte, ...) (data.TransactionHandler, error)
- func GetTransactionHandlerFromPool(senderShardID uint32, destShardID uint32, txHash []byte, ...) (data.TransactionHandler, error)
- func GetTransactionHandlerFromStorage(txHash []byte, storageService dataRetriever.StorageService, ...) (data.TransactionHandler, error)
- func IsInProperRound(index int64) bool
- func ShardCacherIdentifier(senderShardId uint32, destinationShardId uint32) string
- func SortHeadersByNonce(headers []data.HeaderHandler)
- type ArgumentsParser
- type BlackListHandler
- type BlockChainHookHandler
- type BlockHeaderState
- type BlockProcessor
- type BlockSizeThrottler
- type BlockTracker
- type BootStorer
- type Bootstrapper
- type BootstrapperFromStorage
- type Checker
- type DataPacker
- type EconomicsAddressesHandler
- type EpochBootstrapper
- type EpochStartTriggerHandler
- type FeeHandler
- type ForkDetector
- type ForkInfo
- type GasHandler
- type HashAccesser
- type HdrValidatorHandler
- type HeaderConstructionValidator
- type HeaderValidator
- type InterceptedData
- type InterceptedDataFactory
- type InterceptedHeaderSigVerifier
- type Interceptor
- type InterceptorProcessor
- type InterceptorThrottler
- type InterceptorsContainer
- type InterceptorsContainerFactory
- type IntermediateProcessorContainer
- type IntermediateProcessorsContainerFactory
- type IntermediateTransactionHandler
- type InternalTransactionProducer
- type MiniBlocksCompacter
- type NetworkConnectionWatcher
- type PeerChangesHandler
- type PendingMiniBlocksHandler
- type PoolsCleaner
- type PreProcessor
- type PreProcessorsContainer
- type PreProcessorsContainerFactory
- type RequestBlockBodyHandler
- type RequestHandler
- type RequiredDataPool
- type RewardTransactionPreProcessor
- type RewardTransactionProcessor
- type RewardsHandler
- type SCQuery
- type SigVerifier
- type SignedDataValidator
- type SmartContractProcessor
- type SmartContractResultProcessor
- type SmartContractToProtocolHandler
- type SpecialAddressHandler
- type TemporaryAccountsHandler
- type TopicHandler
- type TransactionCoordinator
- type TransactionFeeHandler
- type TransactionProcessor
- type TransactionType
- type TransactionVerifier
- type TransactionWithFeeHandler
- type TxTypeHandler
- type TxValidator
- type TxValidatorHandler
- type ValidatorSettingsHandler
- type ValidatorStatisticsProcessor
- type VirtualMachinesContainer
- type VirtualMachinesContainerFactory
Constants ¶
const BlockFinality = 1
BlockFinality defines the block finality which is used in meta-chain/shards (the real finality in shards is given by meta-chain)
const EpochChangeGracePeriod = 1
EpochChangeGracePeriod defines the allowed round numbers till the shard has to change the epoch
const MaxHeaderRequestsAllowed = 10
MaxHeaderRequestsAllowed defines the maximum number of missing cross-shard headers (gaps) which could be requested in one round, when node processes a received block
const MaxHeadersToRequestInAdvance = 10
MaxHeadersToRequestInAdvance defines the maximum number of headers which will be requested in advance, if they are missing
const MaxItemsInBlock = 15000
MaxItemsInBlock defines the maximum threshold which could be set, and represents the maximum number of items (hashes of: mini blocks, txs, meta-headers, shard-headers) which could be added in one block
const MaxNonceDifferences = uint64(10000)
MaxNonceDifferences represents the maximum nonce difference between received and committed header, so the received one to be stored in advance in block tracker
const MaxNoncesWithoutCrossNotarized = 100
MaxNoncesWithoutCrossNotarized defines the maximum nonces to wait for a new block to be cross notarized, before a special action to be applied
const MaxOccupancyPercentageAllowed = float64(0.9)
MaxOccupancyPercentageAllowed defines the maximum occupancy percentage allowed to be used, from the full pool capacity, for the received data which are not needed in the near future
const MaxRequestsWithTimeoutAllowed = 5
MaxRequestsWithTimeoutAllowed defines the maximum allowed number of requests with timeout, before a special action to be applied
const MaxRoundsWithoutCommittedBlock = 10
MaxRoundsWithoutCommittedBlock defines the maximum rounds to wait for a new block to be committed, before a special action to be applied
const MetaBlockValidity = 1
MetaBlockValidity defines the block validity which is when checking a metablock
const MinForkRound = uint64(0)
MinForkRound represents the minimum fork round set by a notarized header received
const MinItemsInBlock = 15000
MinItemsInBlock defines the minimum threshold which could be set, and represents the maximum number of items (hashes of: mini blocks, txs, meta-headers, shard-headers) which could be added in one block
const NonceDifferenceWhenSynced = 0
NonceDifferenceWhenSynced defines the difference between probable highest nonce seen from network and node's last committed block nonce, after which, node is considered himself not synced
const NumTxPerSenderBatchForFillingMiniblock = 10
NumTxPerSenderBatchForFillingMiniblock defines the number of transactions to be drawn from the transactions pool, for a specific sender, in a single pass. Drawing transactions for a miniblock happens in multiple passes, until "MaxItemsInBlock" are drawn.
const RoundModulusTrigger = 5
RoundModulusTrigger defines a round modulus on which a trigger for an action will be released
const TxPoolALotOfTransactionsForASender = uint32(500)
TxPoolALotOfTransactionsForASender instructs tx pool eviction algorithm to tag a sender with more transactions than this value as a "sender with a lot of transactions"
const TxPoolNumOldestSendersToEvict = uint32(500)
TxPoolNumOldestSendersToEvict instructs tx pool eviction algorithm to remove this many senders when eviction takes place
const TxPoolNumTxsToEvictForASenderWithALot = uint32(100)
TxPoolNumTxsToEvictForASenderWithALot instructs tx pool eviction algorithm to remove this many transactions for "a sender with a lot of transactions" when eviction takes place
const TxPoolThresholdEvictSenders = uint32(1000)
TxPoolThresholdEvictSenders instructs tx pool eviction algorithm to not evict senders, unless the number of senders is larger than this threshold
Variables ¶
var ErrAccountStateDirty = errors.New("accountState was dirty before starting to change")
ErrAccountStateDirty signals that the accounts were modified before starting the current modification
var ErrBlockHashDoesNotMatch = errors.New("block hash does not match")
ErrBlockHashDoesNotMatch signals that header hash does not match with the previous one
var ErrBlockProposerSignatureMissing = errors.New("block proposer signature is missing")
ErrBlockProposerSignatureMissing signals that block proposer signature is missing from the block aggregated sig
var ErrContainerKeyAlreadyExists = errors.New("provided key already exists in container")
ErrContainerKeyAlreadyExists signals that an element was already set in the container's map
var ErrCrossShardMBWithoutConfirmationFromMeta = errors.New("cross shard miniblock with destination current shard is not confirmed by metachain")
ErrCrossShardMBWithoutConfirmationFromMeta signals that miniblock was not yet notarized by metachain
var ErrEmptyFunctionName = errors.New("empty function name")
ErrEmptyFunctionName signals that an empty function name has been provided
var ErrEmptyTxDataPool = errors.New("empty transaction data pool")
ErrEmptyTxDataPool signals that a empty transaction pool has been provided
var ErrEpochDoesNotMatch = errors.New("epoch does not match")
ErrEpochDoesNotMatch signals that epoch does not match between headers
var ErrEpochStartDataDoesNotMatch = errors.New("epoch start data does not match")
ErrEpochStartDataDoesNotMatch signals that EpochStartData is not the same as the leader created
var ErrFailedTransaction = errors.New("failed transaction, gas consumed")
ErrFailedTransaction signals that transaction is of type failed.
var ErrHeaderBodyMismatch = errors.New("body cannot be validated from header data")
ErrHeaderBodyMismatch signals that the header does not attest all data from the block
var ErrHeaderIsBlackListed = errors.New("header is black listed")
ErrHeaderIsBlackListed signals that the header provided is black listed
var ErrHeaderNotFinal = errors.New("header in metablock is not final")
ErrHeaderNotFinal signals that header is not final and it should be
var ErrHeaderShardDataMismatch = errors.New("shard header does not match shard info")
ErrHeaderShardDataMismatch signals that shard header does not match created shard info
var ErrHigherGasLimitRequiredInTx = errors.New("higher gas limit required in tx")
ErrHigherGasLimitRequiredInTx signals that a higher gas limit was required in tx
var ErrHigherNonceInTransaction = errors.New("higher nonce in transaction")
ErrHigherNonceInTransaction signals the nonce in transaction is higher than the account's nonce
var ErrInsufficientFunds = errors.New("insufficient funds")
ErrInsufficientFunds signals the funds are insufficient
var ErrInsufficientGasLimitInTx = errors.New("insufficient gas limit in tx")
ErrInsufficientGasLimitInTx signals that a lower gas limit than required was provided
var ErrInsufficientGasPriceInTx = errors.New("insufficient gas price in tx")
ErrInsufficientGasPriceInTx signals that a lower gas price than required was provided
var ErrInvalidChainID = errors.New("invalid chain ID while processing")
ErrInvalidChainID signals that an invalid chain ID has been provided
var ErrInvalidContainerKey = errors.New("element does not exist in container")
ErrInvalidContainerKey signals that an element does not exist in the container's map
var ErrInvalidGasPerDataByte = errors.New("invalid gas per data byte")
ErrInvalidGasPerDataByte signals that an invalid gas per data byte has been read from config file
var ErrInvalidInitialNodesState = errors.New("provided initial state is invalid")
ErrInvalidInitialNodesState signals that the initial nodes state is invalid
var ErrInvalidMaxGasLimitPerBlock = errors.New("invalid max gas limit per block")
ErrInvalidMaxGasLimitPerBlock signals that an invalid max gas limit per block has been read from config file
var ErrInvalidMetaHeader = errors.New("invalid header provided, expected MetaBlock")
ErrInvalidMetaHeader signals that a wrong implementation of HeaderHandler was provided
var ErrInvalidMetaPoolHolder = errors.New("invalid meta pool holder")
ErrInvalidMetaPoolHolder signals that a required shard data information is missing
var ErrInvalidMinimumGasLimitForTx = errors.New("invalid minimum gas limit for transactions")
ErrInvalidMinimumGasLimitForTx signals that an invalid minimum gas limit for transactions has been read from config file
var ErrInvalidMinimumGasPrice = errors.New("invalid minimum gas price")
ErrInvalidMinimumGasPrice signals that an invalid gas price has been read from config file
var ErrInvalidNonceRequest = errors.New("invalid nonce request")
ErrInvalidNonceRequest signals that invalid nonce was requested
var ErrInvalidPeerAccount = errors.New("invalid peer account")
ErrInvalidPeerAccount signals that a peer account is invalid
var ErrInvalidRcvAddr = errors.New("invalid receiver address")
ErrInvalidRcvAddr signals that an operation has been attempted to or with an invalid receiver address
var ErrInvalidRewardsPercentages = errors.New("invalid rewards percentages")
ErrInvalidRewardsPercentages signals that rewards percentages are not correct
var ErrInvalidRewardsValue = errors.New("invalid rewards value")
ErrInvalidRewardsValue signals that an invalid rewards value has been read from config file
var ErrInvalidShardId = errors.New("invalid shard id")
ErrInvalidShardId signals that the shard id is invalid
var ErrInvalidSndAddr = errors.New("invalid sender address")
ErrInvalidSndAddr signals that an operation has been attempted to or with an invalid sender address
var ErrInvalidTxInPool = errors.New("invalid transaction in the transactions pool")
ErrInvalidTxInPool signals an invalid transaction in the transactions pool
var ErrInvalidUnboundPeriod = errors.New("invalid unbound period")
ErrInvalidUnboundPeriod signals that an invalid unbound period has been read from config file
var ErrLenMismatch = errors.New("lengths mismatch")
ErrLenMismatch signals that 2 or more slices have different lengths
var ErrLowerNonceInTransaction = errors.New("lower nonce in transaction")
ErrLowerNonceInTransaction signals the nonce in transaction is lower than the account's nonce
var ErrLowerRoundInBlock = errors.New("header round is lower than last committed")
ErrLowerRoundInBlock signals that a header round is too low for processing it
var ErrMarshalWithoutSuccess = errors.New("marshal without success")
ErrMarshalWithoutSuccess signals that marshal some data was not done with success
var ErrMaxGasLimitPerBlockInSelfShardIsReached = errors.New("max gas limit per block in self shard is reached")
ErrMaxGasLimitPerBlockInSelfShardIsReached signals that max gas limit per block in self shard has been reached
var ErrMaxGasLimitPerMiniBlockInReceiverShardIsReached = errors.New("max gas limit per mini block in receiver shard is reached")
ErrMaxGasLimitPerMiniBlockInReceiverShardIsReached signals that max gas limit per mini block in receiver shard has been reached
var ErrMaxGasLimitPerMiniBlockInSenderShardIsReached = errors.New("max gas limit per mini block in sender shard is reached")
ErrMaxGasLimitPerMiniBlockInSenderShardIsReached signals that max gas limit per mini block in sender shard has been reached
var ErrMaxRatingIsSmallerThanMinRating = errors.New("max rating is smaller than min rating")
ErrMaxRatingIsSmallerThanMinRating signals that the max rating is smaller than the min rating value
var ErrMinRatingSmallerThanOne = errors.New("min rating is smaller than one")
ErrMinRatingSmallerThanOne signals that the min rating is smaller than the min value of 1
var ErrMiniBlockHashMismatch = errors.New("miniblocks does not match")
ErrMiniBlockHashMismatch signals that miniblock hashes does not match
var ErrMiniBlockNumMissMatch = errors.New("num miniblocks does not match")
ErrMiniBlockNumMissMatch signals that number of miniblocks does not match
var ErrMiniblockNotForCurrentShard = errors.New("miniblock is not addressed for current shard")
ErrMiniblockNotForCurrentShard signals that the current processing miniblock must not be processed on the current shard
var ErrMintAddressNotInThisShard = errors.New("mint address does not belong to current shard")
ErrMintAddressNotInThisShard signals that the mint address does not belong to current shard
var ErrMissingBody = errors.New("missing body")
ErrMissingBody signals that body of the block is missing
var ErrMissingHashForHeaderNonce = errors.New("missing hash for header nonce")
ErrMissingHashForHeaderNonce signals that hash of the block is missing
var ErrMissingHeader = errors.New("missing header")
ErrMissingHeader signals that header of the block is missing
var ErrMissingPreProcessor = errors.New("pre processor is missing")
ErrMissingPreProcessor signals that required pre processor is missing
var ErrMissingPrevShardData = errors.New("shard data is missing")
ErrMissingPrevShardData signals that a required shard data information is missing
var ErrMissingShardDataInStorage = errors.New("missing shard data in storage")
ErrMissingShardDataInStorage signals that some ShardData information is missing from storage
var ErrMissingTransaction = errors.New("missing transaction")
ErrMissingTransaction signals that one transaction is missing
var ErrNegativeValue = errors.New("negative value")
ErrNegativeValue signals that a negative value has been detected and it is not allowed
var ErrNilAccountsAdapter = errors.New("nil AccountsAdapter")
ErrNilAccountsAdapter defines the error when trying to use a nil AccountsAddapter
var ErrNilAddressContainer = errors.New("nil AddressContainer")
ErrNilAddressContainer signals that an operation has been attempted to or with a nil AddressContainer implementation
var ErrNilAddressConverter = errors.New("nil AddressConverter")
ErrNilAddressConverter signals that an operation has been attempted to or with a nil AddressConverter implementation
var ErrNilAppStatusHandler = errors.New("nil AppStatusHandler")
ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler
var ErrNilArgumentParser = errors.New("argument parser is nil")
ErrNilArgumentParser signals that the argument parser is nil
var ErrNilArgumentStruct = errors.New("nil argument struct")
ErrNilArgumentStruct signals that a function has received nil instead of an instantiated Arg... structure
var ErrNilBadTxHandler = errors.New("nil bad tx handler")
ErrNilBadTxHandler signals that bad tx handler is nil
var ErrNilBlackListHandler = errors.New("nil black list handler")
ErrNilBlackListHandler signals that a nil black list handler was provided
var ErrNilBlockBody = errors.New("nil block body")
ErrNilBlockBody signals that an operation has been attempted to or with a nil block body
var ErrNilBlockChain = errors.New("nil block chain")
ErrNilBlockChain signals that an operation has been attempted to or with a nil blockchain
var ErrNilBlockChainHook = errors.New("nil blockchain hook")
ErrNilBlockChainHook signals that nil blockchain hook has been provided
var ErrNilBlockExecutor = errors.New("nil BlockExecutor")
ErrNilBlockExecutor signals that an operation has been attempted to or with a nil BlockExecutor implementation
var ErrNilBlockHeader = errors.New("nil block header")
ErrNilBlockHeader signals that an operation has been attempted to or with a nil block header
var ErrNilBlockTracker = errors.New("nil block tracker")
ErrNilBlockTracker signals that a nil block tracker was provided
var ErrNilBuffer = errors.New("provided byte buffer is nil")
ErrNilBuffer signals that a provided byte buffer is nil
var ErrNilCacher = errors.New("nil cacher")
ErrNilCacher signals that a nil cache has been provided
var ErrNilContainerElement = errors.New("element cannot be nil")
ErrNilContainerElement signals when trying to add a nil element in the container
var ErrNilDataPoolHolder = errors.New("nil data pool holder")
ErrNilDataPoolHolder signals that the data pool holder is nil
var ErrNilDataToProcess = errors.New("nil data to process")
ErrNilDataToProcess signals that nil data was provided
var ErrNilDatabase = errors.New("nil database")
ErrNilDatabase signals that the database is nil
var ErrNilEconomicsData = errors.New("nil economics data")
ErrNilEconomicsData signals that nil economics data has been provided
var ErrNilEconomicsFeeHandler = errors.New("nil economics fee handler")
ErrNilEconomicsFeeHandler signals that fee handler is nil
var ErrNilEconomicsRewardsHandler = errors.New("nil economics rewards handler")
ErrNilEconomicsRewardsHandler signals that rewards handler is nil
var ErrNilEpochStartTrigger = errors.New("nil start of epoch trigger")
ErrNilEpochStartTrigger signals that a nil start of epoch trigger was provided
var ErrNilForkDetector = errors.New("nil fork detector")
ErrNilForkDetector signals that the fork detector is nil
var ErrNilGasHandler = errors.New("nil gas handler")
ErrNilGasHandler signals that gas handler is nil
var ErrNilGasSchedule = errors.New("nil GasSchedule")
ErrNilGasSchedule signals that an operation has been attempted with a nil gas schedule
var ErrNilHasher = errors.New("nil Hasher")
ErrNilHasher signals that an operation has been attempted to or with a nil hasher implementation
var ErrNilHaveTimeHandler = errors.New("nil have time handler")
ErrNilHaveTimeHandler signals that a nil have time handler func was provided
var ErrNilHdrValidator = errors.New("nil header validator")
ErrNilHdrValidator signals that a nil header validator has been provided
var ErrNilHeaderSigVerifier = errors.New("nil header sig verifier")
ErrNilHeaderSigVerifier signals that a nil header sig verifier has been provided
var ErrNilHeaderValidator = errors.New("nil header validator")
ErrNilHeaderValidator signals that nil header validator has been provided
var ErrNilHeadersDataPool = errors.New("nil headers data pool")
ErrNilHeadersDataPool signals that a nil headers pool has been provided
var ErrNilHeadersNonceHashStorage = errors.New("nil headers nonce hash storage")
ErrNilHeadersNonceHashStorage signals that a nil header nonce hash storage has been provided
var ErrNilHeadersNoncesDataPool = errors.New("nil headers nonces cache")
ErrNilHeadersNoncesDataPool signals that a nil header - nonce cache
var ErrNilHeadersStorage = errors.New("nil headers storage")
ErrNilHeadersStorage signals that a nil header storage has been provided
var ErrNilInterceptedDataFactory = errors.New("nil intercepted data factory")
ErrNilInterceptedDataFactory signals that a nil intercepted data factory was provided
var ErrNilInterceptedDataProcessor = errors.New("nil intercepted data processor")
ErrNilInterceptedDataProcessor signals that a nil intercepted data processor was provided
var ErrNilInterceptorThrottler = errors.New("nil interceptor throttler")
ErrNilInterceptorThrottler signals that a nil interceptor throttler was provided
var ErrNilIntermediateProcessorContainer = errors.New("intermediate processor container is nil")
ErrNilIntermediateProcessorContainer signals that intermediate processors container is nil
var ErrNilIntermediateTransactionHandler = errors.New("intermediate transaction handler is nil")
ErrNilIntermediateTransactionHandler signals that nil intermediate transaction handler was provided
var ErrNilInternalTransactionProducer = errors.New("nil internal transaction producere")
ErrNilInternalTransactionProducer signals that a nil system transactions producer was provided
var ErrNilKeyGen = errors.New("nil key generator")
ErrNilKeyGen signals that an operation has been attempted to or with a nil single sign key generator
var ErrNilMarshalizer = errors.New("nil Marshalizer")
ErrNilMarshalizer signals that an operation has been attempted to or with a nil Marshalizer implementation
var ErrNilMediator = errors.New("nil mediator")
ErrNilMediator signals that a mediator implementation is needed, but it is nil
var ErrNilMessage = errors.New("nil message")
ErrNilMessage signals that a nil message has been received
var ErrNilMessenger = errors.New("nil Messenger")
ErrNilMessenger signals that a nil Messenger object was provided
var ErrNilMetaBlockHeader = errors.New("nil metablock header")
ErrNilMetaBlockHeader signals that an operation has been attempted to or with a nil metablock
var ErrNilMetaBlocksPool = errors.New("nil meta blocks pool")
ErrNilMetaBlocksPool signals that a nil meta blocks pool was used
var ErrNilMetaHeadersNoncesDataPool = errors.New("nil meta headers nonces cache")
ErrNilMetaHeadersNoncesDataPool signals a nil metachain header - nonce cache
var ErrNilMiniBlockPool = errors.New("nil mini block pool")
ErrNilMiniBlockPool signals that a nil mini blocks pool was used
var ErrNilMiniBlocks = errors.New("nil mini blocks")
ErrNilMiniBlocks signals that an operation has been attempted with a nil mini-block
var ErrNilMiniBlocksCompacter = errors.New("nil mini blocks compacter")
ErrNilMiniBlocksCompacter signals that a nil mini blocks compacter has been provided
var ErrNilMultiSigVerifier = errors.New("nil multi-signature verifier")
ErrNilMultiSigVerifier signals that a nil multi-signature verifier is used
var ErrNilNetworkWatcher = errors.New("nil network watcher")
ErrNilNetworkWatcher signals that a nil network watcher has been provided
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")
ErrNilNodesCoordinator signals that an operation has been attempted to or with a nil nodes coordinator
var ErrNilNodesSetup = errors.New("nil nodes setup")
ErrNilNodesSetup signals that nil nodes setup has been provided
var ErrNilPeerAccountsAdapter = errors.New("nil peer accounts database")
ErrNilPeerAccountsAdapter signals that a nil peer accounts database was provided
var ErrNilPeerChangesHandler = errors.New("nil peer changes handler")
ErrNilPeerChangesHandler signals that nil peer changes handler has been provided
var ErrNilPendingMiniBlocksHandler = errors.New("nil pending miniblocks handler")
ErrNilPendingMiniBlocksHandler signals that a nil pending miniblocks handler has been provided
var ErrNilPoolsHolder = errors.New("nil pools holder")
ErrNilPoolsHolder signals that an operation has been attempted to or with a nil pools holder object
var ErrNilPreProcessorsContainer = errors.New("preprocessors container is nil")
ErrNilPreProcessorsContainer signals that preprocessors container is nil
var ErrNilPrevRandSeed = errors.New("provided previous rand seed is nil")
ErrNilPrevRandSeed signals that a nil previous rand seed has been provided
var ErrNilPreviousBlockHash = errors.New("nil previous block header hash")
ErrNilPreviousBlockHash signals that a operation has been attempted with a nil previous block header hash
var ErrNilPubKeysBitmap = errors.New("nil public keys bitmap")
ErrNilPubKeysBitmap signals that a operation has been attempted with a nil public keys bitmap
var ErrNilPublicKey = errors.New("nil public key")
ErrNilPublicKey signals that a operation has been attempted with a nil public key
var ErrNilRandSeed = errors.New("provided rand seed is nil")
ErrNilRandSeed signals that a nil rand seed has been provided
var ErrNilRater = errors.New("nil rater")
ErrNilRater signals that nil rater has been provided
var ErrNilRatingReader = errors.New("nil rating reader")
ErrNilRatingReader signals that nil rating reader has been provided
var ErrNilRcvAddr = errors.New("nil receiver address")
ErrNilRcvAddr signals that an operation has been attempted to or with a nil receiver address
var ErrNilReceiptHandler = errors.New("nil receipt handler")
ErrNilReceiptHandler signals that receipt handler is nil
var ErrNilRequestHandler = errors.New("nil request handler")
ErrNilRequestHandler signals that a nil request handler interface was provided
var ErrNilResolverContainer = errors.New("nil resolver container")
ErrNilResolverContainer signals that a nil resolver container was provided
var ErrNilRewardTransaction = errors.New("reward transaction is nil")
ErrNilRewardTransaction signals that the reward transaction is nil
var ErrNilRewardTxDataPool = errors.New("reward transactions pool is nil")
ErrNilRewardTxDataPool signals that the reward transactions pool is nil
var ErrNilRewardsTxProcessor = errors.New("nil rewards transaction processor")
ErrNilRewardsTxProcessor signals that the rewards transaction processor is nil
var ErrNilRootHash = errors.New("root hash is nil")
ErrNilRootHash signals that an operation has been attempted with a nil root hash
var ErrNilRounder = errors.New("nil Rounder")
ErrNilRounder signals that an operation has been attempted to or with a nil Rounder implementation
var ErrNilSCDataGetter = errors.New("nil sc data getter")
ErrNilSCDataGetter signals that a nil sc data getter has been provided
var ErrNilSCDestAccount = errors.New("nil destination SC account")
ErrNilSCDestAccount signals that destination account is nil
var ErrNilSCToProtocol = errors.New("nil sc to protocol")
ErrNilSCToProtocol signals that nil smart contract to protocol handler has been provided
var ErrNilScAddress = errors.New("nil SC address")
ErrNilScAddress signals that a nil smart contract address has been provided
var ErrNilShardBlockPool = errors.New("nil shard block pool")
ErrNilShardBlockPool signals that a nil shard blocks pool was used
var ErrNilShardCoordinator = errors.New("nil shard coordinator")
ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator
var ErrNilShardedDataCacherNotifier = errors.New("nil sharded data cacher notifier")
ErrNilShardedDataCacherNotifier signals that a nil sharded data cacher notifier has been provided
var ErrNilSignature = errors.New("nil signature")
ErrNilSignature signals that a operation has been attempted with a nil signature
var ErrNilSingleSigner = errors.New("nil single signer")
ErrNilSingleSigner signals that a nil single signer is used
var ErrNilSmartContractProcessor = errors.New("smart contract processor is nil")
ErrNilSmartContractProcessor signals that smart contract call executor is nil
var ErrNilSmartContractResult = errors.New("smart contract result is nil")
ErrNilSmartContractResult signals that the smart contract result is nil
var ErrNilSmartContractResultProcessor = errors.New("nil smart contract result processor")
ErrNilSmartContractResultProcessor signals that smart contract result processor is nil
var ErrNilSndAddr = errors.New("nil sender address")
ErrNilSndAddr signals that an operation has been attempted to or with a nil sender address
var ErrNilSpecialAddressHandler = errors.New("nil special address handler")
ErrNilSpecialAddressHandler signals that special address handler is nil
var ErrNilStorage = errors.New("nil storage")
ErrNilStorage signals that a nil storage has been provided
var ErrNilStore = errors.New("nil data storage service")
ErrNilStore signals that the provided storage service is nil
var ErrNilTemporaryAccountsHandler = errors.New("temporary accounts handler is nil")
ErrNilTemporaryAccountsHandler signals that temporary accounts handler is nil
var ErrNilTransaction = errors.New("nil transaction")
ErrNilTransaction signals that an operation has been attempted to or with a nil transaction
var ErrNilTransactionCoordinator = errors.New("transaction coordinator is nil")
ErrNilTransactionCoordinator signals that transaction coordinator is nil
var ErrNilTransactionPool = errors.New("nil transaction pool")
ErrNilTransactionPool signals that a nil transaction pool was used
var ErrNilTxBlockBody = errors.New("nil tx block body")
ErrNilTxBlockBody signals that an operation has been attempted to or with a nil tx block body
var ErrNilTxDataPool = errors.New("nil transaction data pool")
ErrNilTxDataPool signals that a nil transaction pool has been provided
var ErrNilTxForCurrentBlockHandler = errors.New("nil tx for current block handler")
ErrNilTxForCurrentBlockHandler signals that nil tx for current block handler has been provided
var ErrNilTxHash = errors.New("nil transaction hash")
ErrNilTxHash signals that an operation has been attempted with a nil hash
var ErrNilTxHashes = errors.New("nil transaction hashes")
ErrNilTxHashes signals that an operation has been atempted with nil transaction hashes
var ErrNilTxProcessor = errors.New("nil transactions processor")
ErrNilTxProcessor signals that a nil transactions processor was used
var ErrNilTxStorage = errors.New("nil transaction storage")
ErrNilTxStorage signals that a nil transaction storage has been provided
var ErrNilTxTypeHandler = errors.New("nil tx type handler")
ErrNilTxTypeHandler signals that tx type handler is nil
var ErrNilTxValidator = errors.New("nil transaction validator")
ErrNilTxValidator signals that a nil tx validator has been provided
var ErrNilTxsPoolsCleaner = errors.New("nil transactions pools cleaner")
ErrNilTxsPoolsCleaner signals that a nil transactions pools cleaner has been provided
var ErrNilUTxDataPool = errors.New("unsigned transactions pool is nil")
ErrNilUTxDataPool signals that unsigned transaction pool is nil
var ErrNilUTxStorage = errors.New("unsigned transactions storage is nil")
ErrNilUTxStorage signals that unsigned transaction storage is nil
var ErrNilUint64Converter = errors.New("unit64converter is nil")
ErrNilUint64Converter signals that uint64converter is nil
var ErrNilUint64SyncMapCacher = errors.New("nil Uint64SyncMapCacher")
ErrNilUint64SyncMapCacher signals that a nil Uint64SyncMapCache has been provided
var ErrNilUnsignedTxHandler = errors.New("nil unsigned tx handler")
ErrNilUnsignedTxHandler signals that the unsigned tx handler is nil
var ErrNilVMOutput = errors.New("nil vm output")
ErrNilVMOutput signals that vmoutput is nil
var ErrNilValue = errors.New("nil value")
ErrNilValue signals the value is nil
var ErrNilValueFromRewardTransaction = errors.New("transferred value is nil in reward transaction")
ErrNilValueFromRewardTransaction signals that the transfered value is nil
var ErrNoDataInMessage = errors.New("no data found in received message")
ErrNoDataInMessage signals that no data was found after parsing received p2p message
var ErrNoVM = errors.New("no VM (hook not set)")
ErrNoVM signals that no SCHandler has been set
var ErrNotEnoughArgumentsToDeploy = errors.New("not enough arguments to deploy the smart contract")
ErrNotEnoughArgumentsToDeploy signals that there are not enough arguments to deploy the smart contract
var ErrNotEnoughGas = errors.New("not enough gas was sent in the transaction")
ErrNotEnoughGas signals that not enough gas has been provided
var ErrNotEnoughValidBlocksInStorage = errors.New("not enough valid blocks to start from storage")
ErrNotEnoughValidBlocksInStorage signals that bootstrap from storage failed due to not enough valid blocks stored
var ErrNotarizedHeadersSliceForShardIsNil = errors.New("notarized headers slice for shard is nil")
ErrNotarizedHeadersSliceForShardIsNil signals that the slice holding notarized headers for shard is nil
var ErrNotarizedHeadersSliceIsNil = errors.New("notarized headers slice is nil")
ErrNotarizedHeadersSliceIsNil signals that the slice holding notarized headers is nil
var ErrOverallBalanceChangeFromSC = errors.New("SC output balance updates are wrong")
ErrOverallBalanceChangeFromSC signals that all sumed balance changes are not zero
var ErrPeerChangesHashDoesNotMatch = errors.New("peer changes hash does not match")
ErrPeerChangesHashDoesNotMatch signals that peer changes from header does not match the created ones
var ErrRandSeedDoesNotMatch = errors.New("random seed do not match")
ErrRandSeedDoesNotMatch signals that random seed does not match with the previous one
var ErrReceiptsHashMissmatch = errors.New("receipts hash missmatch")
ErrReceiptsHashMissmatch signals that overall receipts has does not match
var ErrRewardTransactionNotFound = errors.New("reward transaction not found")
ErrRewardTransactionNotFound is raised when reward transaction should be present but was not found
var ErrRewardTxNotFound = errors.New("reward transaction not found")
ErrRewardTxNotFound signals that the reward transaction was not found
var ErrRewardTxsDoNotMatch = errors.New("calculated reward tx with block reward tx does not match")
ErrRewardTxsDoNotMatch signals that reward txs do not match
var ErrRewardTxsMismatchCreatedReceived = errors.New("mismatch between created and received reward transactions")
ErrRewardTxsMismatchCreatedReceived signals a mismatch between the nb of created and received reward transactions
var ErrRootStateDoesNotMatch = errors.New("root state does not match")
ErrRootStateDoesNotMatch signals that root state does not match
var ErrSCDeployFromSCRIsNotPermitted = errors.New("it is not permitted to deploy a smart contract from another smart contract cross shard")
ErrSCDeployFromSCRIsNotPermitted signals that operation is not permitted
var ErrShardIdMissmatch = errors.New("shard ID missmatch")
ErrShardIdMissmatch signals shard ID does not match expectations
var ErrStartRatingNotBetweenMinAndMax = errors.New("start rating is not between min and max rating")
ErrStartRatingNotBetweenMinAndMax signals that the start rating is not between min and max rating
var ErrSystemBusy = errors.New("system busy")
ErrSystemBusy signals that the system is busy
var ErrTimeIsOut = errors.New("time is out")
ErrTimeIsOut signals that time is out
var ErrTooManyReceiptsMiniBlocks = errors.New("too many receipts miniblocks")
ErrTooManyReceiptsMiniBlocks signals that there were too many receipts miniblocks created
var ErrTxNotFound = errors.New("transaction not found")
ErrTxNotFound signals that a transaction has not found
var ErrUnknownBlockType = errors.New("block type is unknown")
ErrUnknownBlockType signals that block type is not correct
var ErrUnmarshalWithoutSuccess = errors.New("unmarshal without success")
ErrUnmarshalWithoutSuccess signals that unmarshal some data was not done with success
var ErrVMTypeLengthInvalid = errors.New("vm type length is too long")
ErrVMTypeLengthInvalid signals that vm type length is too long
var ErrValidatorStatsRootHashDoesNotMatch = errors.New("root hash for validator statistics does not match")
ErrValidatorStatsRootHashDoesNotMatch signals that the root hash for the validator statistics does not match
var ErrWrongNonceInBlock = errors.New("wrong nonce in block")
ErrWrongNonceInBlock signals the nonce in block is different than expected nonce
var ErrWrongNonceInVMOutput = errors.New("nonce invalid from SC run")
ErrWrongNonceInVMOutput signals that nonce in vm output is wrong
var ErrWrongTransaction = errors.New("invalid transaction")
ErrWrongTransaction signals that transaction is invalid
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
ErrWrongTypeAssertion signals that an type assertion failed
var ErrWrongTypeInContainer = errors.New("wrong type of object inside container")
ErrWrongTypeInContainer signals that a wrong type of object was found in container
var ErrWrongTypeInMiniBlock = errors.New("type in miniblock is not correct for processing")
ErrWrongTypeInMiniBlock signals that type is not correct for processing
var ErrZeroMaxCleanTime = errors.New("cleaning time is equal or less than zero")
ErrZeroMaxCleanTime signals that cleaning time for pools is less or equal with 0
Functions ¶
func AddHeaderToBlackList ¶
func AddHeaderToBlackList(blackListHandler BlackListHandler, hash []byte)
AddHeaderToBlackList adds a hash to black list handler. Logs if the operation did not succeed
func GetHeaderFromStorageWithNonce ¶
func GetHeaderFromStorageWithNonce( nonce uint64, shardId uint32, storageService dataRetriever.StorageService, uint64Converter typeConverters.Uint64ByteSliceConverter, marshalizer marshal.Marshalizer, ) (data.HeaderHandler, []byte, error)
GetHeaderFromStorageWithNonce method returns a block header from storage with a given nonce and shardId
func GetMarshalizedHeaderFromStorage ¶
func GetMarshalizedHeaderFromStorage( blockUnit dataRetriever.UnitType, hash []byte, marshalizer marshal.Marshalizer, storageService dataRetriever.StorageService, ) ([]byte, error)
GetMarshalizedHeaderFromStorage gets the marshalized header, which is associated with the given hash, from storage
func GetMetaHeader ¶
func GetMetaHeader( hash []byte, headersCacher dataRetriever.HeadersPool, marshalizer marshal.Marshalizer, storageService dataRetriever.StorageService, ) (*block.MetaBlock, error)
GetMetaHeader gets the header, which is associated with the given hash, from pool or storage
func GetMetaHeaderFromPool ¶
func GetMetaHeaderFromPool( hash []byte, headersCacher dataRetriever.HeadersPool, ) (*block.MetaBlock, error)
GetMetaHeaderFromPool gets the header, which is associated with the given hash, from pool
func GetMetaHeaderFromPoolWithNonce ¶
func GetMetaHeaderFromPoolWithNonce( nonce uint64, headersCacher dataRetriever.HeadersPool, ) (*block.MetaBlock, []byte, error)
GetMetaHeaderFromPoolWithNonce method returns a meta block header from pool with a given nonce
func GetMetaHeaderFromStorage ¶
func GetMetaHeaderFromStorage( hash []byte, marshalizer marshal.Marshalizer, storageService dataRetriever.StorageService, ) (*block.MetaBlock, error)
GetMetaHeaderFromStorage gets the header, which is associated with the given hash, from storage
func GetMetaHeaderFromStorageWithNonce ¶
func GetMetaHeaderFromStorageWithNonce( nonce uint64, storageService dataRetriever.StorageService, uint64Converter typeConverters.Uint64ByteSliceConverter, marshalizer marshal.Marshalizer, ) (*block.MetaBlock, []byte, error)
GetMetaHeaderFromStorageWithNonce method returns a meta block header from storage with a given nonce
func GetMetaHeaderWithNonce ¶
func GetMetaHeaderWithNonce( nonce uint64, headersCacher dataRetriever.HeadersPool, marshalizer marshal.Marshalizer, storageService dataRetriever.StorageService, uint64Converter typeConverters.Uint64ByteSliceConverter, ) (*block.MetaBlock, []byte, error)
GetMetaHeaderWithNonce method returns a meta block header with a given nonce
func GetShardHeader ¶
func GetShardHeader( hash []byte, headersCacher dataRetriever.HeadersPool, marshalizer marshal.Marshalizer, storageService dataRetriever.StorageService, ) (*block.Header, error)
GetShardHeader gets the header, which is associated with the given hash, from pool or storage
func GetShardHeaderFromPool ¶
func GetShardHeaderFromPool( hash []byte, headersCacher dataRetriever.HeadersPool, ) (*block.Header, error)
GetShardHeaderFromPool gets the header, which is associated with the given hash, from pool
func GetShardHeaderFromPoolWithNonce ¶
func GetShardHeaderFromPoolWithNonce( nonce uint64, shardId uint32, headersCacher dataRetriever.HeadersPool, ) (*block.Header, []byte, error)
GetShardHeaderFromPoolWithNonce method returns a shard block header from pool with a given nonce and shardId
func GetShardHeaderFromStorage ¶
func GetShardHeaderFromStorage( hash []byte, marshalizer marshal.Marshalizer, storageService dataRetriever.StorageService, ) (*block.Header, error)
GetShardHeaderFromStorage gets the header, which is associated with the given hash, from storage
func GetShardHeaderFromStorageWithNonce ¶
func GetShardHeaderFromStorageWithNonce( nonce uint64, shardId uint32, storageService dataRetriever.StorageService, uint64Converter typeConverters.Uint64ByteSliceConverter, marshalizer marshal.Marshalizer, ) (*block.Header, []byte, error)
GetShardHeaderFromStorageWithNonce method returns a shard block header from storage with a given nonce and shardId
func GetShardHeaderWithNonce ¶
func GetShardHeaderWithNonce( nonce uint64, shardId uint32, headersCacher dataRetriever.HeadersPool, marshalizer marshal.Marshalizer, storageService dataRetriever.StorageService, uint64Converter typeConverters.Uint64ByteSliceConverter, ) (*block.Header, []byte, error)
GetShardHeaderWithNonce method returns a shard block header with a given nonce and shardId
func GetTransactionHandler ¶
func GetTransactionHandler( senderShardID uint32, destShardID uint32, txHash []byte, shardedDataCacherNotifier dataRetriever.ShardedDataCacherNotifier, storageService dataRetriever.StorageService, marshalizer marshal.Marshalizer, searchFirst bool, ) (data.TransactionHandler, error)
GetTransactionHandler gets the transaction with a given sender/receiver shardId and txHash
func GetTransactionHandlerFromPool ¶
func GetTransactionHandlerFromPool( senderShardID uint32, destShardID uint32, txHash []byte, shardedDataCacherNotifier dataRetriever.ShardedDataCacherNotifier, searchFirst bool, ) (data.TransactionHandler, error)
GetTransactionHandlerFromPool gets the transaction from pool with a given sender/receiver shardId and txHash
func GetTransactionHandlerFromStorage ¶
func GetTransactionHandlerFromStorage( txHash []byte, storageService dataRetriever.StorageService, marshalizer marshal.Marshalizer, ) (data.TransactionHandler, error)
GetTransactionHandlerFromStorage gets the transaction from storage with a given sender/receiver shardId and txHash
func IsInProperRound ¶
IsInProperRound checks if the given round index satisfies the round modulus trigger
func ShardCacherIdentifier ¶
ShardCacherIdentifier generates a string identifier between 2 shards
func SortHeadersByNonce ¶
func SortHeadersByNonce(headers []data.HeaderHandler)
SortHeadersByNonce will sort a given list of headers by nonce
Types ¶
type ArgumentsParser ¶
type ArgumentsParser interface { GetArguments() ([][]byte, error) GetCode() ([]byte, error) GetFunction() (string, error) ParseData(data string) error CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error) IsInterfaceNil() bool }
ArgumentsParser defines the functionality to parse transaction data into arguments and code for smart contracts
type BlackListHandler ¶
type BlackListHandler interface { Add(key string) error Has(key string) bool Sweep() IsInterfaceNil() bool }
BlackListHandler can determine if a certain key is or not blacklisted
type BlockChainHookHandler ¶
type BlockChainHookHandler interface { TemporaryAccountsHandler SetCurrentHeader(hdr data.HeaderHandler) }
BlockChainHookHandler defines the actions which should be performed by implementation
type BlockHeaderState ¶
type BlockHeaderState int
BlockHeaderState specifies which is the state of the block header received
const ( // BHReceived defines ID of a received block header BHReceived BlockHeaderState = iota // BHReceivedTooLate defines ID of a late received block header BHReceivedTooLate // BHProcessed defines ID of a processed block header BHProcessed // BHProposed defines ID of a proposed block header BHProposed // BHNotarized defines ID of a notarized block header BHNotarized )
type BlockProcessor ¶
type BlockProcessor interface { ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error RevertAccountState() RevertStateToBlock(header data.HeaderHandler) error CreateNewHeader() data.HeaderHandler CreateBlockBody(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error ApplyBodyToHeader(hdr data.HeaderHandler, body data.BodyHandler) (data.BodyHandler, error) ApplyProcessedMiniBlocks(processedMiniBlocks *processedMb.ProcessedMiniBlockTracker) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error) DecodeBlockBody(dta []byte) data.BodyHandler DecodeBlockHeader(dta []byte) data.HeaderHandler SetNumProcessedObj(numObj uint64) IsInterfaceNil() bool }
BlockProcessor is the main interface for block execution engine
type BlockSizeThrottler ¶
type BlockSizeThrottler interface { MaxItemsToAdd() uint32 Add(round uint64, items uint32) Succeed(round uint64) ComputeMaxItems() IsInterfaceNil() bool }
BlockSizeThrottler defines the functionality of adapting the node to the network speed/latency when it should send a block to its peers which should be received in a limited time frame
type BlockTracker ¶
type BlockTracker interface { AddCrossNotarizedHeader(shradID uint32, crossNotarizedHeader data.HeaderHandler, crossNotarizedHeaderHash []byte) AddSelfNotarizedHeader(shardID uint32, selfNotarizedHeader data.HeaderHandler, selfNotarizedHeaderHash []byte) AddTrackedHeader(header data.HeaderHandler, hash []byte) CleanupHeadersBehindNonce(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64) ComputeLongestChain(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte) ComputeLongestMetaChainFromLastNotarized() ([]data.HeaderHandler, [][]byte, error) ComputeLongestShardsChainsFromLastNotarized() ([]data.HeaderHandler, [][]byte, map[uint32][]data.HeaderHandler, error) DisplayTrackedHeaders() GetCrossNotarizedHeader(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error) GetLastCrossNotarizedHeader(shardID uint32) (data.HeaderHandler, []byte, error) GetLastCrossNotarizedHeadersForAllShards() (map[uint32]data.HeaderHandler, error) GetTrackedHeaders(shardID uint32) ([]data.HeaderHandler, [][]byte) GetTrackedHeadersForAllShards() map[uint32][]data.HeaderHandler GetTrackedHeadersWithNonce(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte) IsShardStuck(shardID uint32) bool RegisterCrossNotarizedHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)) RegisterSelfNotarizedHeadersHandler(func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)) RemoveLastNotarizedHeaders() RestoreToGenesis() IsInterfaceNil() bool }
BlockTracker defines the functionality for node to track the blocks which are received from network
type BootStorer ¶
type BootStorer interface { SaveLastRound(round int64) error Put(round int64, bootData bootstrapStorage.BootstrapData) error Get(round int64) (bootstrapStorage.BootstrapData, error) GetHighestRound() int64 IsInterfaceNil() bool }
BootStorer is the interface needed by bootstrapper to read/write data in storage
type Bootstrapper ¶
type Bootstrapper interface { AddSyncStateListener(func(isSyncing bool)) ShouldSync() bool StopSync() StartSync() SetStatusHandler(handler core.AppStatusHandler) error IsInterfaceNil() bool }
Bootstrapper is an interface that defines the behaviour of a struct that is able to synchronize the node
type BootstrapperFromStorage ¶
type BootstrapperFromStorage interface { LoadFromStorage() error GetHighestBlockNonce() uint64 IsInterfaceNil() bool }
BootstrapperFromStorage is the interface needed by boot component to load data from storage
type Checker ¶
type Checker interface { // IntegrityAndValidity does both validity and integrity checks on the data structure IntegrityAndValidity(coordinator sharding.Coordinator) error // Integrity checks only the integrity of the data Integrity(coordinator sharding.Coordinator) error // IsInterfaceNil returns true if there is no value under the interface IsInterfaceNil() bool }
Checker provides functionality to checks the integrity and validity of a data structure
type DataPacker ¶
type DataPacker interface { PackDataInChunks(data [][]byte, limit int) ([][]byte, error) IsInterfaceNil() bool }
DataPacker can split a large slice of byte slices in smaller packets
type EconomicsAddressesHandler ¶
type EconomicsAddressesHandler interface { CommunityAddress() string BurnAddress() string IsInterfaceNil() bool }
EconomicsAddressesHandler will return information about economics addresses
type EpochBootstrapper ¶
EpochBootstrapper defines the actions needed by bootstrapper
type EpochStartTriggerHandler ¶
type EpochStartTriggerHandler interface { Update(round uint64) ReceivedHeader(header data.HeaderHandler) IsEpochStart() bool Epoch() uint32 EpochStartRound() uint64 SetProcessed(header data.HeaderHandler) Revert() EpochStartMetaHdrHash() []byte IsInterfaceNil() bool SetFinalityAttestingRound(round uint64) EpochFinalityAttestingRound() uint64 }
EpochStartTriggerHandler defines that actions which are needed by processor for start of epoch
type FeeHandler ¶
type FeeHandler interface { MaxGasLimitPerBlock() uint64 ComputeGasLimit(tx TransactionWithFeeHandler) uint64 ComputeFee(tx TransactionWithFeeHandler) *big.Int CheckValidityTxValues(tx TransactionWithFeeHandler) error IsInterfaceNil() bool }
FeeHandler is able to perform some economics calculation on a provided transaction
type ForkDetector ¶
type ForkDetector interface { AddHeader(header data.HeaderHandler, headerHash []byte, state BlockHeaderState, selfNotarizedHeaders []data.HeaderHandler, selfNotarizedHeadersHashes [][]byte) error RemoveHeader(nonce uint64, hash []byte) CheckFork() *ForkInfo GetHighestFinalBlockNonce() uint64 GetHighestFinalBlockHash() []byte ProbableHighestNonce() uint64 ResetFork() SetRollBackNonce(nonce uint64) RestoreToGenesis() GetNotarizedHeaderHash(nonce uint64) []byte IsInterfaceNil() bool }
ForkDetector is an interface that defines the behaviour of a struct that is able to detect forks
type GasHandler ¶
type GasHandler interface { Init() SetGasConsumed(gasConsumed uint64, hash []byte) SetGasRefunded(gasRefunded uint64, hash []byte) GasConsumed(hash []byte) uint64 GasRefunded(hash []byte) uint64 TotalGasConsumed() uint64 TotalGasRefunded() uint64 RemoveGasConsumed(hashes [][]byte) RemoveGasRefunded(hashes [][]byte) ComputeGasConsumedByMiniBlock(*block.MiniBlock, map[string]data.TransactionHandler) (uint64, uint64, error) ComputeGasConsumedByTx(txSenderShardId uint32, txReceiverShardId uint32, txHandler data.TransactionHandler) (uint64, uint64, error) IsInterfaceNil() bool }
GasHandler is able to perform some gas calculation
type HashAccesser ¶
HashAccesser interface provides functionality over hashable objects
type HdrValidatorHandler ¶
type HdrValidatorHandler interface { Hash() []byte HeaderHandler() data.HeaderHandler }
HdrValidatorHandler defines the functionality that is needed for a HdrValidator to validate a header
type HeaderConstructionValidator ¶
type HeaderConstructionValidator interface { IsHeaderConstructionValid(currHdr, prevHdr data.HeaderHandler) error IsInterfaceNil() bool }
HeaderConstructionValidator provides functionality to verify header construction
type HeaderValidator ¶
type HeaderValidator interface { HeaderValidForProcessing(headerHandler HdrValidatorHandler) error IsInterfaceNil() bool }
HeaderValidator can determine if a provided header handler is valid or not from the process point of view
type InterceptedData ¶
type InterceptedData interface { CheckValidity() error IsForCurrentShard() bool IsInterfaceNil() bool Hash() []byte }
InterceptedData represents the interceptor's view of the received data
type InterceptedDataFactory ¶
type InterceptedDataFactory interface { Create(buff []byte) (InterceptedData, error) IsInterfaceNil() bool }
InterceptedDataFactory can create new instances of InterceptedData
type InterceptedHeaderSigVerifier ¶
type InterceptedHeaderSigVerifier interface { VerifyRandSeedAndLeaderSignature(header data.HeaderHandler) error VerifySignature(header data.HeaderHandler) error IsInterfaceNil() bool }
InterceptedHeaderSigVerifier is the interface needed at interceptors level to check a header if is correct
type Interceptor ¶
type Interceptor interface { ProcessReceivedMessage(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error IsInterfaceNil() bool }
Interceptor defines what a data interceptor should do It should also adhere to the p2p.MessageProcessor interface so it can wire to a p2p.Messenger
type InterceptorProcessor ¶
type InterceptorProcessor interface { Validate(data InterceptedData) error Save(data InterceptedData) error SignalEndOfProcessing(data []InterceptedData) IsInterfaceNil() bool }
InterceptorProcessor further validates and saves received data
type InterceptorThrottler ¶
type InterceptorThrottler interface { CanProcess() bool StartProcessing() EndProcessing() IsInterfaceNil() bool }
InterceptorThrottler can
type InterceptorsContainer ¶
type InterceptorsContainer interface { Get(key string) (Interceptor, error) Add(key string, val Interceptor) error AddMultiple(keys []string, interceptors []Interceptor) error Replace(key string, val Interceptor) error Remove(key string) Len() int IsInterfaceNil() bool }
InterceptorsContainer defines an interceptors holder data type with basic functionality
type InterceptorsContainerFactory ¶
type InterceptorsContainerFactory interface { Create() (InterceptorsContainer, error) IsInterfaceNil() bool }
InterceptorsContainerFactory defines the functionality to create an interceptors container
type IntermediateProcessorContainer ¶
type IntermediateProcessorContainer interface { Get(key block.Type) (IntermediateTransactionHandler, error) Add(key block.Type, val IntermediateTransactionHandler) error AddMultiple(keys []block.Type, preprocessors []IntermediateTransactionHandler) error Replace(key block.Type, val IntermediateTransactionHandler) error Remove(key block.Type) Len() int Keys() []block.Type IsInterfaceNil() bool }
IntermediateProcessorContainer defines an IntermediateProcessor holder data type with basic functionality
type IntermediateProcessorsContainerFactory ¶
type IntermediateProcessorsContainerFactory interface { Create() (IntermediateProcessorContainer, error) IsInterfaceNil() bool }
IntermediateProcessorsContainerFactory defines the functionality to create an IntermediateProcessors container
type IntermediateTransactionHandler ¶
type IntermediateTransactionHandler interface { AddIntermediateTransactions(txs []data.TransactionHandler) error CreateAllInterMiniBlocks() map[uint32]*block.MiniBlock VerifyInterMiniBlocks(body block.Body) error CreateMarshalizedData(txHashes [][]byte) ([][]byte, error) SaveCurrentIntermediateTxToStorage() error GetAllCurrentFinishedTxs() map[string]data.TransactionHandler CreateBlockStarted() GetCreatedInShardMiniBlock() *block.MiniBlock IsInterfaceNil() bool }
IntermediateTransactionHandler handles transactions which are not resolved in only one step
type InternalTransactionProducer ¶ added in v1.0.20
type InternalTransactionProducer interface { CreateAllInterMiniBlocks() map[uint32]*block.MiniBlock IsInterfaceNil() bool }
InternalTransactionProducer creates system transactions (e.g. rewards)
type MiniBlocksCompacter ¶ added in v1.0.36
type MiniBlocksCompacter interface { Compact(block.MiniBlockSlice, map[string]data.TransactionHandler) block.MiniBlockSlice Expand(block.MiniBlockSlice, map[string]data.TransactionHandler) (block.MiniBlockSlice, error) IsInterfaceNil() bool }
MiniBlocksCompacter defines the functionality that is needed for mini blocks compaction and expansion
type NetworkConnectionWatcher ¶
NetworkConnectionWatcher defines a watchdog functionality used to specify if the current node is still connected to the rest of the network
type PeerChangesHandler ¶
type PeerChangesHandler interface { PeerChanges() []block.PeerData VerifyPeerChanges(peerChanges []block.PeerData) error IsInterfaceNil() bool }
PeerChangesHandler will create the peer changes data for current block and will verify them
type PendingMiniBlocksHandler ¶
type PendingMiniBlocksHandler interface { PendingMiniBlockHeaders(lastNotarizedHeaders []data.HeaderHandler) ([]block.ShardMiniBlockHeader, error) AddProcessedHeader(handler data.HeaderHandler) error RevertHeader(handler data.HeaderHandler) error IsInterfaceNil() bool }
PendingMiniBlocksHandler is an interface to keep unfinalized miniblocks
type PoolsCleaner ¶
type PoolsCleaner interface { Clean(duration time.Duration) (bool, error) NumRemovedTxs() uint64 IsInterfaceNil() bool }
PoolsCleaner define the functionality that is needed for a pools cleaner
type PreProcessor ¶
type PreProcessor interface { CreateBlockStarted() IsDataPrepared(requestedTxs int, haveTime func() time.Duration) error RemoveTxBlockFromPools(body block.Body, miniBlockPool storage.Cacher) error RestoreTxBlockIntoPools(body block.Body, miniBlockPool storage.Cacher) (int, error) SaveTxBlockToStorage(body block.Body) error ProcessBlockTransactions(body block.Body, haveTime func() bool) error RequestBlockTransactions(body block.Body) int CreateMarshalizedData(txHashes [][]byte) ([][]byte, error) RequestTransactionsForMiniBlock(miniBlock *block.MiniBlock) int ProcessMiniBlock(miniBlock *block.MiniBlock, haveTime func() bool) error CreateAndProcessMiniBlocks(maxTxSpaceRemained uint32, maxMbSpaceRemained uint32, haveTime func() bool) (block.MiniBlockSlice, error) GetAllCurrentUsedTxs() map[string]data.TransactionHandler IsInterfaceNil() bool }
PreProcessor is an interface used to prepare and process transaction data
type PreProcessorsContainer ¶
type PreProcessorsContainer interface { Get(key block.Type) (PreProcessor, error) Add(key block.Type, val PreProcessor) error AddMultiple(keys []block.Type, preprocessors []PreProcessor) error Replace(key block.Type, val PreProcessor) error Remove(key block.Type) Len() int Keys() []block.Type IsInterfaceNil() bool }
PreProcessorsContainer defines an PreProcessors holder data type with basic functionality
type PreProcessorsContainerFactory ¶
type PreProcessorsContainerFactory interface { Create() (PreProcessorsContainer, error) IsInterfaceNil() bool }
PreProcessorsContainerFactory defines the functionality to create an PreProcessors container
type RequestBlockBodyHandler ¶
type RequestBlockBodyHandler interface {
GetBlockBodyFromPool(headerHandler data.HeaderHandler) (data.BodyHandler, error)
}
RequestBlockBodyHandler is the interface needed by process block
type RequestHandler ¶
type RequestHandler interface { RequestShardHeader(shardId uint32, hash []byte) RequestMetaHeader(hash []byte) RequestMetaHeaderByNonce(nonce uint64) RequestShardHeaderByNonce(shardId uint32, nonce uint64) RequestTransaction(shardId uint32, txHashes [][]byte) RequestUnsignedTransactions(destShardID uint32, scrHashes [][]byte) RequestRewardTransactions(destShardID uint32, txHashes [][]byte) RequestMiniBlock(shardId uint32, miniblockHash []byte) RequestTrieNodes(shardId uint32, hash []byte) IsInterfaceNil() bool }
RequestHandler defines the methods through which request to data can be made
type RequiredDataPool ¶
type RequiredDataPool struct {
// contains filtered or unexported fields
}
RequiredDataPool represents a structure that can hold a list of required data. Any time one of the expected hash value is received, the associated bit in the receivedBitmap property is set to 1. All of the data is considered received when the ones count of the received bitmap is equal to the expected data length
func (*RequiredDataPool) ExpectedData ¶
func (rh *RequiredDataPool) ExpectedData() [][]byte
ExpectedData returns the RequiredDataPool's expected data
func (*RequiredDataPool) ReceivedAll ¶
func (rh *RequiredDataPool) ReceivedAll() bool
ReceivedAll will return true if the count of ones in the bitmap is greater or equal to the expected data length
func (*RequiredDataPool) SetHashes ¶
func (rh *RequiredDataPool) SetHashes(hashes [][]byte)
SetHashes sets the expected data to the passed hashes parameter. The bitmap is also reset and adapted to the length of the new expected data
func (*RequiredDataPool) SetReceivedHash ¶
func (rh *RequiredDataPool) SetReceivedHash(hash []byte)
SetReceivedHash finds the hash in the expected values and sets the appropriate bit to 1. Nothing will happen if the hash is not actually expected
type RewardTransactionPreProcessor ¶
type RewardTransactionPreProcessor interface { AddComputedRewardMiniBlocks(computedRewardMiniblocks block.MiniBlockSlice) IsInterfaceNil() bool }
RewardTransactionPreProcessor prepares the processing of reward transactions
type RewardTransactionProcessor ¶
type RewardTransactionProcessor interface { ProcessRewardTransaction(rewardTx *rewardTx.RewardTx) error IsInterfaceNil() bool }
RewardTransactionProcessor is the interface for reward transaction execution engine
type RewardsHandler ¶
type RewardsHandler interface { RewardsValue() *big.Int CommunityPercentage() float64 LeaderPercentage() float64 BurnPercentage() float64 IsInterfaceNil() bool }
RewardsHandler will return information about rewards
type SigVerifier ¶
type SigVerifier interface {
VerifySig() error
}
SigVerifier provides functionality to verify a signature of a signed data structure that holds also the verifying parameters
type SignedDataValidator ¶
type SignedDataValidator interface { SigVerifier Checker }
SignedDataValidator provides functionality to check the validity and signature of a data structure
type SmartContractProcessor ¶
type SmartContractProcessor interface { ExecuteSmartContractTransaction(tx data.TransactionHandler, acntSrc, acntDst state.AccountHandler) error DeploySmartContract(tx data.TransactionHandler, acntSrc state.AccountHandler) error IsInterfaceNil() bool }
SmartContractProcessor is the main interface for the smart contract caller engine
type SmartContractResultProcessor ¶
type SmartContractResultProcessor interface { ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error IsInterfaceNil() bool }
SmartContractResultProcessor is the main interface for smart contract result execution engine
type SmartContractToProtocolHandler ¶
type SmartContractToProtocolHandler interface { UpdateProtocol(body block.Body, nonce uint64) error IsInterfaceNil() bool }
SmartContractToProtocolHandler is able to translate data from smart contract state into protocol changes
type SpecialAddressHandler ¶ added in v1.0.20
type SpecialAddressHandler interface { SetShardConsensusData(randomness []byte, round uint64, epoch uint32, shardID uint32) error SetMetaConsensusData(randomness []byte, round uint64, epoch uint32) error ConsensusShardRewardData() *data.ConsensusRewardData ConsensusMetaRewardData() []*data.ConsensusRewardData ClearMetaConsensusData() ElrondCommunityAddress() []byte LeaderAddress() []byte BurnAddress() []byte SetElrondCommunityAddress(elrond []byte) ShardIdForAddress([]byte) (uint32, error) Epoch() uint32 Round() uint64 IsCurrentNodeInConsensus() bool IsInterfaceNil() bool }
SpecialAddressHandler responds with needed special addresses
type TemporaryAccountsHandler ¶
type TemporaryAccountsHandler interface { AddTempAccount(address []byte, balance *big.Int, nonce uint64) CleanTempAccounts() TempAccount(address []byte) state.AccountHandler IsInterfaceNil() bool }
TemporaryAccountsHandler defines the functionality to create temporary accounts and pass to VM. This holder will contain usually one account from shard X that calls a SC in shard Y so when executing the code in shard Y, this impl will hold an ephemeral copy of the sender account from shard X
type TopicHandler ¶
type TopicHandler interface { HasTopic(name string) bool CreateTopic(name string, createChannelForTopic bool) error RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error IsInterfaceNil() bool }
TopicHandler defines the functionality needed by structs to manage topics and message processors
type TransactionCoordinator ¶
type TransactionCoordinator interface { RequestMiniBlocks(header data.HeaderHandler) RequestBlockTransactions(body block.Body) IsDataPreparedForProcessing(haveTime func() time.Duration) error SaveBlockDataToStorage(body block.Body) error RestoreBlockDataFromStorage(body block.Body) (int, error) RemoveBlockDataFromPool(body block.Body) error ProcessBlockTransaction(body block.Body, haveTime func() time.Duration) error CreateBlockStarted() CreateMbsAndProcessCrossShardTransactionsDstMe(header data.HeaderHandler, processedMiniBlocksHashes map[string]struct{}, maxTxSpaceRemained uint32, maxMbSpaceRemained uint32, haveTime func() bool) (block.MiniBlockSlice, uint32, bool) CreateMbsAndProcessTransactionsFromMe(maxTxSpaceRemained uint32, maxMbSpaceRemained uint32, haveTime func() bool) block.MiniBlockSlice CreateMarshalizedData(body block.Body) (map[uint32]block.MiniBlockSlice, map[string][][]byte) GetAllCurrentUsedTxs(blockType block.Type) map[string]data.TransactionHandler CreateReceiptsHash() ([]byte, error) VerifyCreatedBlockTransactions(hdr data.HeaderHandler, body block.Body) error IsInterfaceNil() bool }
TransactionCoordinator is an interface to coordinate transaction processing using multiple processors
type TransactionFeeHandler ¶
TransactionFeeHandler processes the transaction fee
type TransactionProcessor ¶
type TransactionProcessor interface { ProcessTransaction(transaction *transaction.Transaction) error IsInterfaceNil() bool }
TransactionProcessor is the main interface for transaction execution engine
type TransactionType ¶
type TransactionType int
TransactionType specifies the type of the transaction
const ( // MoveBalance defines ID of a payment transaction - moving balances MoveBalance TransactionType = iota // SCDeployment defines ID of a transaction to store a smart contract SCDeployment // SCInvoking defines ID of a transaction of type smart contract call SCInvoking // RewardTx defines ID of a reward transaction RewardTx // InvalidTransaction defines unknown transaction type InvalidTransaction )
type TransactionVerifier ¶
type TransactionVerifier interface {
IsTransactionValid(tx data.TransactionHandler) error
}
TransactionVerifier interface validates if the transaction is good and if it should be processed
type TransactionWithFeeHandler ¶
type TransactionWithFeeHandler interface { GetGasLimit() uint64 GetGasPrice() uint64 GetData() []byte GetRecvAddress() []byte }
TransactionWithFeeHandler represents a transaction structure that has economics variables defined
type TxTypeHandler ¶
type TxTypeHandler interface { ComputeTransactionType(tx data.TransactionHandler) (TransactionType, error) IsInterfaceNil() bool }
TxTypeHandler is an interface to calculate the transaction type
type TxValidator ¶
type TxValidator interface { CheckTxValidity(txHandler TxValidatorHandler) error IsInterfaceNil() bool }
TxValidator can determine if a provided transaction handler is valid or not from the process point of view
type TxValidatorHandler ¶
type TxValidatorHandler interface { SenderShardId() uint32 Nonce() uint64 SenderAddress() state.AddressContainer TotalValue() *big.Int }
TxValidatorHandler defines the functionality that is needed for a TxValidator to validate a transaction
type ValidatorSettingsHandler ¶
type ValidatorSettingsHandler interface { UnBoundPeriod() uint64 StakeValue() *big.Int IsInterfaceNil() bool }
ValidatorSettingsHandler defines the functionality which is needed for validators' settings
type ValidatorStatisticsProcessor ¶
type ValidatorStatisticsProcessor interface { UpdatePeerState(header data.HeaderHandler) ([]byte, error) RevertPeerState(header data.HeaderHandler) error RevertPeerStateToSnapshot(snapshot int) error GetPeerAccount(address []byte) (state.PeerAccountHandler, error) IsInterfaceNil() bool Commit() ([]byte, error) RootHash() ([]byte, error) }
ValidatorStatisticsProcessor is the main interface for validators' consensus participation statistics
type VirtualMachinesContainer ¶
type VirtualMachinesContainer interface { Get(key []byte) (vmcommon.VMExecutionHandler, error) Add(key []byte, val vmcommon.VMExecutionHandler) error AddMultiple(keys [][]byte, vms []vmcommon.VMExecutionHandler) error Replace(key []byte, val vmcommon.VMExecutionHandler) error Remove(key []byte) Len() int Keys() [][]byte IsInterfaceNil() bool }
VirtualMachinesContainer defines a virtual machine holder data type with basic functionality
type VirtualMachinesContainerFactory ¶
type VirtualMachinesContainerFactory interface { Create() (VirtualMachinesContainer, error) BlockChainHookImpl() BlockChainHookHandler IsInterfaceNil() bool }
VirtualMachinesContainerFactory defines the functionality to create a virtual machine container