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 ¶ 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 ConflictingVotes ¶ added in v1.3.11
type ConflictingVotes struct {
FirstVote Vote `json:"first-vote"`
SecondVote Vote `json:"second-vote"`
}
ConflictingVotes ..
type Evidence ¶ added in v1.3.3
type Evidence struct {
Moment
ConflictingVotes
Offender common.Address `json:"offender"`
}
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"`
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
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.