Documentation ¶
Index ¶
- func IsBanned(wrapper *staking.ValidatorWrapper) bool
- func Rate(votingPower *votepower.Roster, records Records) numeric.Dec
- func Verify(chain CommitteeReader, state *state.DB, candidate *Record) error
- type Application
- type CommitteeReader
- type ConflictingVotes
- type Evidence
- type Moment
- type Record
- type Records
- type Vote
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct { TotalSlashed *big.Int `json:"total-slashed"` TotalSnitchReward *big.Int `json:"total-snitch-reward"` }
Application tracks the slash application to state
func Apply ¶
func Apply( chain staking.ValidatorSnapshotReader, state *state.DB, slashes Records, rate numeric.Dec, ) (*Application, error)
Apply ..
func (*Application) String ¶
func (a *Application) String() string
type CommitteeReader ¶
type CommitteeReader interface { Config() *params.ChainConfig ReadShardState(epoch *big.Int) (*shard.State, error) CurrentBlock() *types.Block }
CommitteeReader ..
type ConflictingVotes ¶
type ConflictingVotes struct { FirstVote Vote `json:"first-vote"` SecondVote Vote `json:"second-vote"` }
ConflictingVotes ..
type Evidence ¶
type Evidence struct { Moment ConflictingVotes Offender common.Address `json:"offender"` }
Evidence ..
type Moment ¶
type Moment struct { Epoch *big.Int `json:"epoch"` ShardID uint32 `json:"shard-id"` Height uint64 `json:"height"` ViewID uint64 `json:"view-id"` }
Moment ..
type Record ¶
type Record struct { // the reporter who will get rewarded Evidence Evidence `json:"evidence"` Reporter common.Address `json:"reporter"` }
Record is an proof of a slashing made by a witness of a double-signing event
type Records ¶
type Records []Record
Records ..
func (Records) SetDifference ¶
SetDifference returns all the records that are in ys but not in r
Click to show internal directories.
Click to hide internal directories.