handlers

package
v0.0.0-...-531134c Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const EXECUTION_STATE_ROOT_INDEX = 34

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockFetcher

type BlockFetcher interface {
	SignedBeaconBlock(ctx context.Context, opts *api.SignedBeaconBlockOpts) (*api.Response[*spec.VersionedSignedBeaconBlock], error)
}

type EventFetcher

type EventFetcher interface {
	FetchEventLogs(ctx context.Context, contractAddress common.Address, event string, startBlock *big.Int, endBlock *big.Int) ([]types.Log, error)
}

type PeriodStorer

type PeriodStorer interface {
	Period(domainID uint8) (*big.Int, error)
	StorePeriod(domainID uint8, period *big.Int) error
}

type Prover

type Prover interface {
	StepProof(args *prover.StepArgs) (*prover.EvmProof[evmMessage.SyncStepInput], error)
	RotateProof(args *prover.RotateArgs) (*prover.EvmProof[struct{}], error)
	StepArgs() (*prover.StepArgs, error)
	RotateArgs(epoch uint64) (*prover.RotateArgs, error)
}

type RotateHandler

type RotateHandler struct {
	// contains filtered or unexported fields
}

func NewRotateHandler

func NewRotateHandler(
	msgChan chan []*message.Message,
	periodStorer PeriodStorer,
	prover Prover,
	domainID uint8,
	domains []uint8,
	committeePeriodLenght uint64,
	latestPeriod *big.Int,
) *RotateHandler

func (*RotateHandler) HandleEvents

func (h *RotateHandler) HandleEvents(checkpoint *apiv1.Finality) error

HandleEvents checks if the current period is newer than the last stored period and rotates the committee if it is

type StepEventHandler

type StepEventHandler struct {
	// contains filtered or unexported fields
}

func NewStepEventHandler

func NewStepEventHandler(
	msgChan chan []*message.Message,
	eventFetcher EventFetcher,
	blockFetcher BlockFetcher,
	prover Prover,
	routerAddress common.Address,
	domainID uint8,
	domains []uint8,
) *StepEventHandler

func (*StepEventHandler) HandleEvents

func (h *StepEventHandler) HandleEvents(checkpoint *apiv1.Finality) error

HandleEvents executes the step for the latest finality checkpoint

type SyncCommitteeFetcher

type SyncCommitteeFetcher interface {
	SyncCommittee(ctx context.Context, opts *api.SyncCommitteeOpts) (*api.Response[*apiv1.SyncCommittee], error)
}

Jump to

Keyboard shortcuts

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