state

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2021 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const HashLength = 32

HashLength defines how many bytes are used in a hash

Variables

View Source
var (
	ErrInvalidLengthPeerAccountData        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPeerAccountData          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPeerAccountData = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthUserAccountData        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowUserAccountData          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupUserAccountData = 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 ErrBech32ConvertError = errors.New("can't convert bech32 string")

ErrBech32ConvertError signals that conversion the 5bit alphabet to 8bit failed

View Source
var ErrEmptyAddress = errors.New("empty Address")

ErrEmptyAddress defines the error when trying to work with an empty address

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

ErrInvalidErdAddress signals that the provided address is not an ERD address

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 ErrNegativeValue = errors.New("negative values are not permited")

ErrNegativeValue signals that an operation has been attempted with a negative value

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 ErrNilBLSPublicKey = errors.New("bls public key is nil")

ErrNilBLSPublicKey signals that the provided BLS public key is nil

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

ErrNilCacher signals that nil cacher 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 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 ErrNilRequestHandler = errors.New("nil request handler")

ErrNilRequestHandler signals that nil request handler has been provided

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

ErrNilShardCoordinator signals that nil shard coordinator was provided

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 ErrNilTrackableDataTrie = errors.New("nil trackable data trie")

ErrNilTrackableDataTrie signals that a nil trackable data trie has been 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 ErrNilUpdater = errors.New("updater is nil")

ErrNilUpdater signals that a nil updater 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 ErrUnknownShardId = errors.New("shard id is not valid")

ErrUnknownShardId signals that shard id is not valid

View Source
var ErrWrongSize = errors.New("wrong size")

ErrWrongSize signals that a wrong size occurred

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

ErrWrongTypeAssertion signals that a wrong type assertion occurred

Functions

func NewDataTriesHolder

func NewDataTriesHolder() *dataTriesHolder

NewDataTriesHolder creates a new instance of dataTriesHolder

func NewEmptyPeerAccount

func NewEmptyPeerAccount() *peerAccount

NewEmptyPeerAccount returns an empty peerAccount

func NewEmptyUserAccount added in v1.0.102

func NewEmptyUserAccount() *userAccount

NewEmptyUserAccount creates new simple account wrapper for an AccountContainer (that has just been initialized)

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 added in v1.0.137

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 map[string][]byte, account baseAccountHandler) (*journalEntryDataTrieUpdates, error)

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

func NewPeerAccount

func NewPeerAccount(address []byte) (*peerAccount, error)

NewPeerAccount creates new simple account wrapper for an PeerAccountContainer (that has just been initialized)

func NewUserAccount

func NewUserAccount(address []byte) (*userAccount, error)

NewUserAccount creates new simple account wrapper for an AccountContainer (that has just been initialized)

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)
	LoadAccount(address []byte) (vmcommon.AccountHandler, error)
	SaveAccount(account vmcommon.AccountHandler) error
	RemoveAccount(address []byte) error
	Commit() ([]byte, error)
	JournalLen() int
	RevertToSnapshot(snapshot int) error
	GetNumCheckpoints() uint32
	GetCode(codeHash []byte) []byte
	RootHash() ([]byte, error)
	RecreateTrie(rootHash []byte) error
	PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
	CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
	SnapshotState(rootHash []byte)
	SetStateCheckpoint(rootHash []byte)
	IsPruningEnabled() bool
	GetAllLeaves(rootHash []byte) (chan core.KeyValueHolder, error)
	RecreateAllTries(rootHash []byte) (map[string]data.Trie, error)
	GetTrie(rootHash []byte) (data.Trie, error)
	Close() error
	IsInterfaceNil() bool
}

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

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(
	trie data.Trie,
	hasher hashing.Hasher,
	marshalizer marshal.Marshalizer,
	accountFactory AccountFactory,
	storagePruningManager StoragePruningManager,
) (*AccountsDB, error)

NewAccountsDB creates a new account manager

func (*AccountsDB) CancelPrune

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

CancelPrune clears the trie's evictionWaitingList

func (*AccountsDB) Close added in v1.2.4

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) GetAllLeaves

func (adb *AccountsDB) GetAllLeaves(rootHash []byte) (chan core.KeyValueHolder, error)

GetAllLeaves returns all the leaves from a given rootHash

func (*AccountsDB) GetCode added in v1.1.22

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) GetNumCheckpoints added in v1.0.149

func (adb *AccountsDB) GetNumCheckpoints() uint32

GetNumCheckpoints returns the total number of state checkpoints

func (*AccountsDB) GetTrie added in v1.2.0

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

GetTrie returns the trie that has the given rootHash

func (*AccountsDB) ImportAccount added in v1.0.144

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) 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 data.TriePruningIdentifier)

PruneTrie removes old values from the trie database

func (*AccountsDB) RecreateAllTries added in v1.0.102

func (adb *AccountsDB) RecreateAllTries(rootHash []byte) (map[string]data.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) 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) SetStateCheckpoint

func (adb *AccountsDB) SetStateCheckpoint(rootHash []byte)

SetStateCheckpoint sets a checkpoint for the state trie

func (*AccountsDB) SnapshotState

func (adb *AccountsDB) SnapshotState(rootHash []byte)

SnapshotState triggers the snapshotting process of the state trie

type AccountsDBImporter added in v1.0.144

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

AccountsDBImporter is used in importing accounts

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 AtomicBuffer added in v1.2.4

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

AtomicBuffer is used to buffer byteArrays

type CodeEntry added in v1.0.133

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 added in v1.0.133

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

func (*CodeEntry) Equal added in v1.0.133

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

func (*CodeEntry) GetCode added in v1.0.133

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

func (*CodeEntry) GetNumReferences added in v1.0.133

func (m *CodeEntry) GetNumReferences() uint32

func (*CodeEntry) GoString added in v1.0.133

func (this *CodeEntry) GoString() string

func (*CodeEntry) Marshal added in v1.0.133

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

func (*CodeEntry) MarshalTo added in v1.0.133

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

func (*CodeEntry) MarshalToSizedBuffer added in v1.0.133

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

func (*CodeEntry) ProtoMessage added in v1.0.133

func (*CodeEntry) ProtoMessage()

func (*CodeEntry) Reset added in v1.0.133

func (m *CodeEntry) Reset()

func (*CodeEntry) Size added in v1.0.133

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

func (*CodeEntry) String added in v1.0.133

func (this *CodeEntry) String() string

func (*CodeEntry) Unmarshal added in v1.0.133

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

func (*CodeEntry) XXX_DiscardUnknown added in v1.0.133

func (m *CodeEntry) XXX_DiscardUnknown()

func (*CodeEntry) XXX_Marshal added in v1.0.133

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

func (*CodeEntry) XXX_Merge added in v1.0.133

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

func (*CodeEntry) XXX_Size added in v1.0.133

func (m *CodeEntry) XXX_Size() int

func (*CodeEntry) XXX_Unmarshal added in v1.0.133

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

type DBRemoveCacher added in v1.2.4

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

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

type DataTrieTracker

type DataTrieTracker interface {
	ClearDataCaches()
	DirtyData() map[string][]byte
	RetrieveValue(key []byte) ([]byte, error)
	SaveKeyValue(key []byte, value []byte) error
	SetDataTrie(tr data.Trie)
	DataTrie() data.Trie
	IsInterfaceNil() bool
}

DataTrieTracker models what how to manipulate data held by a SC account

type ErrMissingTrie

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

ErrMissingTrie is an error-compatible struct holding the root hash of the trie that is missing

func NewErrMissingTrie

func NewErrMissingTrie(rootHash []byte) *ErrMissingTrie

NewErrMissingTrie returns a new instantiated struct

func (*ErrMissingTrie) Error

func (e *ErrMissingTrie) Error() string

Error returns the error as string

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 PeerAccountData

type PeerAccountData struct {
	BLSPublicKey                        []byte        `protobuf:"bytes,1,opt,name=BLSPublicKey,proto3" json:"blsPublicKey"`
	RewardAddress                       []byte        `protobuf:"bytes,2,opt,name=RewardAddress,proto3" json:"rewardAddress,omitempty"`
	ShardId                             uint32        `protobuf:"varint,3,opt,name=ShardId,proto3" json:"shardId"`
	ValidatorSuccessRate                SignRate      `protobuf:"bytes,4,opt,name=ValidatorSuccessRate,proto3" json:"validatorSuccessRate"`
	LeaderSuccessRate                   SignRate      `protobuf:"bytes,5,opt,name=LeaderSuccessRate,proto3" json:"leaderSuccessRate"`
	ValidatorIgnoredSignaturesRate      uint32        `protobuf:"varint,6,opt,name=ValidatorIgnoredSignaturesRate,proto3" json:"validatorIgnoredSignaturesRate"`
	Rating                              uint32        `protobuf:"varint,7,opt,name=Rating,proto3" json:"rating"`
	TempRating                          uint32        `protobuf:"varint,8,opt,name=TempRating,proto3" json:"tempRating"`
	AccumulatedFees                     *math_big.Int `` /* 162-byte string literal not displayed */
	NumSelectedInSuccessBlocks          uint32        `protobuf:"varint,10,opt,name=NumSelectedInSuccessBlocks,proto3" json:"numSelectedInSuccessBlocks"`
	IndexInList                         uint32        `protobuf:"varint,11,opt,name=IndexInList,proto3" json:"indexInList"`
	List                                string        `protobuf:"bytes,12,opt,name=List,proto3" json:"list,omitempty"`
	ConsecutiveProposerMisses           uint32        `protobuf:"varint,13,opt,name=ConsecutiveProposerMisses,proto3" json:"consecutiveProposerMisses"`
	TotalValidatorSuccessRate           SignRate      `protobuf:"bytes,14,opt,name=TotalValidatorSuccessRate,proto3" json:"totalValidatorSuccessRate"`
	TotalLeaderSuccessRate              SignRate      `protobuf:"bytes,15,opt,name=TotalLeaderSuccessRate,proto3" json:"totalLeaderSuccessRate"`
	TotalValidatorIgnoredSignaturesRate uint32        `protobuf:"varint,16,opt,name=TotalValidatorIgnoredSignaturesRate,proto3" json:"totalValidatorIgnoredSignaturesRate"`
	Nonce                               uint64        `protobuf:"varint,17,opt,name=Nonce,proto3" json:"nonce"`
	UnStakedEpoch                       uint32        `protobuf:"varint,18,opt,name=UnStakedEpoch,proto3" json:"unStakedEpoch"`
}

PeerAccountData represents the data that defines the PeerAccount

func (*PeerAccountData) Descriptor

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

func (*PeerAccountData) Equal

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

func (*PeerAccountData) GetAccumulatedFees

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

func (*PeerAccountData) GetBLSPublicKey

func (m *PeerAccountData) GetBLSPublicKey() []byte

func (*PeerAccountData) GetConsecutiveProposerMisses added in v0.0.5

func (m *PeerAccountData) GetConsecutiveProposerMisses() uint32

func (*PeerAccountData) GetIndexInList added in v1.0.102

func (m *PeerAccountData) GetIndexInList() uint32

func (*PeerAccountData) GetLeaderSuccessRate

func (m *PeerAccountData) GetLeaderSuccessRate() SignRate

func (*PeerAccountData) GetList added in v1.0.102

func (m *PeerAccountData) GetList() string

func (*PeerAccountData) GetNonce

func (m *PeerAccountData) GetNonce() uint64

func (*PeerAccountData) GetNumSelectedInSuccessBlocks

func (m *PeerAccountData) GetNumSelectedInSuccessBlocks() uint32

func (*PeerAccountData) GetRating

func (m *PeerAccountData) GetRating() uint32

func (*PeerAccountData) GetRewardAddress

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

func (*PeerAccountData) GetShardId added in v1.0.110

func (m *PeerAccountData) GetShardId() uint32

func (*PeerAccountData) GetTempRating

func (m *PeerAccountData) GetTempRating() uint32

func (*PeerAccountData) GetTotalLeaderSuccessRate added in v0.0.5

func (m *PeerAccountData) GetTotalLeaderSuccessRate() SignRate

func (*PeerAccountData) GetTotalValidatorIgnoredSignaturesRate added in v1.0.149

func (m *PeerAccountData) GetTotalValidatorIgnoredSignaturesRate() uint32

func (*PeerAccountData) GetTotalValidatorSuccessRate added in v0.0.5

func (m *PeerAccountData) GetTotalValidatorSuccessRate() SignRate

func (*PeerAccountData) GetUnStakedEpoch added in v1.0.110

func (m *PeerAccountData) GetUnStakedEpoch() uint32

func (*PeerAccountData) GetValidatorIgnoredSignaturesRate added in v1.0.149

func (m *PeerAccountData) GetValidatorIgnoredSignaturesRate() uint32

func (*PeerAccountData) GetValidatorSuccessRate

func (m *PeerAccountData) GetValidatorSuccessRate() SignRate

func (*PeerAccountData) GoString

func (this *PeerAccountData) GoString() string

func (*PeerAccountData) Marshal

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

func (*PeerAccountData) MarshalTo

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

func (*PeerAccountData) MarshalToSizedBuffer

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

func (*PeerAccountData) ProtoMessage

func (*PeerAccountData) ProtoMessage()

func (*PeerAccountData) Reset

func (m *PeerAccountData) Reset()

func (*PeerAccountData) Size

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

func (*PeerAccountData) String

func (this *PeerAccountData) String() string

func (*PeerAccountData) Unmarshal

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

func (*PeerAccountData) XXX_DiscardUnknown

func (m *PeerAccountData) XXX_DiscardUnknown()

func (*PeerAccountData) XXX_Marshal

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

func (*PeerAccountData) XXX_Merge

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

func (*PeerAccountData) XXX_Size

func (m *PeerAccountData) XXX_Size() int

func (*PeerAccountData) XXX_Unmarshal

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

type PeerAccountHandler

type PeerAccountHandler interface {
	GetBLSPublicKey() []byte
	SetBLSPublicKey([]byte) error
	GetRewardAddress() []byte
	SetRewardAddress([]byte) error
	GetAccumulatedFees() *big.Int
	AddToAccumulatedFees(*big.Int)
	GetList() string
	GetIndexInList() 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)
	GetRating() uint32
	SetRating(uint32)
	GetTempRating() uint32
	SetTempRating(uint32)
	GetConsecutiveProposerMisses() uint32
	SetConsecutiveProposerMisses(uint322 uint32)
	ResetAtNewEpoch()
	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

type PeerAccountsDB

type PeerAccountsDB struct {
	*AccountsDB
}

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

func NewPeerAccountsDB

func NewPeerAccountsDB(
	trie data.Trie,
	hasher hashing.Hasher,
	marshalizer marshal.Marshalizer,
	accountFactory AccountFactory,
	storagePruningManager StoragePruningManager,
) (*PeerAccountsDB, error)

NewPeerAccountsDB creates a new account manager

func (*PeerAccountsDB) IsInterfaceNil added in v0.0.5

func (adb *PeerAccountsDB) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PeerAccountsDB) RecreateAllTries added in v1.0.102

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

RecreateAllTries recreates all the tries from the accounts DB

func (*PeerAccountsDB) SetStateCheckpoint added in v1.0.110

func (adb *PeerAccountsDB) SetStateCheckpoint(rootHash []byte)

SetStateCheckpoint triggers the checkpointing process of the state trie

func (*PeerAccountsDB) SnapshotState added in v1.0.102

func (adb *PeerAccountsDB) SnapshotState(rootHash []byte)

SnapshotState triggers the snapshotting process of the state trie

type PeerTypeInfo added in v1.0.117

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

PeerTypeInfo contains information related to the peertypes needed by the peerTypeProvider

type ShardValidatorInfo added in v0.0.5

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"`
}

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

func (*ShardValidatorInfo) Descriptor added in v0.0.5

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

func (*ShardValidatorInfo) Equal added in v0.0.5

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

func (*ShardValidatorInfo) GetIndex added in v0.0.5

func (m *ShardValidatorInfo) GetIndex() uint32

func (*ShardValidatorInfo) GetList added in v0.0.5

func (m *ShardValidatorInfo) GetList() string

func (*ShardValidatorInfo) GetPublicKey added in v0.0.5

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

func (*ShardValidatorInfo) GetShardId added in v0.0.5

func (m *ShardValidatorInfo) GetShardId() uint32

func (*ShardValidatorInfo) GetTempRating added in v0.0.5

func (m *ShardValidatorInfo) GetTempRating() uint32

func (*ShardValidatorInfo) GoString added in v0.0.5

func (this *ShardValidatorInfo) GoString() string

func (*ShardValidatorInfo) IsInterfaceNil added in v0.0.5

func (svi *ShardValidatorInfo) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardValidatorInfo) Marshal added in v0.0.5

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

func (*ShardValidatorInfo) MarshalTo added in v0.0.5

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

func (*ShardValidatorInfo) MarshalToSizedBuffer added in v0.0.5

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

func (*ShardValidatorInfo) ProtoMessage added in v0.0.5

func (*ShardValidatorInfo) ProtoMessage()

func (*ShardValidatorInfo) Reset added in v0.0.5

func (m *ShardValidatorInfo) Reset()

func (*ShardValidatorInfo) Size added in v0.0.5

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

func (*ShardValidatorInfo) String added in v0.0.5

func (this *ShardValidatorInfo) String() string

func (*ShardValidatorInfo) Unmarshal added in v0.0.5

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

func (*ShardValidatorInfo) XXX_DiscardUnknown added in v0.0.5

func (m *ShardValidatorInfo) XXX_DiscardUnknown()

func (*ShardValidatorInfo) XXX_Marshal added in v0.0.5

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

func (*ShardValidatorInfo) XXX_Merge added in v0.0.5

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

func (*ShardValidatorInfo) XXX_Size added in v0.0.5

func (m *ShardValidatorInfo) XXX_Size() int

func (*ShardValidatorInfo) XXX_Unmarshal added in v0.0.5

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

type SignRate

type SignRate struct {
	NumSuccess uint32 `protobuf:"varint,1,opt,name=NumSuccess,proto3" json:"NumSuccess,omitempty"`
	NumFailure uint32 `protobuf:"varint,2,opt,name=NumFailure,proto3" json:"NumFailure,omitempty"`
}

SignRate is used to keep the number of success and failed signings

func (*SignRate) Descriptor

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

func (*SignRate) Equal

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

func (*SignRate) GetNumFailure added in v0.0.5

func (m *SignRate) GetNumFailure() uint32

func (*SignRate) GetNumSuccess added in v0.0.5

func (m *SignRate) GetNumSuccess() uint32

func (*SignRate) GoString

func (this *SignRate) GoString() string

func (*SignRate) Marshal

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

func (*SignRate) MarshalTo

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

func (*SignRate) MarshalToSizedBuffer

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

func (*SignRate) ProtoMessage

func (*SignRate) ProtoMessage()

func (*SignRate) Reset

func (m *SignRate) Reset()

func (*SignRate) Size

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

func (*SignRate) String

func (this *SignRate) String() string

func (*SignRate) Unmarshal

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

func (*SignRate) XXX_DiscardUnknown

func (m *SignRate) XXX_DiscardUnknown()

func (*SignRate) XXX_Marshal

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

func (*SignRate) XXX_Merge

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

func (*SignRate) XXX_Size

func (m *SignRate) XXX_Size() int

func (*SignRate) XXX_Unmarshal

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

type StoragePruningManager added in v1.2.4

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

StoragePruningManager is used to manage all state pruning operations

type TrackableDataTrie

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

TrackableDataTrie wraps a PatriciaMerkelTrie adding modifying data capabilities

func NewTrackableDataTrie

func NewTrackableDataTrie(identifier []byte, tr data.Trie) *TrackableDataTrie

NewTrackableDataTrie returns an instance of DataTrieTracker

func (*TrackableDataTrie) ClearDataCaches

func (tdaw *TrackableDataTrie) ClearDataCaches()

ClearDataCaches empties the dirtyData map and original map

func (*TrackableDataTrie) DataTrie

func (tdaw *TrackableDataTrie) DataTrie() data.Trie

DataTrie sets the internal data trie

func (*TrackableDataTrie) DirtyData

func (tdaw *TrackableDataTrie) DirtyData() map[string][]byte

DirtyData returns the map of (key, value) pairs that contain the data needed to be saved in the data trie

func (*TrackableDataTrie) IsInterfaceNil

func (tdaw *TrackableDataTrie) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TrackableDataTrie) RetrieveValue

func (tdaw *TrackableDataTrie) RetrieveValue(key []byte) ([]byte, error)

RetrieveValue fetches the value from a particular key searching the account data store The search starts with dirty map, continues with original map and ends with the trie Data must have been retrieved from its trie

func (*TrackableDataTrie) SaveKeyValue

func (tdaw *TrackableDataTrie) SaveKeyValue(key []byte, value []byte) error

SaveKeyValue stores in dirtyData the data keys "touched" It does not care if the data is really dirty as calling this check here will be sub-optimal

func (*TrackableDataTrie) SetDataTrie

func (tdaw *TrackableDataTrie) SetDataTrie(tr data.Trie)

SetDataTrie sets the internal data trie

type TriesHolder

type TriesHolder interface {
	Put([]byte, data.Trie)
	Replace(key []byte, tr data.Trie)
	Get([]byte) data.Trie
	GetAll() []data.Trie
	Reset()
	IsInterfaceNil() bool
}

TriesHolder is used to store multiple tries

type Updater

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

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

type UserAccountData

type UserAccountData struct {
	Nonce           uint64        `protobuf:"varint,1,opt,name=Nonce,proto3" json:"nonce"`
	Balance         *math_big.Int `` /* 146-byte string literal not displayed */
	CodeHash        []byte        `protobuf:"bytes,3,opt,name=CodeHash,proto3" json:"codeHash,omitempty"`
	RootHash        []byte        `protobuf:"bytes,4,opt,name=RootHash,proto3" json:"rootHash,omitempty"`
	Address         []byte        `protobuf:"bytes,5,opt,name=Address,proto3" json:"address,omitempty"`
	DeveloperReward *math_big.Int `` /* 162-byte string literal not displayed */
	OwnerAddress    []byte        `protobuf:"bytes,7,opt,name=OwnerAddress,proto3" json:"ownerAddress,omitempty"`
	UserName        []byte        `protobuf:"bytes,8,opt,name=UserName,proto3" json:"userName,omitempty"`
	CodeMetadata    []byte        `protobuf:"bytes,9,opt,name=CodeMetadata,proto3" json:"codeMetadata,omitempty"`
}

func (*UserAccountData) Descriptor

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

func (*UserAccountData) Equal

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

func (*UserAccountData) GetAddress

func (m *UserAccountData) GetAddress() []byte

func (*UserAccountData) GetBalance

func (m *UserAccountData) GetBalance() *math_big.Int

func (*UserAccountData) GetCodeHash

func (m *UserAccountData) GetCodeHash() []byte

func (*UserAccountData) GetCodeMetadata added in v1.0.103

func (m *UserAccountData) GetCodeMetadata() []byte

func (*UserAccountData) GetDeveloperReward

func (m *UserAccountData) GetDeveloperReward() *math_big.Int

func (*UserAccountData) GetNonce

func (m *UserAccountData) GetNonce() uint64

func (*UserAccountData) GetOwnerAddress

func (m *UserAccountData) GetOwnerAddress() []byte

func (*UserAccountData) GetRootHash

func (m *UserAccountData) GetRootHash() []byte

func (*UserAccountData) GetUserName added in v1.0.103

func (m *UserAccountData) GetUserName() []byte

func (*UserAccountData) GoString

func (this *UserAccountData) GoString() string

func (*UserAccountData) Marshal

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

func (*UserAccountData) MarshalTo

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

func (*UserAccountData) MarshalToSizedBuffer

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

func (*UserAccountData) ProtoMessage

func (*UserAccountData) ProtoMessage()

func (*UserAccountData) Reset

func (m *UserAccountData) Reset()

func (*UserAccountData) Size

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

func (*UserAccountData) String

func (this *UserAccountData) String() string

func (*UserAccountData) Unmarshal

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

func (*UserAccountData) XXX_DiscardUnknown

func (m *UserAccountData) XXX_DiscardUnknown()

func (*UserAccountData) XXX_Marshal

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

func (*UserAccountData) XXX_Merge

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

func (*UserAccountData) XXX_Size

func (m *UserAccountData) XXX_Size() int

func (*UserAccountData) XXX_Unmarshal

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

type UserAccountHandler

type UserAccountHandler interface {
	SetCode(code []byte)
	SetCodeMetadata(codeMetadata []byte)
	GetCodeMetadata() []byte
	SetCodeHash([]byte)
	GetCodeHash() []byte
	SetRootHash([]byte)
	GetRootHash() []byte
	SetDataTrie(trie data.Trie)
	DataTrie() data.Trie
	DataTrieTracker() DataTrieTracker
	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
	vmcommon.AccountHandler
}

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

type ValidatorApiResponse

type ValidatorApiResponse struct {
	TempRating                         float32 `protobuf:"fixed32,1,opt,name=TempRating,proto3" json:"tempRating"`
	NumLeaderSuccess                   uint32  `protobuf:"varint,2,opt,name=NumLeaderSuccess,proto3" json:"numLeaderSuccess"`
	NumLeaderFailure                   uint32  `protobuf:"varint,3,opt,name=NumLeaderFailure,proto3" json:"numLeaderFailure"`
	NumValidatorSuccess                uint32  `protobuf:"varint,4,opt,name=NumValidatorSuccess,proto3" json:"numValidatorSuccess"`
	NumValidatorFailure                uint32  `protobuf:"varint,5,opt,name=NumValidatorFailure,proto3" json:"numValidatorFailure"`
	NumValidatorIgnoredSignatures      uint32  `protobuf:"varint,6,opt,name=NumValidatorIgnoredSignatures,proto3" json:"numValidatorIgnoredSignatures"`
	Rating                             float32 `protobuf:"fixed32,7,opt,name=Rating,proto3" json:"rating"`
	RatingModifier                     float32 `protobuf:"fixed32,8,opt,name=RatingModifier,proto3" json:"ratingModifier"`
	TotalNumLeaderSuccess              uint32  `protobuf:"varint,9,opt,name=TotalNumLeaderSuccess,proto3" json:"totalNumLeaderSuccess"`
	TotalNumLeaderFailure              uint32  `protobuf:"varint,10,opt,name=TotalNumLeaderFailure,proto3" json:"totalNumLeaderFailure"`
	TotalNumValidatorSuccess           uint32  `protobuf:"varint,11,opt,name=TotalNumValidatorSuccess,proto3" json:"totalNumValidatorSuccess"`
	TotalNumValidatorFailure           uint32  `protobuf:"varint,12,opt,name=TotalNumValidatorFailure,proto3" json:"totalNumValidatorFailure"`
	TotalNumValidatorIgnoredSignatures uint32  `protobuf:"varint,13,opt,name=TotalNumValidatorIgnoredSignatures,proto3" json:"totalNumValidatorIgnoredSignatures"`
	ShardId                            uint32  `protobuf:"varint,14,opt,name=ShardId,proto3" json:"shardId"`
	ValidatorStatus                    string  `protobuf:"bytes,15,opt,name=ValidatorStatus,proto3" json:"validatorStatus,omitempty"`
}

ValidatorApiResponse represents the data which is fetched from each validator for returning it in API call

func (*ValidatorApiResponse) Descriptor

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

func (*ValidatorApiResponse) Equal

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

func (*ValidatorApiResponse) GetNumLeaderFailure added in v0.0.5

func (m *ValidatorApiResponse) GetNumLeaderFailure() uint32

func (*ValidatorApiResponse) GetNumLeaderSuccess added in v0.0.5

func (m *ValidatorApiResponse) GetNumLeaderSuccess() uint32

func (*ValidatorApiResponse) GetNumValidatorFailure added in v0.0.5

func (m *ValidatorApiResponse) GetNumValidatorFailure() uint32

func (*ValidatorApiResponse) GetNumValidatorIgnoredSignatures added in v1.0.149

func (m *ValidatorApiResponse) GetNumValidatorIgnoredSignatures() uint32

func (*ValidatorApiResponse) GetNumValidatorSuccess added in v0.0.5

func (m *ValidatorApiResponse) GetNumValidatorSuccess() uint32

func (*ValidatorApiResponse) GetRating

func (m *ValidatorApiResponse) GetRating() float32

func (*ValidatorApiResponse) GetRatingModifier added in v1.0.106

func (m *ValidatorApiResponse) GetRatingModifier() float32

func (*ValidatorApiResponse) GetShardId added in v1.0.120

func (m *ValidatorApiResponse) GetShardId() uint32

func (*ValidatorApiResponse) GetTempRating

func (m *ValidatorApiResponse) GetTempRating() float32

func (*ValidatorApiResponse) GetTotalNumLeaderFailure added in v0.0.5

func (m *ValidatorApiResponse) GetTotalNumLeaderFailure() uint32

func (*ValidatorApiResponse) GetTotalNumLeaderSuccess added in v0.0.5

func (m *ValidatorApiResponse) GetTotalNumLeaderSuccess() uint32

func (*ValidatorApiResponse) GetTotalNumValidatorFailure added in v0.0.5

func (m *ValidatorApiResponse) GetTotalNumValidatorFailure() uint32

func (*ValidatorApiResponse) GetTotalNumValidatorIgnoredSignatures added in v1.0.149

func (m *ValidatorApiResponse) GetTotalNumValidatorIgnoredSignatures() uint32

func (*ValidatorApiResponse) GetTotalNumValidatorSuccess added in v0.0.5

func (m *ValidatorApiResponse) GetTotalNumValidatorSuccess() uint32

func (*ValidatorApiResponse) GetValidatorStatus added in v1.0.120

func (m *ValidatorApiResponse) GetValidatorStatus() string

func (*ValidatorApiResponse) GoString

func (this *ValidatorApiResponse) GoString() string

func (*ValidatorApiResponse) Marshal

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

func (*ValidatorApiResponse) MarshalTo

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

func (*ValidatorApiResponse) MarshalToSizedBuffer

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

func (*ValidatorApiResponse) ProtoMessage

func (*ValidatorApiResponse) ProtoMessage()

func (*ValidatorApiResponse) Reset

func (m *ValidatorApiResponse) Reset()

func (*ValidatorApiResponse) Size

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

func (*ValidatorApiResponse) String

func (this *ValidatorApiResponse) String() string

func (*ValidatorApiResponse) Unmarshal

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

func (*ValidatorApiResponse) XXX_DiscardUnknown

func (m *ValidatorApiResponse) XXX_DiscardUnknown()

func (*ValidatorApiResponse) XXX_Marshal

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

func (*ValidatorApiResponse) XXX_Merge

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

func (*ValidatorApiResponse) XXX_Size

func (m *ValidatorApiResponse) XXX_Size() int

func (*ValidatorApiResponse) XXX_Unmarshal

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

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 `` /* 163-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"`
}

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) GetPublicKey

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

func (*ValidatorInfo) GetRating

func (m *ValidatorInfo) GetRating() uint32

func (*ValidatorInfo) GetRatingModifier added in v1.0.106

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 added in v0.0.5

func (m *ValidatorInfo) GetTotalLeaderFailure() uint32

func (*ValidatorInfo) GetTotalLeaderSuccess added in v0.0.5

func (m *ValidatorInfo) GetTotalLeaderSuccess() uint32

func (*ValidatorInfo) GetTotalValidatorFailure added in v0.0.5

func (m *ValidatorInfo) GetTotalValidatorFailure() uint32

func (*ValidatorInfo) GetTotalValidatorIgnoredSignatures added in v1.0.149

func (m *ValidatorInfo) GetTotalValidatorIgnoredSignatures() uint32

func (*ValidatorInfo) GetTotalValidatorSuccess added in v0.0.5

func (m *ValidatorInfo) GetTotalValidatorSuccess() uint32

func (*ValidatorInfo) GetValidatorFailure

func (m *ValidatorInfo) GetValidatorFailure() uint32

func (*ValidatorInfo) GetValidatorIgnoredSignatures added in v1.0.149

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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