objects

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventInformation

type EventInformation struct {
	Name      string
	Processor EventProcessor
}

type EventMap

type EventMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewEventMap

func NewEventMap() *EventMap

func (*EventMap) Lookup

func (em *EventMap) Lookup(ID string) (*EventInformation, bool)

func (*EventMap) Register

func (em *EventMap) Register(ID, name string, fn EventProcessor) error

type EventProcessor

type EventProcessor func(eth layer1.Client, contracts layer1.AllSmartContracts, logger *logrus.Entry, state *MonitorState, log types.Log) error

type MonitorState

type MonitorState struct {
	sync.RWMutex           `json:"-"`
	Version                uint8                                 `json:"version"`
	CommunicationFailures  uint32                                `json:"communicationFailures"`
	EthereumInSync         bool                                  `json:"-"`
	HighestBlockProcessed  uint64                                `json:"highestBlockProcessed"`
	HighestBlockFinalized  uint64                                `json:"highestBlockFinalized"`
	HighestEpochProcessed  uint32                                `json:"highestEpochProcessed"`
	HighestEpochSeen       uint32                                `json:"highestEpochSeen"`
	EndpointInSync         bool                                  `json:"-"`
	LatestDepositProcessed uint32                                `json:"latestDepositProcessed"`
	LatestDepositSeen      uint32                                `json:"latestDepositSeen"`
	PeerCount              uint32                                `json:"peerCount"`
	IsInitialized          bool                                  `json:"-"`
	ValidatorSets          map[uint32]ValidatorSet               `json:"validatorSets"`
	Validators             map[uint32][]Validator                `json:"validators"`
	PotentialValidators    map[common.Address]PotentialValidator `json:"potentialValidators"`
	CanonicalVersion       bindings.CanonicalVersion             `json:"canonicalVersion"`
}

MonitorState contains info required to monitor Ethereum.

func GetMonitorState

func GetMonitorState(db *db.Database) (*MonitorState, error)

Get a copy of the monitor state that is saved on disk.

func NewMonitorState

func NewMonitorState() *MonitorState

func (*MonitorState) Clone

func (s *MonitorState) Clone() *MonitorState

Clone builds a deep copy of a small portion of state TODO Make this create a complete clone of state.

func (*MonitorState) Diff

func (s *MonitorState) Diff(o *MonitorState) (string, bool)

Diff builds a textual description between states.

func (*MonitorState) LoadState

func (s *MonitorState) LoadState(db *db.Database) error

func (*MonitorState) PersistState

func (mon *MonitorState) PersistState(db *db.Database) error

func (*MonitorState) String

func (s *MonitorState) String() string

type PotentialValidator

type PotentialValidator struct {
	Account common.Address `json:"account"`
	TokenID uint64         `json:"tokenID"`
}

Potential Validator contains information about a validators that entered the pool, but might not participated on ETHDKG yet.

type Validator

type Validator struct {
	Account   common.Address `json:"account"`
	Index     uint8          `json:"index"`
	SharedKey [4]*big.Int    `json:"shared_key"`
}

Validator contains information about a Validator that participated on ETHDKG.

type ValidatorSet

type ValidatorSet struct {
	ValidatorCount          uint8       `json:"validator_count"`
	GroupKey                [4]*big.Int `json:"group_key"`
	NotBeforeAliceNetHeight uint32      `json:"not_before_mad_net_height"`
}

ValidatorSet is summary information about a ValidatorSet that participated on ETHDKG.

Jump to

Keyboard shortcuts

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