Documentation ¶
Index ¶
- func NullifyOffenders(queuedValidators safrole.ValidatorsData, offenders []ed25519.PublicKey) safrole.ValidatorsData
- func RandomListOfValidators(t *testing.T) safrole.ValidatorsData
- func RandomTicket(t *testing.T) block.Ticket
- type ValidatorState
- type ValidatorStatistics
- type ValidatorStatisticsState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NullifyOffenders ¶
func NullifyOffenders(queuedValidators safrole.ValidatorsData, offenders []ed25519.PublicKey) safrole.ValidatorsData
Implements equation 59 from the graypaper, i.e Φ(k). If any of the queued validator data matches the offenders list (ψ′), all the keys for that validator are zero'd out.
func RandomListOfValidators ¶
func RandomListOfValidators(t *testing.T) safrole.ValidatorsData
Types ¶
type ValidatorState ¶
type ValidatorState struct { CurrentValidators safrole.ValidatorsData // CurrentValidators mapping (κ) Validator keys and metadata currently active. ArchivedValidators safrole.ValidatorsData // Archived validators (λ) Validator keys and metadata which were active in the prior epoch. QueuedValidators safrole.ValidatorsData // Enqueued validators (ι) Validator keys and metadata to be drawn from next. SafroleState safrole.State // Safrole State (𝛾) (state of block-production algorithm) }
ValidatorState represents the state related to validators
func SetupValidatorState ¶
func SetupValidatorState(t *testing.T) *ValidatorState
type ValidatorStatistics ¶
type ValidatorStatistics struct { NumOfBlocks uint32 // Number of blocks (b) - The number of blocks produced by the validator. NumOfTickets uint64 // Number of tickets (t) - The number of tickets introduced by the validator. NumOfPreimages uint64 // Number of preimages (p) - The number of preimages introduced by the validator. NumOfBytesAllPreimages uint64 // Number of bytes across all preimages (d) - The total number of octets across all preimages introduced by the validator. NumOfGuaranteedReports uint64 // Number of guaranteed reports (g) - The number of reports guaranteed by the validator. NumOfAvailabilityAssurances uint64 // Number of availability assurances (a) - The number of assurances of availability made by the validator. }
type ValidatorStatisticsState ¶
type ValidatorStatisticsState [2][common.NumberOfValidators]ValidatorStatistics // Completed statistics (π[0]) - The activity statistics for the validators which have completed their work. Present statistics (π[1]) - The activity statistics for the validators which are currently being accumulated.
ValidatorStatisticsState represents the statistics related to validators.
Click to show internal directories.
Click to hide internal directories.