state

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-3.0 Imports: 34 Imported by: 8

Documentation

Index

Constants

View Source
const HashLength = 32

HashLength defines how many bytes are used in a hash

Variables

View Source
var (
	ErrInvalidLengthCodeEntry        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodeEntry          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCodeEntry = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthValidatorInfo        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowValidatorInfo          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupValidatorInfo = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ErrAccNotFound = errors.New("account was not found")

ErrAccNotFound signals that account was not found in state trie

View Source
var ErrFunctionalityNotImplemented = errors.New("functionality not implemented yet")

ErrFunctionalityNotImplemented signals that the functionality has not been implemented yet

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 ErrInvalidAddressLength = errors.New("invalid address length")

ErrInvalidAddressLength signals that address length is invalid

View Source
var ErrInvalidIdentifier = errors.New("invalid identifier")

ErrInvalidIdentifier signals that the root hash has an invalid identifier

View Source
var ErrInvalidKey = errors.New("invalid key")

ErrInvalidKey is raised when the given key is invalid

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 ErrInvalidPubkeyConverterType = errors.New("invalid pubkey converter type")

ErrInvalidPubkeyConverterType signals that the provided pubkey converter type is invalid

View Source
var ErrInvalidRootHash = errors.New("invalid root hash")

ErrInvalidRootHash signals that the provided root hash is invalid

View Source
var ErrNilAccountFactory = errors.New("account factory is nil")

ErrNilAccountFactory signals that a nil account factory was provided

View Source
var ErrNilAccountHandler = errors.New("account wrapper is nil")

ErrNilAccountHandler signals that a nil account wrapper was provided

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

ErrNilAccountsAdapter defines the error when trying to revert on nil accounts

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

ErrNilAddress defines the error when trying to work with a nil address

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

ErrNilAddressConverter signals that a nil address converter was provided

View Source
var ErrNilAppStatusHandler = errors.New("nil app status handler")

ErrNilAppStatusHandler signals that a nil app status handler was provided

View Source
var ErrNilBlockInfo = errors.New("nil block info")

ErrNilBlockInfo signals that a nil block info was provided

View Source
var ErrNilBlockInfoProvider = errors.New("nil block info provider")

ErrNilBlockInfoProvider signals that a nil block info provider was provided

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

ErrNilCacher signals that nil cacher has been provided

View Source
var ErrNilChannelsProvider = errors.New("nil channels provider")

ErrNilChannelsProvider signals that a nil channels provider has been given

View Source
var ErrNilEnableEpochsHandler = errors.New("nil enable epochs handler")

ErrNilEnableEpochsHandler signals that a nil enable epochs handler has been provided

View Source
var ErrNilEvictionWaitingList = errors.New("nil eviction waiting list provided")

ErrNilEvictionWaitingList is raised when a nil eviction waiting list is 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 ErrNilLastSnapshotMarker = errors.New("nil last snapshot marker")

ErrNilLastSnapshotMarker signals that a nil last snapshot marker has been given

View Source
var ErrNilMapOfHashes = errors.New("nil map of hashes")

ErrNilMapOfHashes signals that the provided map of hashes is nil

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 ErrNilOrEmptyDataTrieUpdates = errors.New("no data trie updates")

ErrNilOrEmptyDataTrieUpdates signals that there are no data trie updates

View Source
var ErrNilProcessStatusHandler = errors.New("nil process status handler")

ErrNilProcessStatusHandler signals that a nil process status handler was provided

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

ErrNilRequestHandler signals that nil request handler has been provided

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

ErrNilRootHash signals that a nil root hash was provided

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

ErrNilShardCoordinator signals that nil shard coordinator was provided

View Source
var ErrNilSnapshotsManager = errors.New("nil snapshots manager")

ErrNilSnapshotsManager signals that a nil snapshots manager has been given

View Source
var ErrNilStateMetrics = errors.New("nil sstate metrics")

ErrNilStateMetrics signals that a nil state metrics has been provided

View Source
var ErrNilStatsHandler = errors.New("nil stats handler")

ErrNilStatsHandler signals that a nil stats handler provider has been given

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

ErrNilStorageManager signals that nil storage manager has been provided

View Source
var ErrNilStoragePruningManager = errors.New("nil storagePruningManager")

ErrNilStoragePruningManager signals that a nil storagePruningManager was provided

View Source
var ErrNilSyncStatisticsHandler = errors.New("nil sync statistics handler")

ErrNilSyncStatisticsHandler signals that a nil sync statistics handler was provided

View Source
var ErrNilTrie = errors.New("trie is nil")

ErrNilTrie signals that a trie is nil and no operation can be made

View Source
var ErrNilTrieSyncer = errors.New("trie syncer is nil")

ErrNilTrieSyncer signals that the trie syncer is nil

View Source
var ErrNilUpdater = errors.New("updater is nil")

ErrNilUpdater signals that a nil updater has been provided

View Source
var ErrNilValidatorInfo = errors.New("validator info is nil")

ErrNilValidatorInfo signals that a nil value for the validator info has been provided

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

ErrOperationNotPermitted signals that operation is not permitted

View Source
var ErrSnapshotValueOutOfBounds = errors.New("snapshot value out of bounds")

ErrSnapshotValueOutOfBounds signals that the snapshot value is out of bounds

View Source
var ErrValidatorNotFound = errors.New("validator not found")

ErrValidatorNotFound signals that a validator was not found

View Source
var ErrValidatorsDifferentShards = errors.New("validators are not in the same shard")

ErrValidatorsDifferentShards signals that validators are not in the same shard

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

ErrWrongTypeAssertion signals that a wrong type assertion occurred

Functions

func NewAccountsDBApi

func NewAccountsDBApi(innerAccountsAdapter AccountsAdapter, blockInfoProvider BlockInfoProvider) (*accountsDBApi, error)

NewAccountsDBApi will create a new instance of type accountsDBApi

func NewAccountsDBApiWithHistory

func NewAccountsDBApiWithHistory(innerAccountsAdapter AccountsAdapter) (*accountsDBApiWithHistory, error)

NewAccountsDBApiWithHistory will create a new instance of type accountsDBApiWithHistory

func NewAccountsRepository

func NewAccountsRepository(args ArgsAccountsRepository) (*accountsRepository, error)

NewAccountsRepository creates a new accountsRepository instance

func NewDataTriesHolder

func NewDataTriesHolder() *dataTriesHolder

NewDataTriesHolder creates a new instance of dataTriesHolder

func NewJournalEntryAccount

func NewJournalEntryAccount(account vmcommon.AccountHandler) (*journalEntryAccount, error)

NewJournalEntryAccount creates a new instance of JournalEntryAccount

func NewJournalEntryAccountCreation

func NewJournalEntryAccountCreation(address []byte, updater Updater) (*journalEntryAccountCreation, error)

NewJournalEntryAccountCreation creates a new instance of JournalEntryAccountCreation

func NewJournalEntryCode

func NewJournalEntryCode(
	oldCodeEntry *CodeEntry,
	oldCodeHash []byte,
	newCodeHash []byte,
	trie Updater,
	marshalizer marshal.Marshalizer,
) (*journalEntryCode, error)

NewJournalEntryCode creates a new instance of JournalEntryCode

func NewJournalEntryDataTrieRemove

func NewJournalEntryDataTrieRemove(rootHash []byte, obsoleteDataTrieHashes map[string][][]byte) (*journalEntryDataTrieRemove, error)

NewJournalEntryDataTrieRemove outputs a new journalEntryDataTrieRemove implementation used to cancel the eviction of the hashes from the data trie with the given root hash

func NewJournalEntryDataTrieUpdates

func NewJournalEntryDataTrieUpdates(trieUpdates []core.TrieData, account baseAccountHandler) (*journalEntryDataTrieUpdates, error)

NewJournalEntryDataTrieUpdates outputs a new JournalEntryDataTrieUpdates implementation used to revert an account's data trie

func NewPruningHandler

func NewPruningHandler(isPruningEnabled PruningHandlerOperation) *pruningHandler

NewPruningHandler returns a new instance of pruningHandler with the given parameters

func NewShardValidatorsInfoMap added in v1.7.0

func NewShardValidatorsInfoMap() *shardValidatorsInfoMap

NewShardValidatorsInfoMap creates an instance of shardValidatorsInfoMap which manages a <shardID, validatorsInfo> map internally

func NewSnapshotsManager added in v1.6.0

func NewSnapshotsManager(args ArgsNewSnapshotsManager) (*snapshotsManager, error)

NewSnapshotsManager creates a new snapshots manager

Types

type AccountFactory

type AccountFactory interface {
	CreateAccount(address []byte) (vmcommon.AccountHandler, error)
	IsInterfaceNil() bool
}

AccountFactory creates an account of different types

type AccountsAdapter

type AccountsAdapter interface {
	GetExistingAccount(address []byte) (vmcommon.AccountHandler, error)
	GetAccountFromBytes(address []byte, accountBytes []byte) (vmcommon.AccountHandler, error)
	LoadAccount(address []byte) (vmcommon.AccountHandler, error)
	SaveAccount(account vmcommon.AccountHandler) error
	RemoveAccount(address []byte) error
	CommitInEpoch(currentEpoch uint32, epochToCommit uint32) ([]byte, error)
	Commit() ([]byte, error)
	JournalLen() int
	RevertToSnapshot(snapshot int) error
	GetCode(codeHash []byte) []byte
	RootHash() ([]byte, error)
	RecreateTrie(rootHash []byte) error
	RecreateTrieFromEpoch(options common.RootHashHolder) error
	PruneTrie(rootHash []byte, identifier TriePruningIdentifier, handler PruningHandler)
	CancelPrune(rootHash []byte, identifier TriePruningIdentifier)
	SnapshotState(rootHash []byte, epoch uint32)
	IsPruningEnabled() bool
	GetAllLeaves(leavesChannels *common.TrieIteratorChannels, ctx context.Context, rootHash []byte, trieLeafParser common.TrieLeafParser) error
	RecreateAllTries(rootHash []byte) (map[string]common.Trie, error)
	GetTrie(rootHash []byte) (common.Trie, error)
	GetStackDebugFirstEntry() []byte
	SetSyncer(syncer AccountsDBSyncer) error
	StartSnapshotIfNeeded() error
	Close() error
	IsInterfaceNil() bool
}

AccountsAdapter is used for the structure that manages the accounts on top of a trie.PatriciaMerkleTrie implementation

type AccountsAdapterAPI

type AccountsAdapterAPI interface {
	AccountsAdapter
	GetAccountWithBlockInfo(address []byte, options common.RootHashHolder) (vmcommon.AccountHandler, common.BlockInfo, error)
	GetCodeWithBlockInfo(codeHash []byte, options common.RootHashHolder) ([]byte, common.BlockInfo, error)
}

AccountsAdapterAPI defines the extension of the AccountsAdapter that should be used in API calls

type AccountsAdapterWithClean added in v1.6.0

type AccountsAdapterWithClean interface {
	AccountsAdapter
	CleanCache()
}

AccountsAdapterWithClean extends the AccountsAdapter interface with a CleanCache method

type AccountsDB

type AccountsDB struct {
	// contains filtered or unexported fields
}

AccountsDB is the struct used for accessing accounts. This struct is concurrent safe.

func NewAccountsDB

func NewAccountsDB(args ArgsAccountsDB) (*AccountsDB, error)

NewAccountsDB creates a new account manager

func (*AccountsDB) CancelPrune

func (adb *AccountsDB) CancelPrune(rootHash []byte, identifier TriePruningIdentifier)

CancelPrune clears the trie's evictionWaitingList

func (*AccountsDB) Close

func (adb *AccountsDB) Close() error

Close will handle the closing of the underlying components

func (*AccountsDB) Commit

func (adb *AccountsDB) Commit() ([]byte, error)

Commit will persist all data inside the trie

func (*AccountsDB) CommitInEpoch

func (adb *AccountsDB) CommitInEpoch(currentEpoch uint32, epochToCommit uint32) ([]byte, error)

CommitInEpoch will commit the current trie state in the given epoch

func (*AccountsDB) GetAccountFromBytes

func (adb *AccountsDB) GetAccountFromBytes(address []byte, accountBytes []byte) (vmcommon.AccountHandler, error)

GetAccountFromBytes returns an account from the given bytes

func (*AccountsDB) GetAllLeaves

func (adb *AccountsDB) GetAllLeaves(leavesChannels *common.TrieIteratorChannels, ctx context.Context, rootHash []byte, trieLeafParser common.TrieLeafParser) error

GetAllLeaves returns all the leaves from a given rootHash

func (*AccountsDB) GetCode

func (adb *AccountsDB) GetCode(codeHash []byte) []byte

GetCode returns the code for the given account

func (*AccountsDB) GetExistingAccount

func (adb *AccountsDB) GetExistingAccount(address []byte) (vmcommon.AccountHandler, error)

GetExistingAccount returns an existing account if exists or nil if missing

func (*AccountsDB) GetStackDebugFirstEntry

func (adb *AccountsDB) GetStackDebugFirstEntry() []byte

GetStackDebugFirstEntry will return the debug.Stack for the first entry from the adb.entries

func (*AccountsDB) GetStatsForRootHash

func (adb *AccountsDB) GetStatsForRootHash(rootHash []byte) (common.TriesStatisticsCollector, error)

GetStatsForRootHash will get trie statistics for the given rootHash

func (*AccountsDB) GetTrie

func (adb *AccountsDB) GetTrie(rootHash []byte) (common.Trie, error)

GetTrie returns the trie that has the given rootHash

func (*AccountsDB) ImportAccount

func (adb *AccountsDB) ImportAccount(account vmcommon.AccountHandler) error

ImportAccount saves the account in the trie. It does not modify

func (*AccountsDB) IsInterfaceNil

func (adb *AccountsDB) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*AccountsDB) IsPruningEnabled

func (adb *AccountsDB) IsPruningEnabled() bool

IsPruningEnabled returns true if state pruning is enabled

func (*AccountsDB) IsSnapshotInProgress added in v1.6.0

func (adb *AccountsDB) IsSnapshotInProgress() bool

IsSnapshotInProgress returns true if there is a snapshot in progress

func (*AccountsDB) JournalLen

func (adb *AccountsDB) JournalLen() int

JournalLen will return the number of entries

func (*AccountsDB) LoadAccount

func (adb *AccountsDB) LoadAccount(address []byte) (vmcommon.AccountHandler, error)

LoadAccount fetches the account based on the address. Creates an empty account if the account is missing.

func (*AccountsDB) PruneTrie

func (adb *AccountsDB) PruneTrie(rootHash []byte, identifier TriePruningIdentifier, handler PruningHandler)

PruneTrie removes old values from the trie database

func (*AccountsDB) RecreateAllTries

func (adb *AccountsDB) RecreateAllTries(rootHash []byte) (map[string]common.Trie, error)

RecreateAllTries recreates all the tries from the accounts DB

func (*AccountsDB) RecreateTrie

func (adb *AccountsDB) RecreateTrie(rootHash []byte) error

RecreateTrie is used to reload the trie based on an existing rootHash

func (*AccountsDB) RecreateTrieFromEpoch

func (adb *AccountsDB) RecreateTrieFromEpoch(options common.RootHashHolder) error

RecreateTrieFromEpoch is used to reload the trie based on the provided options

func (*AccountsDB) RemoveAccount

func (adb *AccountsDB) RemoveAccount(address []byte) error

RemoveAccount removes the account data from underlying trie. It basically calls Update with empty slice

func (*AccountsDB) RevertToSnapshot

func (adb *AccountsDB) RevertToSnapshot(snapshot int) error

RevertToSnapshot apply Revert method over accounts object and removes entries from the list Calling with 0 will revert everything. If the snapshot value is out of bounds, an err will be returned

func (*AccountsDB) RootHash

func (adb *AccountsDB) RootHash() ([]byte, error)

RootHash returns the main trie's root hash

func (*AccountsDB) SaveAccount

func (adb *AccountsDB) SaveAccount(account vmcommon.AccountHandler) error

SaveAccount saves in the trie all changes made to the account.

func (*AccountsDB) SetSyncer

func (adb *AccountsDB) SetSyncer(syncer AccountsDBSyncer) error

SetSyncer sets the given syncer as the syncer for the underlying trie

func (*AccountsDB) SnapshotState

func (adb *AccountsDB) SnapshotState(rootHash []byte, epoch uint32)

SnapshotState triggers the snapshotting process of the state trie

func (*AccountsDB) StartSnapshotIfNeeded

func (adb *AccountsDB) StartSnapshotIfNeeded() error

StartSnapshotIfNeeded starts the snapshot if the previous snapshot process was not fully completed

type AccountsDBImporter

type AccountsDBImporter interface {
	ImportAccount(account vmcommon.AccountHandler) error
	Commit() ([]byte, error)
	IsInterfaceNil() bool
}

AccountsDBImporter is used in importing accounts

type AccountsDBSyncer

type AccountsDBSyncer interface {
	SyncAccounts(rootHash []byte, storageMarker common.StorageMarker) error
	IsInterfaceNil() bool
}

AccountsDBSyncer defines the methods for the accounts db syncer

type AccountsDbIdentifier

type AccountsDbIdentifier byte

AccountsDbIdentifier is the type of accounts db

const (
	// UserAccountsState is the user accounts
	UserAccountsState AccountsDbIdentifier = 0
	// PeerAccountsState is the peer accounts
	PeerAccountsState AccountsDbIdentifier = 1
)

type AccountsRepository

type AccountsRepository interface {
	GetAccountWithBlockInfo(address []byte, options api.AccountQueryOptions) (vmcommon.AccountHandler, common.BlockInfo, error)
	GetCodeWithBlockInfo(codeHash []byte, options api.AccountQueryOptions) ([]byte, common.BlockInfo, error)
	GetCurrentStateAccountsWrapper() AccountsAdapterAPI
	Close() error
	IsInterfaceNil() bool
}

AccountsRepository handles the defined execution based on the query options

type ArgsAccountsDB

type ArgsAccountsDB struct {
	Trie                  common.Trie
	Hasher                hashing.Hasher
	Marshaller            marshal.Marshalizer
	AccountFactory        AccountFactory
	StoragePruningManager StoragePruningManager
	AddressConverter      core.PubkeyConverter
	SnapshotsManager      SnapshotsManager
}

ArgsAccountsDB is the arguments DTO for the AccountsDB instance

type ArgsAccountsRepository

type ArgsAccountsRepository struct {
	FinalStateAccountsWrapper      AccountsAdapterAPI
	CurrentStateAccountsWrapper    AccountsAdapterAPI
	HistoricalStateAccountsWrapper AccountsAdapterAPI
}

ArgsAccountsRepository is the DTO for the NewAccountsRepository constructor function

type ArgsNewSnapshotsManager added in v1.6.0

type ArgsNewSnapshotsManager struct {
	ShouldSerializeSnapshots bool
	ProcessingMode           common.NodeProcessingMode
	Marshaller               marshal.Marshalizer
	AddressConverter         core.PubkeyConverter
	ProcessStatusHandler     common.ProcessStatusHandler
	StateMetrics             StateMetrics
	AccountFactory           AccountFactory
	ChannelsProvider         IteratorChannelsProvider
	StateStatsHandler        StateStatsHandler
	LastSnapshotMarker       LastSnapshotMarker
}

ArgsNewSnapshotsManager are the args needed for creating a new snapshots manager

type AtomicBuffer

type AtomicBuffer interface {
	Add(rootHash []byte)
	RemoveAll() [][]byte
	Len() int
}

AtomicBuffer is used to buffer byteArrays

type BlockInfoProvider

type BlockInfoProvider interface {
	GetBlockInfo() common.BlockInfo
	IsInterfaceNil() bool
}

BlockInfoProvider defines the behavior of a struct able to provide the block information used in state tries

type CodeEntry

type CodeEntry struct {
	Code          []byte `protobuf:"bytes,1,opt,name=Code,proto3" json:"code,omitempty"`
	NumReferences uint32 `protobuf:"varint,2,opt,name=NumReferences,proto3" json:"numReferences"`
}

func (*CodeEntry) Descriptor

func (*CodeEntry) Descriptor() ([]byte, []int)

func (*CodeEntry) Equal

func (this *CodeEntry) Equal(that interface{}) bool

func (*CodeEntry) GetCode

func (m *CodeEntry) GetCode() []byte

func (*CodeEntry) GetNumReferences

func (m *CodeEntry) GetNumReferences() uint32

func (*CodeEntry) GoString

func (this *CodeEntry) GoString() string

func (*CodeEntry) Marshal

func (m *CodeEntry) Marshal() (dAtA []byte, err error)

func (*CodeEntry) MarshalTo

func (m *CodeEntry) MarshalTo(dAtA []byte) (int, error)

func (*CodeEntry) MarshalToSizedBuffer

func (m *CodeEntry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CodeEntry) ProtoMessage

func (*CodeEntry) ProtoMessage()

func (*CodeEntry) Reset

func (m *CodeEntry) Reset()

func (*CodeEntry) Size

func (m *CodeEntry) Size() (n int)

func (*CodeEntry) String

func (this *CodeEntry) String() string

func (*CodeEntry) Unmarshal

func (m *CodeEntry) Unmarshal(dAtA []byte) error

func (*CodeEntry) XXX_DiscardUnknown

func (m *CodeEntry) XXX_DiscardUnknown()

func (*CodeEntry) XXX_Marshal

func (m *CodeEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CodeEntry) XXX_Merge

func (m *CodeEntry) XXX_Merge(src proto.Message)

func (*CodeEntry) XXX_Size

func (m *CodeEntry) XXX_Size() int

func (*CodeEntry) XXX_Unmarshal

func (m *CodeEntry) XXX_Unmarshal(b []byte) error

type DBRemoveCacher

type DBRemoveCacher interface {
	Put([]byte, common.ModifiedHashes) error
	Evict([]byte) (common.ModifiedHashes, error)
	ShouldKeepHash(hash string, identifier TriePruningIdentifier) (bool, error)
	IsInterfaceNil() bool
	Close() error
}

DBRemoveCacher is used to cache keys that will be deleted from the database

type DataTrie added in v1.6.0

type DataTrie interface {
	common.Trie

	UpdateWithVersion(key []byte, value []byte, version core.TrieNodeVersion) error
	CollectLeavesForMigration(args vmcommon.ArgsMigrateDataTrieLeaves) error
}

DataTrie defines the behavior of a data trie

type DataTrieTracker

type DataTrieTracker interface {
	RetrieveValue(key []byte) ([]byte, uint32, error)
	SaveKeyValue(key []byte, value []byte) error
	SetDataTrie(tr common.Trie)
	DataTrie() common.DataTrieHandler
	SaveDirtyData(common.Trie) ([]core.TrieData, error)
	MigrateDataTrieLeaves(args vmcommon.ArgsMigrateDataTrieLeaves) error
	IsInterfaceNil() bool
}

DataTrieTracker models how to manipulate data held by a SC account

type ErrAccountNotFoundAtBlock

type ErrAccountNotFoundAtBlock struct {
	BlockInfo common.BlockInfo
}

ErrAccountNotFoundAtBlock is an error-compatible struct holding the block info at which an account was not found

func NewErrAccountNotFoundAtBlock

func NewErrAccountNotFoundAtBlock(blockInfo common.BlockInfo) *ErrAccountNotFoundAtBlock

NewErrAccountNotFoundAtBlock returns a new error (custom struct)

func (*ErrAccountNotFoundAtBlock) Error

func (e *ErrAccountNotFoundAtBlock) Error() string

Error returns the error as string

type IteratorChannelsProvider added in v1.6.0

type IteratorChannelsProvider interface {
	GetIteratorChannels() *common.TrieIteratorChannels
	IsInterfaceNil() bool
}

IteratorChannelsProvider defines the methods for the iterator channels provider

type JournalEntry

type JournalEntry interface {
	Revert() (vmcommon.AccountHandler, error)
	IsInterfaceNil() bool
}

JournalEntry will be used to implement different state changes to be able to easily revert them

type LastSnapshotMarker added in v1.7.0

type LastSnapshotMarker interface {
	AddMarker(trieStorageManager common.StorageManager, epoch uint32, rootHash []byte)
	RemoveMarker(trieStorageManager common.StorageManager, epoch uint32, rootHash []byte)
	GetMarkerInfo(trieStorageManager common.StorageManager) ([]byte, error)
	IsInterfaceNil() bool
}

LastSnapshotMarker manages the lastSnapshot marker operations

type PeerAccountHandler

type PeerAccountHandler interface {
	GetBLSPublicKey() []byte
	SetBLSPublicKey([]byte) error
	GetRewardAddress() []byte
	SetRewardAddress([]byte) error
	GetAccumulatedFees() *big.Int
	AddToAccumulatedFees(*big.Int)
	GetList() string
	GetPreviousList() string
	GetIndexInList() uint32
	GetPreviousIndexInList() uint32
	GetShardId() uint32
	SetUnStakedEpoch(epoch uint32)
	GetUnStakedEpoch() uint32
	IncreaseLeaderSuccessRate(uint32)
	DecreaseLeaderSuccessRate(uint32)
	IncreaseValidatorSuccessRate(uint32)
	DecreaseValidatorSuccessRate(uint32)
	IncreaseValidatorIgnoredSignaturesRate(uint32)
	GetNumSelectedInSuccessBlocks() uint32
	IncreaseNumSelectedInSuccessBlocks()
	GetLeaderSuccessRate() SignRate
	GetValidatorSuccessRate() SignRate
	GetValidatorIgnoredSignaturesRate() uint32
	GetTotalLeaderSuccessRate() SignRate
	GetTotalValidatorSuccessRate() SignRate
	GetTotalValidatorIgnoredSignaturesRate() uint32
	SetListAndIndex(shardID uint32, list string, index uint32, updatePreviousValues bool)
	GetRating() uint32
	SetRating(uint32)
	GetTempRating() uint32
	SetTempRating(uint32)
	GetConsecutiveProposerMisses() uint32
	SetConsecutiveProposerMisses(uint322 uint32)
	ResetAtNewEpoch()
	SetPreviousList(list string)
	vmcommon.AccountHandler
}

PeerAccountHandler models a peer state account, which can journalize a normal account's data with some extra features like signing statistics or rating information

func GetPeerAccountAndReturnIfNew added in v1.6.0

func GetPeerAccountAndReturnIfNew(adb AccountsAdapter, address []byte) (PeerAccountHandler, bool, error)

GetPeerAccountAndReturnIfNew returns the peer account and a flag indicating if the account is new

type PeerAccountsDB

type PeerAccountsDB struct {
	*AccountsDB
}

PeerAccountsDB will save and synchronize data from peer processor, plus will synchronize with nodesCoordinator

func NewPeerAccountsDB

func NewPeerAccountsDB(args ArgsAccountsDB) (*PeerAccountsDB, error)

NewPeerAccountsDB creates a new account manager

func (*PeerAccountsDB) IsInterfaceNil

func (adb *PeerAccountsDB) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PeerAccountsDB) MarkSnapshotDone

func (adb *PeerAccountsDB) MarkSnapshotDone()

MarkSnapshotDone will mark that the snapshot process has been completed

func (*PeerAccountsDB) RecreateAllTries

func (adb *PeerAccountsDB) RecreateAllTries(rootHash []byte) (map[string]common.Trie, error)

RecreateAllTries recreates all the tries from the accounts DB

type PeerTypeInfo

type PeerTypeInfo struct {
	PublicKey   string
	PeerType    string
	PeerSubType core.P2PPeerSubType
	ShardId     uint32
}

PeerTypeInfo contains information related to the peertypes needed by the peerTypeProvider

type PruningHandler

type PruningHandler interface {
	IsPruningEnabled() bool
}

PruningHandler defines different options for pruning

type PruningHandlerOperation

type PruningHandlerOperation bool

PruningHandlerOperation defines the options that can be activated on pruning

const (
	// EnableDataRemoval enables trie pruning
	EnableDataRemoval PruningHandlerOperation = true

	// DisableDataRemoval stops trie pruning
	DisableDataRemoval PruningHandlerOperation = false
)

type ShardValidatorInfo

type ShardValidatorInfo struct {
	PublicKey     []byte `protobuf:"bytes,1,opt,name=PublicKey,proto3" json:"publicKey"`
	ShardId       uint32 `protobuf:"varint,2,opt,name=ShardId,proto3" json:"shardId"`
	List          string `protobuf:"bytes,3,opt,name=List,proto3" json:"list,omitempty"`
	Index         uint32 `protobuf:"varint,4,opt,name=Index,proto3" json:"index"`
	TempRating    uint32 `protobuf:"varint,5,opt,name=TempRating,proto3" json:"tempRating"`
	PreviousList  string `protobuf:"bytes,6,opt,name=PreviousList,proto3" json:"previousList,omitempty"`
	PreviousIndex uint32 `protobuf:"varint,7,opt,name=PreviousIndex,proto3" json:"previousIndex,omitempty"`
}

ShardValidatorInfo represents the data regarding a validator that is stored in the PeerMiniblocks

func (*ShardValidatorInfo) Descriptor

func (*ShardValidatorInfo) Descriptor() ([]byte, []int)

func (*ShardValidatorInfo) Equal

func (this *ShardValidatorInfo) Equal(that interface{}) bool

func (*ShardValidatorInfo) GetIndex

func (m *ShardValidatorInfo) GetIndex() uint32

func (*ShardValidatorInfo) GetList

func (m *ShardValidatorInfo) GetList() string

func (*ShardValidatorInfo) GetPreviousIndex added in v1.7.0

func (m *ShardValidatorInfo) GetPreviousIndex() uint32

func (*ShardValidatorInfo) GetPreviousList added in v1.7.0

func (m *ShardValidatorInfo) GetPreviousList() string

func (*ShardValidatorInfo) GetPublicKey

func (m *ShardValidatorInfo) GetPublicKey() []byte

func (*ShardValidatorInfo) GetShardId

func (m *ShardValidatorInfo) GetShardId() uint32

func (*ShardValidatorInfo) GetTempRating

func (m *ShardValidatorInfo) GetTempRating() uint32

func (*ShardValidatorInfo) GoString

func (this *ShardValidatorInfo) GoString() string

func (*ShardValidatorInfo) IsInterfaceNil

func (svi *ShardValidatorInfo) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardValidatorInfo) Marshal

func (m *ShardValidatorInfo) Marshal() (dAtA []byte, err error)

func (*ShardValidatorInfo) MarshalTo

func (m *ShardValidatorInfo) MarshalTo(dAtA []byte) (int, error)

func (*ShardValidatorInfo) MarshalToSizedBuffer

func (m *ShardValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ShardValidatorInfo) ProtoMessage

func (*ShardValidatorInfo) ProtoMessage()

func (*ShardValidatorInfo) Reset

func (m *ShardValidatorInfo) Reset()

func (*ShardValidatorInfo) Size

func (m *ShardValidatorInfo) Size() (n int)

func (*ShardValidatorInfo) String

func (this *ShardValidatorInfo) String() string

func (*ShardValidatorInfo) Unmarshal

func (m *ShardValidatorInfo) Unmarshal(dAtA []byte) error

func (*ShardValidatorInfo) XXX_DiscardUnknown

func (m *ShardValidatorInfo) XXX_DiscardUnknown()

func (*ShardValidatorInfo) XXX_Marshal

func (m *ShardValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ShardValidatorInfo) XXX_Merge

func (m *ShardValidatorInfo) XXX_Merge(src proto.Message)

func (*ShardValidatorInfo) XXX_Size

func (m *ShardValidatorInfo) XXX_Size() int

func (*ShardValidatorInfo) XXX_Unmarshal

func (m *ShardValidatorInfo) XXX_Unmarshal(b []byte) error

type ShardValidatorsInfoMapHandler added in v1.7.0

type ShardValidatorsInfoMapHandler interface {
	GetShardValidatorsInfoMap() map[uint32][]ValidatorInfoHandler
	GetAllValidatorsInfo() []ValidatorInfoHandler
	GetValidator(blsKey []byte) ValidatorInfoHandler

	Add(validator ValidatorInfoHandler) error
	Delete(validator ValidatorInfoHandler) error
	Replace(old ValidatorInfoHandler, new ValidatorInfoHandler) error
	SetValidatorsInShard(shardID uint32, validators []ValidatorInfoHandler) error
}

ShardValidatorsInfoMapHandler shall be used to manage operations inside a <shardID, []ValidatorInfoHandler> map in a concurrent-safe way.

type SignRate

type SignRate interface {
	GetNumSuccess() uint32
	GetNumFailure() uint32
}

SignRate defines the operations of an entity that holds signing statistics

type SnapshotsManager added in v1.6.0

type SnapshotsManager interface {
	SnapshotState(rootHash []byte, epoch uint32, trieStorageManager common.StorageManager)
	StartSnapshotAfterRestartIfNeeded(trieStorageManager common.StorageManager) error
	IsSnapshotInProgress() bool
	SetSyncer(syncer AccountsDBSyncer) error
	IsInterfaceNil() bool
}

SnapshotsManager defines the methods for the snapshot manager

type StateMetrics added in v1.6.0

type StateMetrics interface {
	UpdateMetricsOnSnapshotStart()
	UpdateMetricsOnSnapshotCompletion(stats common.SnapshotStatisticsHandler)
	GetSnapshotMessage() string
	IsInterfaceNil() bool
}

StateMetrics defines the methods for the state metrics

type StateStatsHandler added in v1.7.0

type StateStatsHandler interface {
	ResetSnapshot()
	SnapshotStats() []string
	IsInterfaceNil() bool
}

StateStatsHandler defines the behaviour needed to handler state statistics

type StoragePruningManager

type StoragePruningManager interface {
	MarkForEviction([]byte, []byte, common.ModifiedHashes, common.ModifiedHashes) error
	PruneTrie(rootHash []byte, identifier TriePruningIdentifier, tsm common.StorageManager, handler PruningHandler)
	CancelPrune(rootHash []byte, identifier TriePruningIdentifier, tsm common.StorageManager)
	Close() error
	IsInterfaceNil() bool
}

StoragePruningManager is used to manage all state pruning operations

type TriePruningIdentifier

type TriePruningIdentifier byte

TriePruningIdentifier is the type for trie pruning identifiers

const (
	// OldRoot is appended to the key when oldHashes are added to the evictionWaitingList
	OldRoot TriePruningIdentifier = 0
	// NewRoot is appended to the key when newHashes are added to the evictionWaitingList
	NewRoot TriePruningIdentifier = 1
)

type Updater

type Updater interface {
	Get(key []byte) ([]byte, uint32, error)
	Update(key, value []byte) error
	IsInterfaceNil() bool
}

Updater set a new value for a key, implemented by trie

type UserAccountHandler

type UserAccountHandler interface {
	SetCode(code []byte)
	SetCodeMetadata(codeMetadata []byte)
	GetCodeMetadata() []byte
	SetCodeHash([]byte)
	GetCodeHash() []byte
	SetRootHash([]byte)
	GetRootHash() []byte
	SetDataTrie(trie common.Trie)
	DataTrie() common.DataTrieHandler
	RetrieveValue(key []byte) ([]byte, uint32, error)
	SaveKeyValue(key []byte, value []byte) error
	AddToBalance(value *big.Int) error
	SubFromBalance(value *big.Int) error
	GetBalance() *big.Int
	ClaimDeveloperRewards([]byte) (*big.Int, error)
	AddToDeveloperReward(*big.Int)
	GetDeveloperReward() *big.Int
	ChangeOwnerAddress([]byte, []byte) error
	SetOwnerAddress([]byte)
	GetOwnerAddress() []byte
	SetUserName(userName []byte)
	GetUserName() []byte
	IsGuarded() bool
	GetAllLeaves(leavesChannels *common.TrieIteratorChannels, ctx context.Context) error
	vmcommon.AccountHandler
}

UserAccountHandler models a user account, which can journalize account's data with some extra features like balance, developer rewards, owner

type ValidatorInfo

type ValidatorInfo struct {
	PublicKey                       []byte        `protobuf:"bytes,1,opt,name=PublicKey,proto3" json:"publicKey"`
	ShardId                         uint32        `protobuf:"varint,2,opt,name=ShardId,proto3" json:"shardId"`
	List                            string        `protobuf:"bytes,3,opt,name=List,proto3" json:"list"`
	Index                           uint32        `protobuf:"varint,4,opt,name=Index,proto3" json:"index"`
	TempRating                      uint32        `protobuf:"varint,5,opt,name=TempRating,proto3" json:"tempRating"`
	Rating                          uint32        `protobuf:"varint,6,opt,name=Rating,proto3" json:"rating"`
	RatingModifier                  float32       `protobuf:"fixed32,7,opt,name=RatingModifier,proto3" json:"ratingModifier"`
	RewardAddress                   []byte        `protobuf:"bytes,8,opt,name=RewardAddress,proto3" json:"rewardAddress,omitempty"`
	LeaderSuccess                   uint32        `protobuf:"varint,9,opt,name=LeaderSuccess,proto3" json:"leaderSuccess"`
	LeaderFailure                   uint32        `protobuf:"varint,10,opt,name=LeaderFailure,proto3" json:"leaderFailure"`
	ValidatorSuccess                uint32        `protobuf:"varint,11,opt,name=ValidatorSuccess,proto3" json:"validatorSuccess"`
	ValidatorFailure                uint32        `protobuf:"varint,12,opt,name=ValidatorFailure,proto3" json:"validatorFailure"`
	ValidatorIgnoredSignatures      uint32        `protobuf:"varint,13,opt,name=ValidatorIgnoredSignatures,proto3" json:"validatorIgnoredSignatures"`
	NumSelectedInSuccessBlocks      uint32        `protobuf:"varint,14,opt,name=NumSelectedInSuccessBlocks,proto3" json:"numSelectedInSuccessBlocks"`
	AccumulatedFees                 *math_big.Int `` /* 167-byte string literal not displayed */
	TotalLeaderSuccess              uint32        `protobuf:"varint,16,opt,name=TotalLeaderSuccess,proto3" json:"totalLeaderSuccess"`
	TotalLeaderFailure              uint32        `protobuf:"varint,17,opt,name=TotalLeaderFailure,proto3" json:"totalLeaderFailure"`
	TotalValidatorSuccess           uint32        `protobuf:"varint,18,opt,name=TotalValidatorSuccess,proto3" json:"totalValidatorSuccess"`
	TotalValidatorFailure           uint32        `protobuf:"varint,19,opt,name=TotalValidatorFailure,proto3" json:"totalValidatorFailure"`
	TotalValidatorIgnoredSignatures uint32        `protobuf:"varint,20,opt,name=TotalValidatorIgnoredSignatures,proto3" json:"totalValidatorIgnoredSignatures"`
	PreviousList                    string        `protobuf:"bytes,21,opt,name=PreviousList,proto3" json:"previousList,omitempty"`
	PreviousIndex                   uint32        `protobuf:"varint,22,opt,name=PreviousIndex,proto3" json:"previousIndex,omitempty"`
}

ValidatorInfo represents the data regarding a validator that is verified by the metaNodes

func (*ValidatorInfo) Descriptor

func (*ValidatorInfo) Descriptor() ([]byte, []int)

func (*ValidatorInfo) Equal

func (this *ValidatorInfo) Equal(that interface{}) bool

func (*ValidatorInfo) GetAccumulatedFees

func (m *ValidatorInfo) GetAccumulatedFees() *math_big.Int

func (*ValidatorInfo) GetIndex

func (m *ValidatorInfo) GetIndex() uint32

func (*ValidatorInfo) GetLeaderFailure

func (m *ValidatorInfo) GetLeaderFailure() uint32

func (*ValidatorInfo) GetLeaderSuccess

func (m *ValidatorInfo) GetLeaderSuccess() uint32

func (*ValidatorInfo) GetList

func (m *ValidatorInfo) GetList() string

func (*ValidatorInfo) GetNumSelectedInSuccessBlocks

func (m *ValidatorInfo) GetNumSelectedInSuccessBlocks() uint32

func (*ValidatorInfo) GetPreviousIndex added in v1.7.0

func (m *ValidatorInfo) GetPreviousIndex() uint32

func (*ValidatorInfo) GetPreviousList added in v1.7.0

func (m *ValidatorInfo) GetPreviousList() string

func (*ValidatorInfo) GetPublicKey

func (m *ValidatorInfo) GetPublicKey() []byte

func (*ValidatorInfo) GetRating

func (m *ValidatorInfo) GetRating() uint32

func (*ValidatorInfo) GetRatingModifier

func (m *ValidatorInfo) GetRatingModifier() float32

func (*ValidatorInfo) GetRewardAddress

func (m *ValidatorInfo) GetRewardAddress() []byte

func (*ValidatorInfo) GetShardId

func (m *ValidatorInfo) GetShardId() uint32

func (*ValidatorInfo) GetTempRating

func (m *ValidatorInfo) GetTempRating() uint32

func (*ValidatorInfo) GetTotalLeaderFailure

func (m *ValidatorInfo) GetTotalLeaderFailure() uint32

func (*ValidatorInfo) GetTotalLeaderSuccess

func (m *ValidatorInfo) GetTotalLeaderSuccess() uint32

func (*ValidatorInfo) GetTotalValidatorFailure

func (m *ValidatorInfo) GetTotalValidatorFailure() uint32

func (*ValidatorInfo) GetTotalValidatorIgnoredSignatures

func (m *ValidatorInfo) GetTotalValidatorIgnoredSignatures() uint32

func (*ValidatorInfo) GetTotalValidatorSuccess

func (m *ValidatorInfo) GetTotalValidatorSuccess() uint32

func (*ValidatorInfo) GetValidatorFailure

func (m *ValidatorInfo) GetValidatorFailure() uint32

func (*ValidatorInfo) GetValidatorIgnoredSignatures

func (m *ValidatorInfo) GetValidatorIgnoredSignatures() uint32

func (*ValidatorInfo) GetValidatorSuccess

func (m *ValidatorInfo) GetValidatorSuccess() uint32

func (*ValidatorInfo) GoString

func (this *ValidatorInfo) GoString() string

func (*ValidatorInfo) IsInterfaceNil

func (vi *ValidatorInfo) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ValidatorInfo) Marshal

func (m *ValidatorInfo) Marshal() (dAtA []byte, err error)

func (*ValidatorInfo) MarshalTo

func (m *ValidatorInfo) MarshalTo(dAtA []byte) (int, error)

func (*ValidatorInfo) MarshalToSizedBuffer

func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ValidatorInfo) ProtoMessage

func (*ValidatorInfo) ProtoMessage()

func (*ValidatorInfo) Reset

func (m *ValidatorInfo) Reset()

func (*ValidatorInfo) SetAccumulatedFees added in v1.7.0

func (vi *ValidatorInfo) SetAccumulatedFees(accumulatedFees *mathbig.Int)

SetAccumulatedFees sets validator's accumulated fees

func (*ValidatorInfo) SetIndex added in v1.7.0

func (vi *ValidatorInfo) SetIndex(index uint32)

SetIndex sets validator's index

func (*ValidatorInfo) SetLeaderFailure added in v1.7.0

func (vi *ValidatorInfo) SetLeaderFailure(leaderFailure uint32)

SetLeaderFailure sets validator's leader failure

func (*ValidatorInfo) SetLeaderSuccess added in v1.7.0

func (vi *ValidatorInfo) SetLeaderSuccess(leaderSuccess uint32)

SetLeaderSuccess sets leader success

func (*ValidatorInfo) SetList added in v1.7.0

func (vi *ValidatorInfo) SetList(list string)

SetList sets validator's list

func (*ValidatorInfo) SetListAndIndex added in v1.7.0

func (vi *ValidatorInfo) SetListAndIndex(list string, index uint32, updatePreviousValues bool)

func (*ValidatorInfo) SetNumSelectedInSuccessBlocks added in v1.7.0

func (vi *ValidatorInfo) SetNumSelectedInSuccessBlocks(numSelectedInSuccessBlock uint32)

SetNumSelectedInSuccessBlocks sets validator's num of selected in success block

func (*ValidatorInfo) SetPreviousList added in v1.7.0

func (vi *ValidatorInfo) SetPreviousList(list string)

SetPreviousList sets validator's previous list

func (*ValidatorInfo) SetPublicKey added in v1.7.0

func (vi *ValidatorInfo) SetPublicKey(publicKey []byte)

SetPublicKey sets validator's public key

func (*ValidatorInfo) SetRating added in v1.7.0

func (vi *ValidatorInfo) SetRating(rating uint32)

SetRating sets validator's rating

func (*ValidatorInfo) SetRatingModifier added in v1.7.0

func (vi *ValidatorInfo) SetRatingModifier(ratingModifier float32)

SetRatingModifier sets validator's rating modifier

func (*ValidatorInfo) SetRewardAddress added in v1.7.0

func (vi *ValidatorInfo) SetRewardAddress(rewardAddress []byte)

SetRewardAddress sets validator's reward address

func (*ValidatorInfo) SetShardId added in v1.7.0

func (vi *ValidatorInfo) SetShardId(shardID uint32)

SetShardId sets validator's public shard id

func (*ValidatorInfo) SetTempRating added in v1.7.0

func (vi *ValidatorInfo) SetTempRating(tempRating uint32)

SetTempRating sets validator's temp rating

func (*ValidatorInfo) SetTotalLeaderFailure added in v1.7.0

func (vi *ValidatorInfo) SetTotalLeaderFailure(totalLeaderFailure uint32)

SetTotalLeaderFailure sets validator's total leader failure

func (*ValidatorInfo) SetTotalLeaderSuccess added in v1.7.0

func (vi *ValidatorInfo) SetTotalLeaderSuccess(totalLeaderSuccess uint32)

SetTotalLeaderSuccess sets validator's total leader success

func (*ValidatorInfo) SetTotalValidatorFailure added in v1.7.0

func (vi *ValidatorInfo) SetTotalValidatorFailure(totalValidatorFailure uint32)

SetTotalValidatorFailure sets validator's total failure

func (*ValidatorInfo) SetTotalValidatorIgnoredSignatures added in v1.7.0

func (vi *ValidatorInfo) SetTotalValidatorIgnoredSignatures(totalValidatorIgnoredSignatures uint32)

SetTotalValidatorIgnoredSignatures sets validator's total ignored signatures

func (*ValidatorInfo) SetTotalValidatorSuccess added in v1.7.0

func (vi *ValidatorInfo) SetTotalValidatorSuccess(totalValidatorSuccess uint32)

SetTotalValidatorSuccess sets validator's total success

func (*ValidatorInfo) SetValidatorFailure added in v1.7.0

func (vi *ValidatorInfo) SetValidatorFailure(validatorFailure uint32)

SetValidatorFailure sets validator's failure

func (*ValidatorInfo) SetValidatorIgnoredSignatures added in v1.7.0

func (vi *ValidatorInfo) SetValidatorIgnoredSignatures(validatorIgnoredSignatures uint32)

SetValidatorIgnoredSignatures sets validator's ignored signatures

func (*ValidatorInfo) SetValidatorSuccess added in v1.7.0

func (vi *ValidatorInfo) SetValidatorSuccess(validatorSuccess uint32)

SetValidatorSuccess sets validator's success

func (*ValidatorInfo) ShallowClone added in v1.7.0

func (vi *ValidatorInfo) ShallowClone() ValidatorInfoHandler

ShallowClone returns a clone of the object

func (*ValidatorInfo) Size

func (m *ValidatorInfo) Size() (n int)

func (*ValidatorInfo) String

func (this *ValidatorInfo) String() string

func (*ValidatorInfo) Unmarshal

func (m *ValidatorInfo) Unmarshal(dAtA []byte) error

func (*ValidatorInfo) XXX_DiscardUnknown

func (m *ValidatorInfo) XXX_DiscardUnknown()

func (*ValidatorInfo) XXX_Marshal

func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ValidatorInfo) XXX_Merge

func (m *ValidatorInfo) XXX_Merge(src proto.Message)

func (*ValidatorInfo) XXX_Size

func (m *ValidatorInfo) XXX_Size() int

func (*ValidatorInfo) XXX_Unmarshal

func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error

type ValidatorInfoHandler added in v1.7.0

type ValidatorInfoHandler interface {
	IsInterfaceNil() bool

	GetPublicKey() []byte
	GetShardId() uint32
	GetList() string
	GetIndex() uint32
	GetPreviousIndex() uint32
	GetTempRating() uint32
	GetRating() uint32
	GetRatingModifier() float32
	GetRewardAddress() []byte
	GetLeaderSuccess() uint32
	GetLeaderFailure() uint32
	GetValidatorSuccess() uint32
	GetValidatorFailure() uint32
	GetValidatorIgnoredSignatures() uint32
	GetNumSelectedInSuccessBlocks() uint32
	GetAccumulatedFees() *big.Int
	GetTotalLeaderSuccess() uint32
	GetTotalLeaderFailure() uint32
	GetTotalValidatorSuccess() uint32
	GetTotalValidatorFailure() uint32
	GetTotalValidatorIgnoredSignatures() uint32
	GetPreviousList() string

	SetPublicKey(publicKey []byte)
	SetShardId(shardID uint32)
	SetPreviousList(list string)
	SetList(list string)
	SetIndex(index uint32)
	SetListAndIndex(list string, index uint32, updatePreviousValues bool)
	SetTempRating(tempRating uint32)
	SetRating(rating uint32)
	SetRatingModifier(ratingModifier float32)
	SetRewardAddress(rewardAddress []byte)
	SetLeaderSuccess(leaderSuccess uint32)
	SetLeaderFailure(leaderFailure uint32)
	SetValidatorSuccess(validatorSuccess uint32)
	SetValidatorFailure(validatorFailure uint32)
	SetValidatorIgnoredSignatures(validatorIgnoredSignatures uint32)
	SetNumSelectedInSuccessBlocks(numSelectedInSuccessBlock uint32)
	SetAccumulatedFees(accumulatedFees *big.Int)
	SetTotalLeaderSuccess(totalLeaderSuccess uint32)
	SetTotalLeaderFailure(totalLeaderFailure uint32)
	SetTotalValidatorSuccess(totalValidatorSuccess uint32)
	SetTotalValidatorFailure(totalValidatorFailure uint32)
	SetTotalValidatorIgnoredSignatures(totalValidatorIgnoredSignatures uint32)

	ShallowClone() ValidatorInfoHandler
	String() string
	GoString() string
}

ValidatorInfoHandler defines which data shall a validator info hold.

Jump to

Keyboard shortcuts

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