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 ConflictingBallots
- type Evidence
- type Moment
- type Record
- type Records
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶ added in v1.3.3
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 ¶ added in v1.3.1
func Apply( chain staking.ValidatorSnapshotReader, state *state.DB, slashes Records, rate numeric.Dec, ) (*Application, error)
Apply ..
func (*Application) String ¶ added in v1.3.3
func (a *Application) String() string
type CommitteeReader ¶ added in v1.3.3
type CommitteeReader interface { Config() *params.ChainConfig ReadShardState(epoch *big.Int) (*shard.State, error) CurrentBlock() *types.Block }
CommitteeReader ..
type ConflictingBallots ¶ added in v1.3.3
type ConflictingBallots struct { AlreadyCastBallot votepower.Ballot `json:"already-cast-vote"` DoubleSignedBallot votepower.Ballot `json:"double-signed-vote"` }
ConflictingBallots ..
type Evidence ¶ added in v1.3.3
type Evidence struct { Moment ConflictingBallots }
Evidence ..
func (Evidence) MarshalJSON ¶ added in v1.3.3
MarshalJSON ..
type Moment ¶ added in v1.3.3
type Moment struct { Epoch *big.Int `json:"epoch"` TimeUnixNano *big.Int `json:"time-unix-nano"` ShardID uint32 `json:"shard-id"` }
Moment ..
type Record ¶
type Record struct { // the reporter who will get rewarded Evidence Evidence `json:"evidence"` Reporter common.Address `json:"reporter"` Offender common.Address `json:"offender"` }
Record is an proof of a slashing made by a witness of a double-signing event
func (Record) MarshalJSON ¶ added in v1.3.3
MarshalJSON ..
type Records ¶ added in v1.3.3
type Records []Record
Records ..
func (Records) SetDifference ¶ added in v1.3.4
SetDifference returns all the records that are in ys but not in r
Click to show internal directories.
Click to hide internal directories.