update

package
v1.3.51 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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 ErrEmptyChainID = errors.New("empty chain ID")

ErrEmptyChainID signals that empty chain ID was provided

View Source
var ErrEmptyExportFolderPath = errors.New("empty export folder path")

ErrEmptyExportFolderPath signals that the provided export folder's length is empty

View Source
var ErrEmptyVersionString = errors.New("empty version string")

ErrEmptyVersionString signals that the provided version string is empty

View Source
var ErrExpectedOneStartOfEpochMetaBlock = errors.New("expected one start of epoch metaBlock")

ErrExpectedOneStartOfEpochMetaBlock signals that exactly one start of epoch metaBlock should have been used

View Source
var ErrImportingData = errors.New("error importing data")

ErrImportingData signals that an import error occurred

View Source
var ErrIncorrectHardforkMessage = errors.New("incorrect hardfork message")

ErrIncorrectHardforkMessage signals that the hardfork message is incorrectly formatted

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 ErrInvalidEpoch = errors.New("invalid epoch")

ErrInvalidEpoch signals that an invalid epoch has been provided

View Source
var ErrInvalidFolderName = errors.New("invalid folder name")

ErrInvalidFolderName signals that folder name is nil

View Source
var ErrInvalidMaxHardCapForMissingNodes = errors.New("invalid max hardcap for missing nodes")

ErrInvalidMaxHardCapForMissingNodes signals that the maximum hardcap value for missing nodes is invalid

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

ErrInvalidMiniBlockType signals that an invalid miniBlock type has been provided

View Source
var ErrInvalidNumConcurrentTrieSyncers = errors.New("invalid num concurrent trie syncers")

ErrInvalidNumConcurrentTrieSyncers signals that the number of concurrent trie syncers is invalid

View Source
var ErrInvalidTimeToWaitAfterHardfork = errors.New("invalid time to wait after hard fork")

ErrInvalidTimeToWaitAfterHardfork signals that an invalid time to wait after hardfork was provided

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

ErrInvalidValue signals that the value provided is invalid

View Source
var ErrKeyTypeMismatch = errors.New("key type mismatch while importing")

ErrKeyTypeMismatch signals that key type was mismatch during import

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

ErrLenMismatch signals that 2 or more slices have different lengths

View Source
var ErrMiniBlockNotFoundInImportedMap = errors.New("miniBlock was not found in imported map")

ErrMiniBlockNotFoundInImportedMap signals that the given miniBlock was not found in imported map

View Source
var ErrNilAccounts = errors.New("nil accounts")

ErrNilAccounts signals that nil accounts was provided

View Source
var ErrNilAccountsDBSyncContainer = errors.New("nil accounts db sync container")

ErrNilAccountsDBSyncContainer signals that nil accounts sync container was provided

View Source
var ErrNilAntiFloodHandler = errors.New("nil anti flood handler")

ErrNilAntiFloodHandler signals that nil anti flood handler has been provided

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

ErrNilArgumentParser signals that nil argument parser was provided

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

ErrNilBlockBody signals that a nil block body has been provided

View Source
var ErrNilBlockKeyGen = errors.New("nil block key gen")

ErrNilBlockKeyGen signals that nil block key gen was provided

View Source
var ErrNilBlockSigner = errors.New("nil block signer")

ErrNilBlockSigner signals the nil block signer was provided

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

ErrNilCacher signals that nil cacher was provided

View Source
var ErrNilChanStopNodeProcess = errors.New("nil channel to stop node")

ErrNilChanStopNodeProcess signals that nil channel to stop node was provided

View Source
var ErrNilCloser = errors.New("nil closer instance")

ErrNilCloser signals that a nil closer instance was 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 ErrNilCoreComponents = errors.New("nil core components")

ErrNilCoreComponents signals that an operation has been attempted with nil core components

View Source
var ErrNilCryptoComponents = errors.New("nil crypto components")

ErrNilCryptoComponents signals that an operation has been attempted with nil crypto components

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

ErrNilDataPoolHolder signals that the data pool holder is nil

View Source
var ErrNilEpochConfirmedNotifier = errors.New("nil epoch confirmed notifier")

ErrNilEpochConfirmedNotifier signals that nil epoch confirmed notifier was provided

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

ErrNilEpochHandler signals that nil epoch handler was provided

View Source
var ErrNilEpochNotifier = errors.New("nil EpochNotifier")

ErrNilEpochNotifier signals that the provided EpochNotifier is nil

View Source
var ErrNilEpochStartMetaBlock = errors.New("nil epoch start metaBlock was provided")

ErrNilEpochStartMetaBlock signals that a nil epoch start metaBlock was provided

View Source
var ErrNilExportFactoryHandler = errors.New("nil export factory handler")

ErrNilExportFactoryHandler signals that nil export factory handler has been provided

View Source
var ErrNilGenesisNodesSetupHandler = errors.New("nil genesis nodes setup handler")

ErrNilGenesisNodesSetupHandler signals that a nil genesis nodes setup handler has been provided

View Source
var ErrNilHardForkBlockProcessor = errors.New("nil hard fork block processor")

ErrNilHardForkBlockProcessor signals that nil hard fork block processor has been provided

View Source
var ErrNilHardforkStorer = errors.New("nil hardfork storer")

ErrNilHardforkStorer signals that a nil hardfork storer has been provided

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 ErrNilHeaderHandler = errors.New("nil header handler")

ErrNilHeaderHandler signals that a nil header handler has been provided

View Source
var ErrNilHeaderIntegrityVerifier = errors.New("nil header integrity verifier")

ErrNilHeaderIntegrityVerifier signals that nil header integrity verifier was provided

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

ErrNilHeaderSigVerifier signals that nil header sig verifier was provided

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

ErrNilHeaderSyncHandler signals that nil header sync handler was provided

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

ErrNilHeaderValidator signals that nil header validator has been provided

View Source
var ErrNilImportHandler = errors.New("nil import handler")

ErrNilImportHandler signals that nil import handler has been provided

View Source
var ErrNilImportStartHandler = errors.New("nil import start handler")

ErrNilImportStartHandler signals that a nil import start handler has been provided

View Source
var ErrNilInterceptorsContainer = errors.New("nil interceptors container")

ErrNilInterceptorsContainer signals that a nil interceptors container has been provided

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

ErrNilKeyGenerator signals that nil key generator was 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 ErrNilMessenger = errors.New("nil Messenger")

ErrNilMessenger signals that a nil Messenger object was provided

View Source
var ErrNilMiniBlocksSyncHandler = errors.New("nil miniblocks sync handler")

ErrNilMiniBlocksSyncHandler signals that nil miniblocks sync handler was provided

View Source
var ErrNilMultiSigner = errors.New("nil multi signer")

ErrNilMultiSigner signals that nil multi signer was provided

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

ErrNilNodesCoordinator signals that nil nodes coordinator was provided

View Source
var ErrNilPeersRatingHandler = errors.New("nil peers rating handler")

ErrNilPeersRatingHandler signals that a nil peers rating handler implementation has been provided

View Source
var ErrNilPendingTxProcessor = errors.New("nil pending tx processor")

ErrNilPendingTxProcessor signals that nil pending tx processor has been provided

View Source
var ErrNilPubKeyConverter = errors.New("nil public key converter")

ErrNilPubKeyConverter signals that a nil public key converter was provided

View Source
var ErrNilReceiptsRepository = errors.New("nil receipts repository")

ErrNilReceiptsRepository signals that nil receipts repository has been provided

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

ErrNilRequestHandler signals that a nil request handler interface was provided

View Source
var ErrNilResolverContainer = errors.New("nil resolver container")

ErrNilResolverContainer signals that a nil resolver container was provided

View Source
var ErrNilRoundHandler = errors.New("nil round handler")

ErrNilRoundHandler signals that nil round handler has been provided

View Source
var ErrNilRwdTxProcessor = errors.New("nil reward transaction processor")

ErrNilRwdTxProcessor signals that nil reward transaction processor has been provided

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

ErrNilSCRProcessor signals that nil smart contract result processor 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 ErrNilSingleSigner = errors.New("nil single signer")

ErrNilSingleSigner signals that nil single signer was provided

View Source
var ErrNilStateSyncer = errors.New("nil state syncer")

ErrNilStateSyncer signals that state syncer is nil

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

ErrNilStorage signals that storage is nil

View Source
var ErrNilStorageManager = errors.New("nil trie storage manager")

ErrNilStorageManager signals that nil storage manager has been provided

View Source
var ErrNilTimeCache = errors.New("nil time cache")

ErrNilTimeCache signals that a nil time cache was provided

View Source
var ErrNilTransactionsSyncHandler = errors.New("nil transaction sync handler")

ErrNilTransactionsSyncHandler signals that nil transactions sync handler was provided

View Source
var ErrNilTrieDataGetter = errors.New("nil trie data getter provided")

ErrNilTrieDataGetter signals that a nil trie data getter has been provided

View Source
var ErrNilTrieStorageManagers = errors.New("nil trie storage managers")

ErrNilTrieStorageManagers signals that nil trie storage managers has been provided

View Source
var ErrNilTrieSyncers = errors.New("nil trie syncers")

ErrNilTrieSyncers signals that trie syncers container is nil

View Source
var ErrNilTxCoordinator = errors.New("nil tx coordinator")

ErrNilTxCoordinator signals that nil tx coordinator has been provided

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

ErrNilTxProcessor signals that nil transaction processor has been provided

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

ErrNilUint64Converter signals that uint64converter is nil

View Source
var ErrNilUnFinishedMetaBlocksMap = errors.New("nil unFinished metaBlocks map was provided")

ErrNilUnFinishedMetaBlocksMap signals that a nil unFinished metaBlocks map was provided

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

ErrNilValidityAttester signals that nil validity was provided

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

ErrNilWhiteListHandler signals that white list handler is nil

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

ErrNotEpochStartBlock signals that block is not of type epoch start

View Source
var ErrNotSynced = errors.New("not synced")

ErrNotSynced signals that syncing has not been finished yet

View Source
var ErrPostProcessTransactionNotFound = errors.New("transaction was not found in post process map")

ErrPostProcessTransactionNotFound signals that the given transaction was not found in post process map

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

ErrTimeIsOut signals that time is out

View Source
var ErrTransactionNotFoundInImportedMap = errors.New("transaction was not found in imported map")

ErrTransactionNotFoundInImportedMap signals that the given transaction was not found in imported map

View Source
var ErrTriggerAlreadyInAction = errors.New("trigger already in action")

ErrTriggerAlreadyInAction signals that the trigger is already in action, can not re-enter

View Source
var ErrTriggerNotEnabled = errors.New("trigger is not enabled")

ErrTriggerNotEnabled signals that the trigger is not enabled

View Source
var ErrTriggerPubKeyMismatch = errors.New("trigger public key mismatch")

ErrTriggerPubKeyMismatch signals that there is a mismatch between the public key received and the one read from the config

View Source
var ErrUnknownType = errors.New("unknown type")

ErrUnknownType signals that type is unknown

View Source
var ErrWrongImportedMiniBlocksMap = errors.New("wrong imported miniBlocks map was provided")

ErrWrongImportedMiniBlocksMap signals that wrong imported miniBlocks map was provided

View Source
var ErrWrongImportedTransactionsMap = errors.New("wrong imported transactions map was provided")

ErrWrongImportedTransactionsMap signals that wrong imported transactions map was provided

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

ErrWrongTypeAssertion signals wrong type assertion

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 ErrWrongUnFinishedMetaHdrsMap = errors.New("wrong unFinished meta headers map")

ErrWrongUnFinishedMetaHdrsMap signals that wrong unFinished meta headers map was provided

Functions

func CreatePostMiniBlocks added in v1.1.12

func CreatePostMiniBlocks(args ArgsHardForkProcessor) error

CreatePostMiniBlocks will create all the post miniBlocks after hardfork import

func GetPendingMiniBlocks added in v1.1.12

func GetPendingMiniBlocks(
	epochStartMetaBlock data.MetaHeaderHandler,
	unFinishedMetaBlocksMap map[string]data.MetaHeaderHandler,
) ([]data.MiniBlockHeaderHandler, error)

GetPendingMiniBlocks get all the pending miniBlocks from epoch start metaBlock and unFinished metaBlocks

Types

type AccountsDBSyncContainer

type AccountsDBSyncContainer interface {
	Get(key string) (AccountsDBSyncer, error)
	Add(key string, val AccountsDBSyncer) error
	AddMultiple(keys []string, values []AccountsDBSyncer) error
	Replace(key string, val AccountsDBSyncer) error
	Remove(key string)
	Len() int
	IsInterfaceNil() bool
}

AccountsDBSyncContainer keep a list of TrieSyncer

type AccountsDBSyncer

type AccountsDBSyncer interface {
	GetSyncedTries() map[string]common.Trie
	SyncAccounts(rootHash []byte) error
	IsInterfaceNil() bool
}

AccountsDBSyncer defines the methods for the accounts db syncer

type ArgsHardForkProcessor added in v1.1.12

type ArgsHardForkProcessor struct {
	Hasher                    hashing.Hasher
	Marshalizer               marshal.Marshalizer
	ShardIDs                  []uint32
	MapBodies                 map[uint32]*block.Body
	MapHardForkBlockProcessor map[uint32]HardForkBlockProcessor
	PostMbs                   []*MbInfo
}

ArgsHardForkProcessor defines the arguments structure needed by hardfork processor methods

type Closer added in v1.0.133

type Closer interface {
	Close() error
	IsInterfaceNil() bool
}

Closer defines the functionality of an entity that can be closed

type DataWriter

type DataWriter interface {
	WriteString(s string) (int, error)
	Flush() error
}

DataWriter defines the methods to write data

type EpochChangeConfirmedNotifier added in v1.0.120

type EpochChangeConfirmedNotifier interface {
	RegisterForEpochChangeConfirmed(handler func(epoch uint32))
	IsInterfaceNil() bool
}

EpochChangeConfirmedNotifier defines the functionality needed to register for the epoch change confirmed event

type EpochHandler added in v1.0.120

type EpochHandler interface {
	MetaEpoch() uint32
	ForceEpochStart(round uint64)
	IsInterfaceNil() bool
}

EpochHandler defines the functionality to get the current epoch

type EpochStartPendingMiniBlocksSyncHandler

type EpochStartPendingMiniBlocksSyncHandler interface {
	SyncPendingMiniBlocksFromMeta(epochStart data.MetaHeaderHandler, unFinished map[string]data.MetaHeaderHandler, ctx context.Context) error
	GetMiniBlocks() (map[string]*block.MiniBlock, error)
	IsInterfaceNil() bool
}

EpochStartPendingMiniBlocksSyncHandler defines the methods to sync all pending miniblocks

type EpochStartTriesSyncHandler

type EpochStartTriesSyncHandler interface {
	SyncTriesFrom(meta data.MetaHeaderHandler) error
	GetTries() (map[string]common.Trie, error)
	IsInterfaceNil() bool
}

EpochStartTriesSyncHandler defines the methods to sync all tries from a given epoch start metablock

type EpochStartVerifier

type EpochStartVerifier interface {
	IsEpochStart() bool
	Epoch() uint32
	EpochStartMetaHdrHash() []byte
	IsInterfaceNil() bool
}

EpochStartVerifier defines the functionality needed by sync all state from epochTrigger

type ExportFactoryHandler added in v1.0.120

type ExportFactoryHandler interface {
	Create() (ExportHandler, error)
	IsInterfaceNil() bool
}

ExportFactoryHandler defines the functionality to create and export handler

type ExportHandler

type ExportHandler interface {
	ExportAll(epoch uint32) error
	IsInterfaceNil() bool
}

ExportHandler defines the methods to export the current state of the blockchain

type GenesisNodesSetupHandler added in v1.0.149

type GenesisNodesSetupHandler interface {
	InitialNodesInfoForShard(shardId uint32) ([]nodesCoordinator.GenesisNodeInfoHandler, []nodesCoordinator.GenesisNodeInfoHandler, error)
	InitialNodesInfo() (map[uint32][]nodesCoordinator.GenesisNodeInfoHandler, map[uint32][]nodesCoordinator.GenesisNodeInfoHandler)
	GetStartTime() int64
	GetRoundDuration() uint64
	GetShardConsensusGroupSize() uint32
	GetMetaConsensusGroupSize() uint32
	MinNumberOfShardNodes() uint32
	MinNumberOfMetaNodes() uint32
	GetHysteresis() float32
	GetAdaptivity() bool
	NumberOfShards() uint32
	MinNumberOfNodes() uint32
	IsInterfaceNil() bool
}

GenesisNodesSetupHandler returns the genesis nodes info

type HardForkBlockProcessor added in v1.0.115

type HardForkBlockProcessor interface {
	CreateBlock(body *block.Body, chainID string, round uint64, nonce uint64, epoch uint32) (data.HeaderHandler, error)
	CreateBody() (*block.Body, []*MbInfo, error)
	CreatePostMiniBlocks(mbsInfo []*MbInfo) (*block.Body, []*MbInfo, error)
	IsInterfaceNil() bool
}

HardForkBlockProcessor defines the methods to process after hardfork

type HardforkStorer added in v1.0.138

type HardforkStorer interface {
	Write(identifier string, key []byte, value []byte) error
	FinishedIdentifier(identifier string) error
	RangeKeys(handler func(identifier string, keys [][]byte) bool)
	Get(identifier string, key []byte) ([]byte, error)
	Close() error
	IsInterfaceNil() bool
}

HardforkStorer manages the export and import of data

type HeaderSyncHandler

type HeaderSyncHandler interface {
	SyncUnFinishedMetaHeaders(epoch uint32) error
	GetEpochStartMetaBlock() (data.MetaHeaderHandler, error)
	GetUnFinishedMetaBlocks() (map[string]data.MetaHeaderHandler, error)
	IsInterfaceNil() bool
}

HeaderSyncHandler defines the methods to sync and get the epoch start metablock

type HistoryStorer

type HistoryStorer interface {
	Put(key, data []byte) error
	Get(key []byte) ([]byte, error)
	Has(key []byte) error
	Remove(key []byte) error
	ClearCache()
	DestroyUnit() error
	GetFromEpoch(key []byte, epoch uint32) ([]byte, error)

	IsInterfaceNil() bool
}

HistoryStorer provides storage services in a two layered storage construct, where the first layer is represented by a cache and second layer by a persitent storage (DB-like)

type ImportHandler

type ImportHandler interface {
	ImportAll() error
	GetValidatorAccountsDB() state.AccountsAdapter
	GetMiniBlocks() map[string]*block.MiniBlock
	GetHardForkMetaBlock() data.MetaHeaderHandler
	GetUnFinishedMetaBlocks() map[string]data.MetaHeaderHandler
	GetTransactions() map[string]data.TransactionHandler
	GetAccountsDBForShard(shardID uint32) state.AccountsAdapter
	Close() error
	IsInterfaceNil() bool
}

ImportHandler defines the methods to import the full state of the blockchain

type ImportStartHandler added in v1.0.133

type ImportStartHandler interface {
	IsAfterExportBeforeImport() bool
	ShouldStartImport() bool
	ResetStartImport() error
	SetStartImport() error
	IsInterfaceNil() bool
}

ImportStartHandler can manage the process of starting the import after the hardfork event

type MbInfo added in v1.1.12

type MbInfo struct {
	MbHash          []byte
	SenderShardID   uint32
	ReceiverShardID uint32
	Type            block.Type
	TxsInfo         []*TxInfo
}

MbInfo defines the structure which hold the miniBlock info

func CleanDuplicates added in v1.1.12

func CleanDuplicates(args ArgsHardForkProcessor) ([]*MbInfo, error)

CleanDuplicates cleans from the post miniBlocks map, the already existing miniBlocks in bodies map

func CreateBody added in v1.1.12

func CreateBody(args ArgsHardForkProcessor) ([]*MbInfo, error)

CreateBody will create a block body after hardfork import

type MissingHeadersByHashSyncer

type MissingHeadersByHashSyncer interface {
	SyncMissingHeadersByHash(shardIDs []uint32, headersHashes [][]byte, ctx context.Context) error
	GetHeaders() (map[string]data.HeaderHandler, error)
	ClearFields()
	IsInterfaceNil() bool
}

MissingHeadersByHashSyncer defines the methods to sync all missing headers by hash

type PendingTransactionProcessor added in v1.0.115

type PendingTransactionProcessor interface {
	ProcessTransactionsDstMe(mbInfo *MbInfo) (*block.MiniBlock, error)
	RootHash() ([]byte, error)
	Commit() ([]byte, error)
	IsInterfaceNil() bool
}

PendingTransactionProcessor defines the methods to process a transaction destination me

type PreferredPeersHolderHandler added in v1.2.3

type PreferredPeersHolderHandler interface {
	PutConnectionAddress(peerID core.PeerID, address string)
	PutShardID(peerID core.PeerID, shardID uint32)
	Get() map[uint32][]core.PeerID
	Contains(peerID core.PeerID) bool
	Remove(peerID core.PeerID)
	Clear()
	IsInterfaceNil() bool
}

PreferredPeersHolderHandler defines the behavior of a component able to handle preferred peers operations

type RequestHandler

type RequestHandler interface {
	RequestTransaction(shardId uint32, txHashes [][]byte)
	RequestUnsignedTransactions(destShardID uint32, scrHashes [][]byte)
	RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
	RequestMiniBlock(shardId uint32, miniblockHash []byte)
	RequestStartOfEpochMetaBlock(epoch uint32)
	RequestShardHeader(shardId uint32, hash []byte)
	RequestMetaHeader(hash []byte)
	RequestMetaHeaderByNonce(nonce uint64)
	RequestShardHeaderByNonce(shardId uint32, nonce uint64)
	RequestTrieNodes(destShardID uint32, hashes [][]byte, topic string)
	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 RoundHandler added in v1.1.12

type RoundHandler interface {
	Index() int64
	TimeStamp() time.Time
	IsInterfaceNil() bool
}

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

type SigVerifier

type SigVerifier interface {
	Verify(message []byte, sig []byte, pk []byte) error
	IsInterfaceNil() bool
}

SigVerifier is used to verify the signature on a provided message

type StateSyncer

type StateSyncer interface {
	GetEpochStartMetaBlock() (data.MetaHeaderHandler, error)
	GetUnFinishedMetaBlocks() (map[string]data.MetaHeaderHandler, error)
	SyncAllState(epoch uint32) error
	GetAllTries() (map[string]common.Trie, error)
	GetAllTransactions() (map[string]data.TransactionHandler, error)
	GetAllMiniBlocks() (map[string]*block.MiniBlock, error)
	IsInterfaceNil() bool
}

StateSyncer interface defines the methods needed to sync and get all states

type TransactionsSyncHandler added in v1.3.0

type TransactionsSyncHandler interface {
	SyncTransactionsFor(miniBlocks map[string]*block.MiniBlock, epoch uint32, ctx context.Context) error
	GetTransactions() (map[string]data.TransactionHandler, error)
	IsInterfaceNil() bool
}

TransactionsSyncHandler defines the methods to sync all transactions from a set of miniblocks

type TrieSyncContainer

type TrieSyncContainer interface {
	Get(key string) (TrieSyncer, error)
	Add(key string, val TrieSyncer) error
	AddMultiple(keys []string, interceptors []TrieSyncer) error
	Replace(key string, val TrieSyncer) error
	Remove(key string)
	Len() int
	IsInterfaceNil() bool
}

TrieSyncContainer keep a list of TrieSyncer

type TrieSyncer

type TrieSyncer interface {
	StartSyncing(rootHash []byte, ctx context.Context) error
	Trie() common.Trie
	IsInterfaceNil() bool
}

TrieSyncer synchronizes the trie, asking on the network for the missing nodes

type TxInfo added in v1.1.12

type TxInfo struct {
	TxHash []byte
	Tx     data.TransactionHandler
}

TxInfo defines the structure which hold the transaction info

type WhiteListHandler

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

WhiteListHandler is the interface needed to add whitelisted data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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