Documentation ¶
Index ¶
- type AttackerCommand
- type AttackerResponse
- type ClientInfo
- type ProposerAtts
- func (a ProposerAtts) Dedup() (ProposerAtts, error)
- func (a ProposerAtts) Filter(ctx context.Context, st state.BeaconState) (ProposerAtts, ProposerAtts)
- func (a ProposerAtts) LimitToMaxAttestations() ProposerAtts
- func (a ProposerAtts) SortByProfitability() (ProposerAtts, error)
- func (a ProposerAtts) SortByProfitabilityUsingMaxCover() (ProposerAtts, error)
- type RoleType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttackerCommand ¶
type AttackerCommand int
const ( CMD_NULL AttackerCommand = iota CMD_CONTINUE CMD_RETURN CMD_ABORT CMD_SKIP CMD_ROLE_TO_NORMAL // 角色转换为普通节点 CMD_ROLE_TO_ATTACKER // 角色转换为攻击者 CMD_EXIT CMD_UPDATE_STATE )
type AttackerResponse ¶
type AttackerResponse struct { Cmd AttackerCommand `json:"cmd"` Result string `json:"result"` }
type ClientInfo ¶
func ToClientInfo ¶
func ToClientInfo(cliInfo string) ClientInfo
type ProposerAtts ¶ added in v0.0.10
type ProposerAtts []*ethpb.Attestation
func (ProposerAtts) Dedup ¶ added in v0.0.10
func (a ProposerAtts) Dedup() (ProposerAtts, error)
Dedup removes duplicate attestations (ones with the same bits set on). Important: not only exact duplicates are removed, but proper subsets are removed too (their known bits are redundant and are already contained in their supersets).
func (ProposerAtts) Filter ¶ added in v0.0.10
func (a ProposerAtts) Filter(ctx context.Context, st state.BeaconState) (ProposerAtts, ProposerAtts)
Filter separates attestation list into two groups: valid and invalid attestations. The first group passes the all the required checks for attestation to be considered for proposing. And attestations from the second group should be deleted.
func (ProposerAtts) LimitToMaxAttestations ¶ added in v0.0.10
func (a ProposerAtts) LimitToMaxAttestations() ProposerAtts
LimitToMaxAttestations limits attestations to maximum attestations per block.
func (ProposerAtts) SortByProfitability ¶ added in v0.0.10
func (a ProposerAtts) SortByProfitability() (ProposerAtts, error)
SortByProfitability orders attestations by highest slot and by highest aggregation bit count.
func (ProposerAtts) SortByProfitabilityUsingMaxCover ¶ added in v0.0.10
func (a ProposerAtts) SortByProfitabilityUsingMaxCover() (ProposerAtts, error)
SortByProfitabilityUsingMaxCover orders attestations by highest slot and by highest aggregation bit count. Duplicate bits are counted only once, using max-cover algorithm.