types

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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

type ClientInfo struct {
	UUID           string `json:"uuid"`
	ValidatorIndex int    `json:"validatorIndex"`
}

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

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.

type RoleType

type RoleType int
const (
	NormalRole RoleType = iota
	AttackerRole
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL