process

package
v1.0.102 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2020 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
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)

View Source
const EpochChangeGracePeriod = 1

EpochChangeGracePeriod defines the allowed round numbers till the shard has to change the epoch

View Source
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

View Source
const MaxHeadersToRequestInAdvance = 10

MaxHeadersToRequestInAdvance defines the maximum number of headers which will be requested in advance, if they are missing

View Source
const MaxMetaHeadersAllowedInOneShardBlock = 100

MaxMetaHeadersAllowedInOneShardBlock defines the maximum meta headers allowed to be included in one shard block

View Source
const MaxNumOfTxsToSelect = 30000

MaxNumOfTxsToSelect defines the maximum number of transactions that should be selected from the cache

View Source
const MaxNumPendingMiniBlocks = 100

MaxNumPendingMiniBlocks defines the maximum number of pending miniblocks, after which a shard could be considered stuck

View Source
const MaxRequestsWithTimeoutAllowed = 5

MaxRequestsWithTimeoutAllowed defines the maximum allowed number of requests with timeout, before a special action to be applied

View Source
const MaxRoundsToKeepUnprocessedMiniBlocks = 100

MaxRoundsToKeepUnprocessedMiniBlocks defines the maximum number of rounds for which unprocessed miniblocks are kept in pool

View Source
const MaxRoundsToKeepUnprocessedTransactions = 100

MaxRoundsToKeepUnprocessedTransactions defines the maximum number of rounds for which unprocessed transactions are kept in pool

View Source
const MaxRoundsWithoutCommittedBlock = 10

MaxRoundsWithoutCommittedBlock defines the maximum rounds to wait for a new block to be committed, before a special action to be applied

View Source
const MaxRoundsWithoutNewBlockReceived = 10

MaxRoundsWithoutNewBlockReceived defines the maximum rounds to wait for a new block to be received, before a special action to be applied

View Source
const MaxShardHeadersAllowedInOneMetaBlock = 100

MaxShardHeadersAllowedInOneMetaBlock defines the maximum shard headers allowed to be included in one meta block

View Source
const MaxSyncWithErrorsAllowed = 10

MaxSyncWithErrorsAllowed defines the maximum allowed number of sync with errors, before a special action to be applied

View Source
const MetaBlockValidity = 1

MetaBlockValidity defines the block validity which is when checking a metablock

View Source
const MinForkRound = uint64(0)

MinForkRound represents the minimum fork round set by a notarized header received

View Source
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

View Source
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.

View Source
const RoundModulusTrigger = 5

RoundModulusTrigger defines a round modulus on which a trigger for an action will be released

View Source
const RoundModulusTriggerWhenSyncIsStuck = 20

RoundModulusTriggerWhenSyncIsStuck defines a round modulus on which a trigger for an action when sync is stuck will be released

Variables

View Source
var ErrAccountNotFound = errors.New("account not found")

ErrAccountNotFound signals that the account was not found for the provided address

View Source
var ErrAccountStateDirty = errors.New("accountState was dirty before starting to change")

ErrAccountStateDirty signals that the accounts were modified before starting the current modification

View Source
var ErrAccumulatedFeesDoNotMatch = errors.New("accumulated fees do not match")

ErrAccumulatedFeesDoNotMatch signals that accumulated fees do not match

View Source
var ErrAccumulatedFeesInEpochDoNotMatch = errors.New("accumulated fees in epoch do not match")

ErrAccumulatedFeesInEpochDoNotMatch signals that accumulated fees in epoch do not match

View Source
var ErrBlockBodyHashMismatch = errors.New("block bodies does not match")

ErrBlockBodyHashMismatch signals that block body hashes does not match

View Source
var ErrBlockHashDoesNotMatch = errors.New("block hash does not match")

ErrBlockHashDoesNotMatch signals that header hash does not match with the previous one

View Source
var ErrBlockProposerSignatureMissing = errors.New("block proposer signature is missing")

ErrBlockProposerSignatureMissing signals that block proposer signature is missing from the block aggregated sig

View Source
var ErrConsecutiveMissedBlocksPenaltyLowerThanOne = errors.New("consecutive missed blocks penalty lower than 1")

ErrConsecutiveMissedBlocksPenaltyLowerThanOne signals that the ConsecutiveMissedBlocksPenalty is lower than 1

View Source
var ErrContainerKeyAlreadyExists = errors.New("provided key already exists in container")

ErrContainerKeyAlreadyExists signals that an element was already set in the container's map

View Source
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

View Source
var ErrDecreaseRatingsStepPositive = errors.New("decrease rating step has a positive value")

ErrDecreaseRatingsStepPositive signals that the decrease rating step has a positive value

View Source
var ErrDuplicateThreshold = errors.New("two thresholds are the same")

ErrDuplicateThreshold signals that two thresholds are the same

View Source
var ErrEmptyFunctionName = errors.New("empty function name")

ErrEmptyFunctionName signals that an empty function name has been provided

View Source
var ErrEmptyTopic = errors.New("empty topic")

ErrEmptyTopic signals that an empty topic has been provided

View Source
var ErrEmptyTxDataPool = errors.New("empty transaction data pool")

ErrEmptyTxDataPool signals that a empty transaction pool has been provided

View Source
var ErrEpochDoesNotMatch = errors.New("epoch does not match")

ErrEpochDoesNotMatch signals that epoch does not match between headers

View Source
var ErrEpochStartDataDoesNotMatch = errors.New("epoch start data does not match")

ErrEpochStartDataDoesNotMatch signals that EpochStartData is not the same as the leader created

View Source
var ErrFailedTransaction = errors.New("failed transaction, gas consumed")

ErrFailedTransaction signals that transaction is of type failed.

View Source
var ErrGettingShardDataFromEpochStartData = errors.New("could not find shard data from previous epoch start metablock")

ErrGettingShardDataFromEpochStartData signals that could not get shard data from previous epoch start block

View Source
var ErrHeaderBodyMismatch = errors.New("body cannot be validated from header data")

ErrHeaderBodyMismatch signals that the header does not attest all data from the block

View Source
var ErrHeaderIsBlackListed = errors.New("header is black listed")

ErrHeaderIsBlackListed signals that the header provided is black listed

View Source
var ErrHeaderNotFinal = errors.New("header in metablock is not final")

ErrHeaderNotFinal signals that header is not final and it should be

View Source
var ErrHeaderShardDataMismatch = errors.New("shard header does not match shard info")

ErrHeaderShardDataMismatch signals that shard header does not match created shard info

View Source
var ErrHigherGasLimitRequiredInTx = errors.New("higher gas limit required in tx")

ErrHigherGasLimitRequiredInTx signals that a higher gas limit was required in tx

View Source
var ErrHigherNonceInBlock = errors.New("higher nonce in block")

ErrHigherNonceInBlock signals that a block with higher nonce than permitted has been provided

View Source
var ErrHigherNonceInTransaction = errors.New("higher nonce in transaction")

ErrHigherNonceInTransaction signals the nonce in transaction is higher than the account's nonce

View Source
var ErrHigherRoundInBlock = errors.New("higher round in block")

ErrHigherRoundInBlock signals that a block with higher round than permitted has been provided

View Source
var ErrInsufficientFee = errors.New("insufficient fees")

ErrInsufficientFee signals that the current balance doesn't have the required transaction fee

View Source
var ErrInsufficientFunds = errors.New("insufficient funds")

ErrInsufficientFunds signals the funds are insufficient for the move balance operation but the transaction fee is covered by the current balance

View Source
var ErrInsufficientGasLimitInTx = errors.New("insufficient gas limit in tx")

ErrInsufficientGasLimitInTx signals that a lower gas limit than required was provided

View Source
var ErrInsufficientGasPriceInTx = errors.New("insufficient gas price in tx")

ErrInsufficientGasPriceInTx signals that a lower gas price than required was provided

View Source
var ErrInvalidAddressLength = errors.New("invalid address length")

ErrInvalidAddressLength signals that address length is invalid

View Source
var ErrInvalidArguments = errors.New("invalid arguments to process built-in function")

ErrInvalidArguments signals that invalid arguments were given to process built-in function

View Source
var ErrInvalidAuctionEnableNonce = errors.New("invalid auction enable nonce")

ErrInvalidAuctionEnableNonce signals that auction enable nonce is invalid

View Source
var ErrInvalidBody = errors.New("invalid body")

ErrInvalidBody signals that an invalid body has been provided

View Source
var ErrInvalidChainID = errors.New("invalid chain ID while processing")

ErrInvalidChainID signals that an invalid chain ID has been provided

View Source
var ErrInvalidContainerKey = errors.New("element does not exist in container")

ErrInvalidContainerKey signals that an element does not exist in the container's map

View Source
var ErrInvalidGasPerDataByte = errors.New("invalid gas per data byte")

ErrInvalidGasPerDataByte signals that an invalid gas per data byte has been read from config file

View Source
var ErrInvalidGenesisTotalSupply = errors.New("invalid genesis total supply")

ErrInvalidGenesisTotalSupply signals that invalid genesis total supply was provided

View Source
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

View Source
var ErrInvalidMetaHeader = errors.New("invalid header provided, expected MetaBlock")

ErrInvalidMetaHeader signals that a wrong implementation of HeaderHandler was provided

View Source
var ErrInvalidMetaTransaction = errors.New("meta transaction is invalid")

ErrInvalidMetaTransaction signals that meta transaction is invalid

View Source
var ErrInvalidMinStepValue = errors.New("invalid min step value")

ErrInvalidMinStepValue signals the min step value is invalid

View Source
var ErrInvalidMiniBlockType = errors.New("invalid miniblock type")

ErrInvalidMiniBlockType signals that an invalid miniblock type has been provided

View Source
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

View Source
var ErrInvalidMinimumGasPrice = errors.New("invalid minimum gas price")

ErrInvalidMinimumGasPrice signals that an invalid gas price has been read from config file

View Source
var ErrInvalidNonceRequest = errors.New("invalid nonce request")

ErrInvalidNonceRequest signals that invalid nonce was requested

View Source
var ErrInvalidPeerAccount = errors.New("invalid peer account")

ErrInvalidPeerAccount signals that a peer account is invalid

View Source
var ErrInvalidRcvAddr = errors.New("invalid receiver address")

ErrInvalidRcvAddr signals that an operation has been attempted to or with an invalid receiver address

View Source
var ErrInvalidRewardsPercentages = errors.New("invalid rewards percentages")

ErrInvalidRewardsPercentages signals that rewards percentages are not correct

View Source
var ErrInvalidRewardsValue = errors.New("invalid rewards value")

ErrInvalidRewardsValue signals that an invalid rewards value has been read from config file

View Source
var ErrInvalidShardCacherIdentifier = errors.New("invalid identifier for shard cacher")

ErrInvalidShardCacherIdentifier signals an invalid identifier

View Source
var ErrInvalidShardId = errors.New("invalid shard id")

ErrInvalidShardId signals that the shard id is invalid

View Source
var ErrInvalidSndAddr = errors.New("invalid sender address")

ErrInvalidSndAddr signals that an operation has been attempted to or with an invalid sender address

View Source
var ErrInvalidStakingEnableNonce = errors.New("invalid staking enable nonce")

ErrInvalidStakingEnableNonce signals that the staking enable nonce is invalid

View Source
var ErrInvalidTxInPool = errors.New("invalid transaction in the transactions pool")

ErrInvalidTxInPool signals an invalid transaction in the transactions pool

View Source
var ErrInvalidUnBondPeriod = errors.New("invalid unbond period")

ErrInvalidUnBondPeriod signals that an invalid unbond period has been read from config file

View Source
var ErrInvalidUnJailPrice = errors.New("invalid unjail price")

ErrInvalidUnJailPrice signals that invalid unjail price was provided

View Source
var ErrInvalidValue = errors.New("invalid value provided")

ErrInvalidValue signals that an invalid value was provided

View Source
var ErrLenMismatch = errors.New("lengths mismatch")

ErrLenMismatch signals that 2 or more slices have different lengths

View Source
var ErrLowerNonceInBlock = errors.New("lower nonce in block")

ErrLowerNonceInBlock signals that a block with lower nonce than permitted has been provided

View Source
var ErrLowerNonceInTransaction = errors.New("lower nonce in transaction")

ErrLowerNonceInTransaction signals the nonce in transaction is lower than the account's nonce

View Source
var ErrLowerRoundInBlock = errors.New("header round is lower than last committed")

ErrLowerRoundInBlock signals that a header round is too low for processing it

View Source
var ErrMarshalWithoutSuccess = errors.New("marshal without success")

ErrMarshalWithoutSuccess signals that marshal some data was not done with success

View Source
var ErrMaxBlockSizeReached = errors.New("max block size has been reached")

ErrMaxBlockSizeReached signals that max block size has been reached

View Source
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

View Source
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

View Source
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

View Source
var ErrMaxRatingIsSmallerThanMinRating = errors.New("max rating is smaller than min rating")

ErrMaxRatingIsSmallerThanMinRating signals that the max rating is smaller than the min rating value

View Source
var ErrMaxRatingZero = errors.New("max rating is zero")

ErrMaxRatingZero signals that maxrating with a value of zero has been provided

View Source
var ErrMinRatingSmallerThanOne = errors.New("min rating is smaller than one")

ErrMinRatingSmallerThanOne signals that the min rating is smaller than the min value of 1

View Source
var ErrMiniBlockHashMismatch = errors.New("miniblocks does not match")

ErrMiniBlockHashMismatch signals that miniblock hashes does not match

View Source
var ErrMiniBlockNumMissMatch = errors.New("num miniblocks does not match")

ErrMiniBlockNumMissMatch signals that number of miniblocks does not match

View Source
var ErrMiniBlocksInWrongOrder = errors.New("miniblocks in wrong order, should have been only from me")

ErrMiniBlocksInWrongOrder signals the miniblocks are in wrong order

View Source
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

View Source
var ErrMintAddressNotInThisShard = errors.New("mint address does not belong to current shard")

ErrMintAddressNotInThisShard signals that the mint address does not belong to current shard

View Source
var ErrMissingBody = errors.New("missing body")

ErrMissingBody signals that body of the block is missing

View Source
var ErrMissingHashForHeaderNonce = errors.New("missing hash for header nonce")

ErrMissingHashForHeaderNonce signals that hash of the block is missing

View Source
var ErrMissingHeader = errors.New("missing header")

ErrMissingHeader signals that header of the block is missing

View Source
var ErrMissingPreProcessor = errors.New("pre processor is missing")

ErrMissingPreProcessor signals that required pre processor is missing

View Source
var ErrMissingTransaction = errors.New("missing transaction")

ErrMissingTransaction signals that one transaction is missing

View Source
var ErrNegativeValue = errors.New("negative value")

ErrNegativeValue signals that a negative value has been detected and it is not allowed

View Source
var ErrNilAccountsAdapter = errors.New("nil AccountsAdapter")

ErrNilAccountsAdapter defines the error when trying to use a nil AccountsAddapter

View Source
var ErrNilAddressContainer = errors.New("nil AddressContainer")

ErrNilAddressContainer signals that an operation has been attempted to or with a nil AddressContainer implementation

View Source
var ErrNilAddressConverter = errors.New("nil AddressConverter")

ErrNilAddressConverter signals that an operation has been attempted to or with a nil AddressConverter implementation

View Source
var ErrNilAntifloodHandler = errors.New("nil antiflood handler")

ErrNilAntifloodHandler signals that a nil antiflood handler has been provided

View Source
var ErrNilAppStatusHandler = errors.New("nil AppStatusHandler")

ErrNilAppStatusHandler defines the error for setting a nil AppStatusHandler

View Source
var ErrNilArgumentParser = errors.New("argument parser is nil")

ErrNilArgumentParser signals that the argument parser is nil

View Source
var ErrNilArgumentStruct = errors.New("nil argument struct")

ErrNilArgumentStruct signals that a function has received nil instead of an instantiated Arg... structure

View Source
var ErrNilBadTxHandler = errors.New("nil bad tx handler")

ErrNilBadTxHandler signals that bad tx handler is nil

View Source
var ErrNilBlackListHandler = errors.New("nil black list handler")

ErrNilBlackListHandler signals that a nil black list handler was provided

View Source
var ErrNilBlockBody = errors.New("nil block body")

ErrNilBlockBody signals that an operation has been attempted to or with a nil block body

View Source
var ErrNilBlockChain = errors.New("nil block chain")

ErrNilBlockChain signals that an operation has been attempted to or with a nil blockchain

View Source
var ErrNilBlockChainHook = errors.New("nil blockchain hook")

ErrNilBlockChainHook signals that nil blockchain hook has been provided

View Source
var ErrNilBlockHeader = errors.New("nil block header")

ErrNilBlockHeader signals that an operation has been attempted to or with a nil block header

View Source
var ErrNilBlockProcessor = errors.New("nil block processor")

ErrNilBlockProcessor signals that an operation has been attempted to or with a nil BlockProcessor implementation

View Source
var ErrNilBlockSizeComputationHandler = errors.New("nil block size computation handler")

ErrNilBlockSizeComputationHandler signals that a nil block size computation handler has been provided

View Source
var ErrNilBlockSizeThrottler = errors.New("block size throttler is nil")

ErrNilBlockSizeThrottler signals that block size throttler si nil

View Source
var ErrNilBlockTracker = errors.New("nil block tracker")

ErrNilBlockTracker signals that a nil block tracker was provided

View Source
var ErrNilBootStorer = errors.New("nil boot storer")

ErrNilBootStorer signals that the provided boot storer is bil

View Source
var ErrNilBuffer = errors.New("provided byte buffer is nil")

ErrNilBuffer signals that a provided byte buffer is nil

View Source
var ErrNilBuiltInFunction = errors.New("built in function is nil")

ErrNilBuiltInFunction signals that built in function is nil

View Source
var ErrNilCacher = errors.New("nil cacher")

ErrNilCacher signals that a nil cache has been provided

View Source
var ErrNilContainerElement = errors.New("element cannot be nil")

ErrNilContainerElement signals when trying to add a nil element in the container

View Source
var ErrNilDataPoolHolder = errors.New("nil data pool holder")

ErrNilDataPoolHolder signals that the data pool holder is nil

View Source
var ErrNilDataToProcess = errors.New("nil data to process")

ErrNilDataToProcess signals that nil data was provided

View Source
var ErrNilEconomicsData = errors.New("nil economics data")

ErrNilEconomicsData signals that nil economics data has been provided

View Source
var ErrNilEconomicsFeeHandler = errors.New("nil economics fee handler")

ErrNilEconomicsFeeHandler signals that fee handler is nil

View Source
var ErrNilEpochEconomics = errors.New("nil epoch economics")

ErrNilEpochEconomics signals that nil end of epoch econimics was provided

View Source
var ErrNilEpochHandler = errors.New("nil epoch handler")

ErrNilEpochHandler signals that a nil epoch handler was provided

View Source
var ErrNilEpochStartDataCreator = errors.New("nil epoch start data creator")

ErrNilEpochStartDataCreator signals that nil epoch start data creator was provided

View Source
var ErrNilEpochStartRewardsCreator = errors.New("nil epoch start rewards creator")

ErrNilEpochStartRewardsCreator signals that nil epoch start rewards creator was provided

View Source
var ErrNilEpochStartTrigger = errors.New("nil start of epoch trigger")

ErrNilEpochStartTrigger signals that a nil start of epoch trigger was provided

View Source
var ErrNilEpochStartValidatorInfoCreator = errors.New("nil epoch start validator info creator")

ErrNilEpochStartValidatorInfoCreator signals that nil epoch start validator info creator was provided

View Source
var ErrNilForkDetector = errors.New("nil fork detector")

ErrNilForkDetector signals that the fork detector is nil

View Source
var ErrNilGasHandler = errors.New("nil gas handler")

ErrNilGasHandler signals that gas handler is nil

View Source
var ErrNilGasSchedule = errors.New("nil GasSchedule")

ErrNilGasSchedule signals that an operation has been attempted with a nil gas schedule

View Source
var ErrNilHasher = errors.New("nil Hasher")

ErrNilHasher signals that an operation has been attempted to or with a nil hasher implementation

View Source
var ErrNilHaveTimeHandler = errors.New("nil have time handler")

ErrNilHaveTimeHandler signals that a nil have time handler func was provided

View Source
var ErrNilHdrValidator = errors.New("nil header validator")

ErrNilHdrValidator signals that a nil header validator has been provided

View Source
var ErrNilHeaderHandler = errors.New("nil header handler")

ErrNilHeaderHandler signals that a nil header handler has been provided

View Source
var ErrNilHeaderSigVerifier = errors.New("nil header sig verifier")

ErrNilHeaderSigVerifier signals that a nil header sig verifier has been provided

View Source
var ErrNilHeaderValidator = errors.New("nil header validator")

ErrNilHeaderValidator signals that nil header validator has been provided

View Source
var ErrNilHeadersDataPool = errors.New("nil headers data pool")

ErrNilHeadersDataPool signals that a nil headers pool has been provided

View Source
var ErrNilHeadersNonceHashStorage = errors.New("nil headers nonce hash storage")

ErrNilHeadersNonceHashStorage signals that a nil header nonce hash storage has been provided

View Source
var ErrNilHeadersStorage = errors.New("nil headers storage")

ErrNilHeadersStorage signals that a nil header storage has been provided

View Source
var ErrNilInterceptedDataFactory = errors.New("nil intercepted data factory")

ErrNilInterceptedDataFactory signals that a nil intercepted data factory was provided

View Source
var ErrNilInterceptedDataProcessor = errors.New("nil intercepted data processor")

ErrNilInterceptedDataProcessor signals that a nil intercepted data processor was provided

View Source
var ErrNilInterceptedDataVerifier = errors.New("nil intercepted data verifier")

ErrNilInterceptedDataVerifier signals that intercepted data verifier is nil

View Source
var ErrNilInterceptorThrottler = errors.New("nil interceptor throttler")

ErrNilInterceptorThrottler signals that a nil interceptor throttler was provided

View Source
var ErrNilIntermediateProcessorContainer = errors.New("intermediate processor container is nil")

ErrNilIntermediateProcessorContainer signals that intermediate processors container is nil

View Source
var ErrNilIntermediateTransactionHandler = errors.New("intermediate transaction handler is nil")

ErrNilIntermediateTransactionHandler signals that nil intermediate transaction handler was provided

View Source
var ErrNilKeyGen = errors.New("nil key generator")

ErrNilKeyGen signals that an operation has been attempted to or with a nil single sign key generator

View Source
var ErrNilListIndexUpdaterSetter = errors.New("nil list index updater setter")

ErrNilListIndexUpdaterSetter signals that a nil list index updater has been provided

View Source
var ErrNilMarshalizer = errors.New("nil Marshalizer")

ErrNilMarshalizer signals that an operation has been attempted to or with a nil Marshalizer implementation

View Source
var ErrNilMessage = errors.New("nil message")

ErrNilMessage signals that a nil message has been received

View Source
var ErrNilMessenger = errors.New("nil Messenger")

ErrNilMessenger signals that a nil Messenger object was provided

View Source
var ErrNilMetaBlockHeader = errors.New("nil metablock header")

ErrNilMetaBlockHeader signals that an operation has been attempted to or with a nil metablock

View Source
var ErrNilMetaBlocksPool = errors.New("nil meta blocks pool")

ErrNilMetaBlocksPool signals that a nil meta blocks pool was used

View Source
var ErrNilMinChanceIfZero = errors.New("no min chance ")

ErrNilMinChanceIfZero signals that there was no min chance provided if a chance is still needed

View Source
var ErrNilMiniBlock = errors.New("nil mini block")

ErrNilMiniBlock signals that an operation has been attempted with a nil miniblock

View Source
var ErrNilMiniBlockPool = errors.New("nil mini block pool")

ErrNilMiniBlockPool signals that a nil mini blocks pool was used

View Source
var ErrNilMiniBlocks = errors.New("nil mini blocks")

ErrNilMiniBlocks signals that an operation has been attempted with a nil mini-block

View Source
var ErrNilMiniBlocksResolver = errors.New("nil miniblocks resolver")

ErrNilMiniBlocksResolver signals that a nil miniblocks resolver has been provided

View Source
var ErrNilMultiSigVerifier = errors.New("nil multi-signature verifier")

ErrNilMultiSigVerifier signals that a nil multi-signature verifier is used

View Source
var ErrNilNetworkWatcher = errors.New("nil network watcher")

ErrNilNetworkWatcher signals that a nil network watcher has been provided

View Source
var ErrNilNodesCoordinator = errors.New("nil nodes coordinator")

ErrNilNodesCoordinator signals that an operation has been attempted to or with a nil nodes coordinator

View Source
var ErrNilNodesSetup = errors.New("nil nodes setup")

ErrNilNodesSetup signals that nil nodes setup has been provided

View Source
var ErrNilPeerAccountsAdapter = errors.New("nil peer accounts database")

ErrNilPeerAccountsAdapter signals that a nil peer accounts database was provided

View Source
var ErrNilPendingMiniBlocksHandler = errors.New("nil pending miniblocks handler")

ErrNilPendingMiniBlocksHandler signals that a nil pending miniblocks handler has been provided

View Source
var ErrNilPoolsHolder = errors.New("nil pools holder")

ErrNilPoolsHolder signals that an operation has been attempted to or with a nil pools holder object

View Source
var ErrNilPreProcessor = errors.New("preprocessor is nil")

ErrNilPreProcessor signals that preprocessors is nil

View Source
var ErrNilPreProcessorsContainer = errors.New("preprocessors container is nil")

ErrNilPreProcessorsContainer signals that preprocessors container is nil

View Source
var ErrNilPrevRandSeed = errors.New("provided previous rand seed is nil")

ErrNilPrevRandSeed signals that a nil previous rand seed has been provided

View Source
var ErrNilPreviousBlockHash = errors.New("nil previous block header hash")

ErrNilPreviousBlockHash signals that a operation has been attempted with a nil previous block header hash

View Source
var ErrNilPubKeysBitmap = errors.New("nil public keys bitmap")

ErrNilPubKeysBitmap signals that a operation has been attempted with a nil public keys bitmap

View Source
var ErrNilQuotaStatusHandler = errors.New("nil quota status handler")

ErrNilQuotaStatusHandler signals that a nil quota status handler has been provided

View Source
var ErrNilRandSeed = errors.New("provided rand seed is nil")

ErrNilRandSeed signals that a nil rand seed has been provided

View Source
var ErrNilRater = errors.New("nil rater")

ErrNilRater signals that nil rater has been provided

View Source
var ErrNilRatingReaderSetter = errors.New("nil rating reader setter")

ErrNilRatingReaderSetter signals that a nil rating reader setter has been provided

View Source
var ErrNilRcvAddr = errors.New("nil receiver address")

ErrNilRcvAddr signals that an operation has been attempted to or with a nil receiver address

View Source
var ErrNilReceiptHandler = errors.New("nil receipt handler")

ErrNilReceiptHandler signals that receipt handler is nil

View Source
var ErrNilRequestHandler = errors.New("nil request handler")

ErrNilRequestHandler signals that a nil request handler interface was provided

View Source
var ErrNilRewardTransaction = errors.New("reward transaction is nil")

ErrNilRewardTransaction signals that the reward transaction is nil

View Source
var ErrNilRewardTxDataPool = errors.New("reward transactions pool is nil")

ErrNilRewardTxDataPool signals that the reward transactions pool is nil

View Source
var ErrNilRewardsHandler = errors.New("rewards handler is nil")

ErrNilRewardsHandler signals that rewards handler is nil

View Source
var ErrNilRewardsTxProcessor = errors.New("nil rewards transaction processor")

ErrNilRewardsTxProcessor signals that the rewards transaction processor is nil

View Source
var ErrNilRootHash = errors.New("root hash is nil")

ErrNilRootHash signals that an operation has been attempted with a nil root hash

View Source
var ErrNilRounder = errors.New("nil Rounder")

ErrNilRounder signals that an operation has been attempted to or with a nil Rounder implementation

View Source
var ErrNilSCDataGetter = errors.New("nil sc data getter")

ErrNilSCDataGetter signals that a nil sc data getter has been provided

View Source
var ErrNilSCDestAccount = errors.New("nil destination SC account")

ErrNilSCDestAccount signals that destination account is nil

View Source
var ErrNilSCToProtocol = errors.New("nil sc to protocol")

ErrNilSCToProtocol signals that nil smart contract to protocol handler has been provided

View Source
var ErrNilScAddress = errors.New("nil SC address")

ErrNilScAddress signals that a nil smart contract address has been provided

View Source
var ErrNilShardCoordinator = errors.New("nil shard coordinator")

ErrNilShardCoordinator signals that an operation has been attempted to or with a nil shard coordinator

View Source
var ErrNilShardedDataCacherNotifier = errors.New("nil sharded data cacher notifier")

ErrNilShardedDataCacherNotifier signals that a nil sharded data cacher notifier has been provided

View Source
var ErrNilSignature = errors.New("nil signature")

ErrNilSignature signals that a operation has been attempted with a nil signature

View Source
var ErrNilSingleSigner = errors.New("nil single signer")

ErrNilSingleSigner signals that a nil single signer is used

View Source
var ErrNilSmartContractProcessor = errors.New("smart contract processor is nil")

ErrNilSmartContractProcessor signals that smart contract call executor is nil

View Source
var ErrNilSmartContractResult = errors.New("smart contract result is nil")

ErrNilSmartContractResult signals that the smart contract result is nil

View Source
var ErrNilSmartContractResultProcessor = errors.New("nil smart contract result processor")

ErrNilSmartContractResultProcessor signals that smart contract result processor is nil

View Source
var ErrNilSndAddr = errors.New("nil sender address")

ErrNilSndAddr signals that an operation has been attempted to or with a nil sender address

View Source
var ErrNilStorage = errors.New("nil storage")

ErrNilStorage signals that a nil storage has been provided

View Source
var ErrNilStore = errors.New("nil data storage service")

ErrNilStore signals that the provided storage service is nil

View Source
var ErrNilTemporaryAccountsHandler = errors.New("temporary accounts handler is nil")

ErrNilTemporaryAccountsHandler signals that temporary accounts handler is nil

View Source
var ErrNilTransaction = errors.New("nil transaction")

ErrNilTransaction signals that an operation has been attempted to or with a nil transaction

View Source
var ErrNilTransactionCoordinator = errors.New("transaction coordinator is nil")

ErrNilTransactionCoordinator signals that transaction coordinator is nil

View Source
var ErrNilTransactionPool = errors.New("nil transaction pool")

ErrNilTransactionPool signals that a nil transaction pool was used

View Source
var ErrNilTxBlockBody = errors.New("nil tx block body")

ErrNilTxBlockBody signals that an operation has been attempted to or with a nil tx block body

View Source
var ErrNilTxDataPool = errors.New("nil transaction data pool")

ErrNilTxDataPool signals that a nil transaction pool has been provided

View Source
var ErrNilTxForCurrentBlockHandler = errors.New("nil tx for current block handler")

ErrNilTxForCurrentBlockHandler signals that nil tx for current block handler has been provided

View Source
var ErrNilTxHash = errors.New("nil transaction hash")

ErrNilTxHash signals that an operation has been attempted with a nil hash

View Source
var ErrNilTxProcessor = errors.New("nil transactions processor")

ErrNilTxProcessor signals that a nil transactions processor was used

View Source
var ErrNilTxStorage = errors.New("nil transaction storage")

ErrNilTxStorage signals that a nil transaction storage has been provided

View Source
var ErrNilTxTypeHandler = errors.New("nil tx type handler")

ErrNilTxTypeHandler signals that tx type handler is nil

View Source
var ErrNilTxValidator = errors.New("nil transaction validator")

ErrNilTxValidator signals that a nil tx validator has been provided

View Source
var ErrNilTxsPoolsCleaner = errors.New("nil transactions pools cleaner")

ErrNilTxsPoolsCleaner signals that a nil transactions pools cleaner has been provided

View Source
var ErrNilUTxDataPool = errors.New("unsigned transactions pool is nil")

ErrNilUTxDataPool signals that unsigned transaction pool is nil

View Source
var ErrNilUTxStorage = errors.New("unsigned transactions storage is nil")

ErrNilUTxStorage signals that unsigned transaction storage is nil

View Source
var ErrNilUint64Converter = errors.New("unit64converter is nil")

ErrNilUint64Converter signals that uint64converter is nil

View Source
var ErrNilUnsignedTxDataPool = errors.New("unsigned transactions pool is nil")

ErrNilUnsignedTxDataPool signals that the unsigned transactions pool is nil

View Source
var ErrNilUnsignedTxHandler = errors.New("nil unsigned tx handler")

ErrNilUnsignedTxHandler signals that the unsigned tx handler is nil

View Source
var ErrNilVMOutput = errors.New("nil vm output")

ErrNilVMOutput signals that vmoutput is nil

View Source
var ErrNilValidatorInfos = errors.New("nil validator infos")

ErrNilValidatorInfos signals that a nil validator infos has been provided

View Source
var ErrNilValidatorStatistics = errors.New("nil validator statistics")

ErrNilValidatorStatistics signals that a nil validator statistics has been provided

View Source
var ErrNilValidityAttester = errors.New("nil validity attester")

ErrNilValidityAttester signals that a nil validity attester has been provided

View Source
var ErrNilValue = errors.New("nil value")

ErrNilValue signals the value is nil

View Source
var ErrNilValueFromRewardTransaction = errors.New("transferred value is nil in reward transaction")

ErrNilValueFromRewardTransaction signals that the transfered value is nil

View Source
var ErrNilWhiteListHandler = errors.New("nil whitelist handler")

ErrNilWhiteListHandler signals that white list handler is nil

View Source
var ErrNoChancesForMaxThreshold = errors.New("max threshold has no chances")

ErrNoChancesForMaxThreshold signals that the max threshold has no chance defined

View Source
var ErrNoChancesProvided = errors.New("no chances are provided")

ErrNoChancesProvided signals that there were no chances provided

View Source
var ErrNoDataInMessage = errors.New("no data found in received message")

ErrNoDataInMessage signals that no data was found after parsing received p2p message

View Source
var ErrNoVM = errors.New("no VM (hook not set)")

ErrNoVM signals that no SCHandler has been set

View Source
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

View Source
var ErrNotEnoughGas = errors.New("not enough gas was sent in the transaction")

ErrNotEnoughGas signals that not enough gas has been provided

View Source
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

View Source
var ErrNotEpochStartBlock = errors.New("not epoch start block")

ErrNotEpochStartBlock signals that block is not of type epoch start

View Source
var ErrNotarizedHeadersSliceForShardIsNil = errors.New("notarized headers slice for shard is nil")

ErrNotarizedHeadersSliceForShardIsNil signals that the slice holding notarized headers for shard is nil

View Source
var ErrNotarizedHeadersSliceIsNil = errors.New("notarized headers slice is nil")

ErrNotarizedHeadersSliceIsNil signals that the slice holding notarized headers is nil

View Source
var ErrOperationNotPermitted = errors.New("operation in account not permitted")

ErrOperationNotPermitted signals that operation is not permitted

View Source
var ErrOverallBalanceChangeFromSC = errors.New("SC output balance updates are wrong")

ErrOverallBalanceChangeFromSC signals that all sumed balance changes are not zero

View Source
var ErrRandSeedDoesNotMatch = errors.New("random seed do not match")

ErrRandSeedDoesNotMatch signals that random seed does not match with the previous one

View Source
var ErrReceiptsHashMissmatch = errors.New("receipts hash missmatch")

ErrReceiptsHashMissmatch signals that overall receipts has does not match

View Source
var ErrRewardMiniBlockNotFromMeta = errors.New("rewards miniblocks should come only from meta")

ErrRewardMiniBlockNotFromMeta signals that miniblock has a different sender shard than meta

View Source
var ErrRootStateDoesNotMatch = errors.New("root state does not match")

ErrRootStateDoesNotMatch signals that root state does not match

View Source
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

View Source
var ErrShardIdMissmatch = errors.New("shard ID missmatch")

ErrShardIdMissmatch signals shard ID does not match expectations

View Source
var ErrSignedBlocksThresholdNotBetweenZeroAndOne = errors.New("signed blocks threshold is not between 0 and 1")

ErrSignedBlocksThresholdNotBetweenZeroAndOne signals that the signed blocks threshold is not between 0 and 1

View Source
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

View Source
var ErrSystemBusy = errors.New("system busy")

ErrSystemBusy signals that the system is busy

View Source
var ErrTimeIsOut = errors.New("time is out")

ErrTimeIsOut signals that time is out

View Source
var ErrTooManyReceiptsMiniBlocks = errors.New("too many receipts miniblocks")

ErrTooManyReceiptsMiniBlocks signals that there were too many receipts miniblocks created

View Source
var ErrTxNotFound = errors.New("transaction not found")

ErrTxNotFound signals that a transaction has not found

View Source
var ErrUnknownBlockType = errors.New("block type is unknown")

ErrUnknownBlockType signals that block type is not correct

View Source
var ErrUnmarshalWithoutSuccess = errors.New("unmarshal without success")

ErrUnmarshalWithoutSuccess signals that unmarshal some data was not done with success

View Source
var ErrVMTypeLengthInvalid = errors.New("vm type length is too long")

ErrVMTypeLengthInvalid signals that vm type length is too long

View Source
var ErrValidatorInfoMiniBlockNotFromMeta = errors.New("validatorInfo miniblocks should come only from meta")

ErrValidatorInfoMiniBlockNotFromMeta signals that miniblock has a different sender shard than meta

View Source
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

View Source
var ErrWrongNonceInBlock = errors.New("wrong nonce in block")

ErrWrongNonceInBlock signals the nonce in block is different than expected nonce

View Source
var ErrWrongNonceInVMOutput = errors.New("nonce invalid from SC run")

ErrWrongNonceInVMOutput signals that nonce in vm output is wrong

View Source
var ErrWrongTransaction = errors.New("invalid transaction")

ErrWrongTransaction signals that transaction is invalid

View Source
var ErrWrongTypeAssertion = errors.New("wrong type assertion")

ErrWrongTypeAssertion signals that an type assertion failed

View Source
var ErrWrongTypeInContainer = errors.New("wrong type of object inside container")

ErrWrongTypeInContainer signals that a wrong type of object was found in container

View Source
var ErrWrongTypeInMiniBlock = errors.New("type in miniblock is not correct for processing")

ErrWrongTypeInMiniBlock signals that type is not correct for processing

View Source
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

View Source
var ErrZeroMaxComputableRounds = errors.New("max computable rounds is zero")

ErrZeroMaxComputableRounds signals that a value of zero was provided on the maxComputableRounds

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 DisplayProcessTxDetails

func DisplayProcessTxDetails(
	message string,
	accountHandler state.AccountHandler,
	txHandler data.TransactionHandler,
)

DisplayProcessTxDetails displays information related to the tx which should be executed

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

func IsInProperRound(index int64) bool

IsInProperRound checks if the given round index satisfies the round modulus trigger

func IsShardCacherIdentifierIntraShard

func IsShardCacherIdentifierIntraShard(cacheID string, shardID uint32) bool

IsShardCacherIdentifierIntraShard checks whether the specified cache is for the pair (sender = self, destination = self)

func ParseShardCacherIdentifier

func ParseShardCacherIdentifier(cacheID string) (uint32, uint32, error)

ParseShardCacherIdentifier parses an identifier into its components: sender shard, destination shard

func ShardCacherIdentifier

func ShardCacherIdentifier(senderShardID uint32, destinationShardID uint32) string

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(header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
	CommitBlock(header data.HeaderHandler, body data.BodyHandler) error
	RevertAccountState(header data.HeaderHandler)
	PruneStateOnRollback(currHeader data.HeaderHandler, prevHeader data.HeaderHandler)
	RevertStateToBlock(header data.HeaderHandler) error
	CreateNewHeader(round uint64, nonce uint64) data.HeaderHandler
	RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
	CreateBlock(initialHdr data.HeaderHandler, haveTime func() bool) (data.HeaderHandler, 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 {
	GetCurrentMaxSize() uint32
	Add(round uint64, size uint32)
	Succeed(round uint64)
	ComputeCurrentMaxSize()
	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)
	CheckBlockAgainstFinal(headerHandler data.HeaderHandler) error
	CheckBlockAgainstRounder(headerHandler data.HeaderHandler) error
	CleanupHeadersBehindNonce(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64)
	CleanupInvalidCrossHeaders(metaNewEpoch uint32, metaRoundAttestingEpoch 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)
	GetFinalHeader(shardID uint32) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeader(shardID uint32) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeadersForAllShards() (map[uint32]data.HeaderHandler, error)
	GetLastSelfNotarizedHeader(shardID uint32) (data.HeaderHandler, []byte, error)
	GetNumPendingMiniBlocks(shardID uint32) uint32
	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()
	ShouldAddHeader(headerHandler data.HeaderHandler) bool
	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))
	GetNodeState() core.NodeState
	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 BuiltinFunction

type BuiltinFunction interface {
	ProcessBuiltinFunction(
		tx data.TransactionHandler,
		acntSnd, acntDst state.UserAccountHandler,
		vmInput *vmcommon.ContractCallInput,
	) (*big.Int, error)
	GasUsed() uint64
	IsInterfaceNil() bool
}

BuiltinFunction defines the methods for the built-in protocol smart contract functions

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 DataMarshalizer

type DataMarshalizer interface {
	CreateMarshalizedData(txHashes [][]byte) ([][]byte, error)
}

DataMarshalizer defines the behavior of a structure that is able to marshalize containing data

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 EndOfEpochEconomics

type EndOfEpochEconomics interface {
	ComputeEndOfEpochEconomics(metaBlock *block.MetaBlock) (*block.Economics, error)
	VerifyRewardsPerBlock(metaBlock *block.MetaBlock) error
	IsInterfaceNil() bool
}

EndOfEpochEconomics defines the functionality that is needed to compute end of epoch economics data

type EpochBootstrapper

type EpochBootstrapper interface {
	SetCurrentEpochStartRound(round uint64)
	IsInterfaceNil() bool
}

EpochBootstrapper defines the actions needed by bootstrapper

type EpochStartDataCreator

type EpochStartDataCreator interface {
	CreateEpochStartData() (*block.EpochStart, error)
	VerifyEpochStartDataForMetablock(metaBlock *block.MetaBlock) error
	IsInterfaceNil() bool
}

EpochStartDataCreator defines the functionality for node to create epoch start data

type EpochStartRewardsCreator

type EpochStartRewardsCreator interface {
	CreateRewardsMiniBlocks(metaBlock *block.MetaBlock, validatorsInfo map[uint32][]*state.ValidatorInfo) (block.MiniBlockSlice, error)
	VerifyRewardsMiniBlocks(metaBlock *block.MetaBlock, validatorsInfo map[uint32][]*state.ValidatorInfo) error
	CreateMarshalizedData(body *block.Body) map[string][][]byte
	GetRewardsTxs(body *block.Body) map[string]data.TransactionHandler
	SaveTxBlockToStorage(metaBlock *block.MetaBlock, body *block.Body)
	DeleteTxsFromStorage(metaBlock *block.MetaBlock, body *block.Body)
	RemoveBlockDataFromPools(metaBlock *block.MetaBlock, body *block.Body)
	IsInterfaceNil() bool
}

EpochStartRewardsCreator defines the functionality for the metachain to create rewards at end of epoch

type EpochStartTriggerHandler

type EpochStartTriggerHandler interface {
	Update(round uint64, nonce uint64)
	IsEpochStart() bool
	Epoch() uint32
	EpochStartRound() uint64
	SetProcessed(header data.HeaderHandler, body data.BodyHandler)
	RevertStateToBlock(header data.HeaderHandler) error
	EpochStartMetaHdrHash() []byte
	GetSavedStateKey() []byte
	LoadState(key []byte) error
	IsInterfaceNil() bool
	SetFinalityAttestingRound(round uint64)
	EpochFinalityAttestingRound() uint64
	RequestEpochStartIfNeeded(interceptedHeader data.HeaderHandler)
}

EpochStartTriggerHandler defines that actions which are needed by processor for start of epoch

type EpochStartValidatorInfoCreator

type EpochStartValidatorInfoCreator interface {
	CreateValidatorInfoMiniBlocks(validatorInfo map[uint32][]*state.ValidatorInfo) (block.MiniBlockSlice, error)
	VerifyValidatorInfoMiniBlocks(miniblocks []*block.MiniBlock, validatorsInfo map[uint32][]*state.ValidatorInfo) error
	SaveValidatorInfoBlocksToStorage(metaBlock *block.MetaBlock, body *block.Body)
	DeleteValidatorInfoBlocksFromStorage(metaBlock *block.MetaBlock)
	RemoveBlockDataFromPools(metaBlock *block.MetaBlock, body *block.Body)
	IsInterfaceNil() bool
}

EpochStartValidatorInfoCreator defines the functionality for the metachain to create validator statistics at end of epoch

type FeeHandler

type FeeHandler interface {
	DeveloperPercentage() float64
	MaxGasLimitPerBlock() uint64
	ComputeGasLimit(tx TransactionWithFeeHandler) uint64
	ComputeFee(tx TransactionWithFeeHandler) *big.Int
	CheckValidityTxValues(tx TransactionWithFeeHandler) error
	MinGasPrice() uint64
	IsInterfaceNil() bool
}

FeeHandler is able to perform some economics calculation on a provided transaction

type FloodPreventer

type FloodPreventer interface {
	AccumulateGlobal(identifier string, size uint64) bool
	Accumulate(identifier string, size uint64) bool
	Reset()
	IsInterfaceNil() bool
}

FloodPreventer defines the behavior of a component that is able to signal that too many events occurred on a provided identifier between Reset calls

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
	ResetProbableHighestNonce()
	IsInterfaceNil() bool
}

ForkDetector is an interface that defines the behaviour of a struct that is able to detect forks

type ForkInfo

type ForkInfo struct {
	IsDetected bool
	Nonce      uint64
	Round      uint64
	Hash       []byte
}

ForkInfo hold the data related to a detected fork

func NewForkInfo

func NewForkInfo() *ForkInfo

NewForkInfo creates a new ForkInfo object

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

type HashAccesser interface {
	SetHash([]byte)
	Hash() []byte
}

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
	Type() string
	String() string
}

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, fromConnectedPeer p2p.PeerID) 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, fromConnectedPeer p2p.PeerID) error
	Save(data InterceptedData, fromConnectedPeer p2p.PeerID) 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 monitor the number of the currently running interceptor go routines

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
	Iterate(handler func(key string, interceptor Interceptor) bool)
	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() []*block.MiniBlock
	VerifyInterMiniBlocks(body *block.Body) error
	SaveCurrentIntermediateTxToStorage() error
	GetAllCurrentFinishedTxs() map[string]data.TransactionHandler
	CreateBlockStarted()
	GetCreatedInShardMiniBlock() *block.MiniBlock
	RemoveProcessedResultsFor(txHashes [][]byte)
	IsInterfaceNil() bool
}

IntermediateTransactionHandler handles transactions which are not resolved in only one step

type MiniBlocksResolver

type MiniBlocksResolver interface {
	GetMiniBlocks(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
	GetMiniBlocksFromPool(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
	IsInterfaceNil() bool
}

MiniBlocksResolver defines what a mini blocks resolver should do

type NetworkConnectionWatcher

type NetworkConnectionWatcher interface {
	IsConnectedToTheNetwork() bool
	IsInterfaceNil() bool
}

NetworkConnectionWatcher defines a watchdog functionality used to specify if the current node is still connected to the rest of the network

type P2PAntifloodHandler

type P2PAntifloodHandler interface {
	CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer p2p.PeerID) error
	CanProcessMessageOnTopic(peer p2p.PeerID, topic string) error
	IsInterfaceNil() bool
}

P2PAntifloodHandler defines the behavior of a component able to signal that the system is too busy (or flooded) processing p2p messages

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 {
	AddProcessedHeader(handler data.HeaderHandler) error
	RevertHeader(handler data.HeaderHandler) error
	GetPendingMiniBlocks(shardID uint32) [][]byte
	SetPendingMiniBlocks(shardID uint32, mbHashes [][]byte)
	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

	RequestTransactionsForMiniBlock(miniBlock *block.MiniBlock) int
	ProcessMiniBlock(miniBlock *block.MiniBlock, haveTime func() bool) ([][]byte, error)
	CreateAndProcessMiniBlocks(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 RatingChanceHandler added in v0.0.5

type RatingChanceHandler interface {
	//GetMaxThreshold returns the threshold until this ChancePercentage holds
	GetMaxThreshold() uint32
	//GetChancePercentage returns the percentage for the RatingChanceHandler
	GetChancePercentage() uint32
	//IsInterfaceNil verifies if the interface is nil
	IsInterfaceNil() bool
}

RatingChanceHandler provides the methods needed for the computation of chances from the Rating

type RatingsInfoHandler added in v0.0.5

type RatingsInfoHandler interface {
	StartRating() uint32
	MaxRating() uint32
	MinRating() uint32
	SignedBlocksThreshold() float32
	MetaChainRatingsStepHandler() RatingsStepHandler
	ShardChainRatingsStepHandler() RatingsStepHandler
	SelectionChances() []SelectionChance
}

RatingsInfoHandler defines the information needed for the rating computation

type RatingsStepHandler added in v0.0.5

type RatingsStepHandler interface {
	ProposerIncreaseRatingStep() int32
	ProposerDecreaseRatingStep() int32
	ValidatorIncreaseRatingStep() int32
	ValidatorDecreaseRatingStep() int32
	ConsecutiveMissedBlocksPenalty() float32
}

RatingsStepHandler defines the information needed for the rating computation on shards or meta

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 {
	SetEpoch(epoch uint32)
	RequestShardHeader(shardID uint32, hash []byte)
	RequestMetaHeader(hash []byte)
	RequestMetaHeaderByNonce(nonce uint64)
	RequestShardHeaderByNonce(shardID uint32, nonce uint64)
	RequestTransaction(destShardID uint32, txHashes [][]byte)
	RequestUnsignedTransactions(destShardID uint32, scrHashes [][]byte)
	RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
	RequestMiniBlock(destShardID uint32, miniblockHash []byte)
	RequestMiniBlocks(destShardID uint32, miniblocksHashes [][]byte)
	RequestTrieNodes(destShardID uint32, hash []byte, topic string)
	RequestStartOfEpochMetaBlock(epoch uint32)
	RequestInterval() time.Duration
	SetNumPeersToQuery(key string, intra int, cross int) error
	GetNumPeersToQuery(key string) (int, int, error)
	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 {
	LeaderPercentage() float64
	MinInflationRate() float64
	MaxInflationRate() float64
	IsInterfaceNil() bool
}

RewardsHandler will return information about rewards

type RoundTimeDurationHandler

type RoundTimeDurationHandler interface {
	TimeDuration() time.Duration
	IsInterfaceNil() bool
}

RoundTimeDurationHandler defines the methods to get the time duration of a round

type Rounder

type Rounder interface {
	Index() int64
	IsInterfaceNil() bool
}

Rounder defines the actions which should be handled by a round implementation

type SCQuery

type SCQuery struct {
	ScAddress []byte
	FuncName  string
	Arguments [][]byte
}

SCQuery represents a prepared query for executing a function of the smart contract

type SCQueryService

type SCQueryService interface {
	ExecuteQuery(query *SCQuery) (*vmcommon.VMOutput, error)
	IsInterfaceNil() bool
}

SCQueryService defines how data should be get from a SC account

type SelectionChance

type SelectionChance interface {
	GetMaxThreshold() uint32
	GetChancePercent() uint32
}

SelectionChance defines the actions which should be handled by a round implementation

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.UserAccountHandler) error
	DeploySmartContract(tx data.TransactionHandler, acntSrc state.UserAccountHandler) error
	ProcessIfError(acntSnd state.UserAccountHandler, txHash []byte, tx data.TransactionHandler, returnCode string) 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 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 TopicFloodPreventer

type TopicFloodPreventer interface {
	Accumulate(identifier string, topic string) bool
	ResetForTopic(topic string)
	SetMaxMessagesForTopic(topic string, maxNum uint32)
	IsInterfaceNil() bool
}

TopicFloodPreventer defines the behavior of a component that is able to signal that too many events occurred on a provided identifier between Reset calls, on a given topic

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{},

		haveTime func() bool,
	) (block.MiniBlockSlice, uint32, bool, error)
	CreateMbsAndProcessTransactionsFromMe(haveTime func() bool) block.MiniBlockSlice

	CreateMarshalizedData(body *block.Body) 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

type TransactionFeeHandler interface {
	CreateBlockStarted()
	GetAccumulatedFees() *big.Int
	ProcessTransactionFee(cost *big.Int, txHash []byte)
	RevertFees(txHashes [][]byte)
	IsInterfaceNil() bool
}

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
	GetRcvAddr() []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
	ReceiverShardId() uint32
	Nonce() uint64
	SenderAddress() state.AddressContainer
	Fee() *big.Int
}

TxValidatorHandler defines the functionality that is needed for a TxValidator to validate a transaction

type ValidatorInfoSyncer added in v1.0.102

type ValidatorInfoSyncer interface {
	SyncMiniBlocks(metaBlock *block.MetaBlock) ([][]byte, data.BodyHandler, error)
	IsInterfaceNil() bool
}

ValidatorInfoSyncer defines the method needed for validatorInfoProcessing

type ValidatorSettingsHandler

type ValidatorSettingsHandler interface {
	UnBondPeriod() uint64
	GenesisNodePrice() *big.Int
	IsInterfaceNil() bool
}

ValidatorSettingsHandler defines the functionality which is needed for validators' settings

type ValidatorStatisticsProcessor

type ValidatorStatisticsProcessor interface {
	UpdatePeerState(header data.HeaderHandler, cache map[string]data.HeaderHandler) ([]byte, error)
	RevertPeerState(header data.HeaderHandler) error
	GetPeerAccount(address []byte) (state.PeerAccountHandler, error)
	Process(shardValidatorInfo data.ShardValidatorInfoHandler) error
	IsInterfaceNil() bool
	RootHash() ([]byte, error)
	ResetValidatorStatisticsAtNewEpoch(vInfos map[uint32][]*state.ValidatorInfo) error
	GetValidatorInfoForRootHash(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)
	ProcessRatingsEndOfEpoch(validatorInfos map[uint32][]*state.ValidatorInfo) error
	Commit() ([]byte, error)
}

ValidatorStatisticsProcessor is the main interface for validators' consensus participation statistics

type ValidatorsProvider added in v0.0.5

type ValidatorsProvider interface {
	GetLatestValidators() map[string]*state.ValidatorApiResponse
	IsInterfaceNil() bool
}

ValidatorsProvider is the main interface for validators' provider

type ValidityAttester

type ValidityAttester interface {
	CheckBlockAgainstFinal(headerHandler data.HeaderHandler) error
	CheckBlockAgainstRounder(headerHandler data.HeaderHandler) error
	IsInterfaceNil() bool
}

ValidityAttester is able to manage the valid blocks

type VirtualMachinesContainer

type VirtualMachinesContainer interface {
	Close() error
	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

type WhiteListHandler added in v1.0.102

type WhiteListHandler interface {
	Remove(keys [][]byte)
	Add(keys [][]byte)
	IsWhiteListed(interceptedData InterceptedData) bool
	IsInterfaceNil() bool
}

WhiteListHandler is the interface needed to add whitelisted data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL