handler

package
v0.3.1-0...-684a909 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsProvingWindowExpired

func IsProvingWindowExpired(
	metadata metadata.TaikoBlockMetaData,
	tiers []*rpc.TierProviderTierWithID,
) (bool, time.Time, time.Duration, error)

IsProvingWindowExpired returns true as the first return parameter if the assigned prover proving window of the given proposed block is expired, and the second return parameter is the time remaining til proving window is expired.

Types

type AssignmentExpiredEventHandler

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

AssignmentExpiredEventHandler is responsible for handling the expiration of proof assignments.

func NewAssignmentExpiredEventHandler

func NewAssignmentExpiredEventHandler(
	rpc *rpc.Client,
	proverAddress common.Address,
	proverSetAddress common.Address,
	proofSubmissionCh chan *proofProducer.ProofRequestBody,
	proofContestCh chan *proofProducer.ContestRequestBody,
	contesterMode bool,
	isGuardian bool,
) *AssignmentExpiredEventHandler

NewAssignmentExpiredEventHandler creates a new AssignmentExpiredEventHandler instance.

func (*AssignmentExpiredEventHandler) Handle

Handle implements the AssignmentExpiredHandler interface.

type AssignmentExpiredHandler

type AssignmentExpiredHandler interface {
	Handle(ctx context.Context, meta metadata.TaikoBlockMetaData) error
}

AssignmentExpiredHandler is the interface for handling the proof assignment expiration.

type BlockProposedEventHandler

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

BlockProposedEventHandler is responsible for handling the BlockProposed event as a prover.

func NewBlockProposedEventHandler

func NewBlockProposedEventHandler(opts *NewBlockProposedEventHandlerOps) *BlockProposedEventHandler

NewBlockProposedEventHandler creates a new BlockProposedEventHandler instance.

func (*BlockProposedEventHandler) Handle

Handle implements the BlockProposedHandler interface.

type BlockProposedGuaridanEventHandler

type BlockProposedGuaridanEventHandler struct {
	*BlockProposedEventHandler
	GuardianProverHeartbeater guardianProverHeartbeater.BlockSenderHeartbeater
}

BlockProposedGuaridanEventHandler is responsible for handling the BlockProposed event as a guardian prover.

func NewBlockProposedEventGuardianHandler

func NewBlockProposedEventGuardianHandler(
	opts *NewBlockProposedGuardianEventHandlerOps,
) *BlockProposedGuaridanEventHandler

NewBlockProposedEventGuardianHandler creates a new BlockProposedEventHandler instance.

func (*BlockProposedGuaridanEventHandler) Handle

Handle implements the BlockProposedHandler interface.

type BlockProposedHandler

type BlockProposedHandler interface {
	Handle(ctx context.Context,
		meta metadata.TaikoBlockMetaData,
		end eventIterator.EndBlockProposedEventIterFunc,
	) error
}

BlockProposedHandler is the interface for handling `TaikoL1.BlockProposed` events.

type BlockVerifiedEventHandler

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

BlockVerifiedEventHandler is responsible for handling the BlockVerified event.

func NewBlockVerifiedEventHandler

func NewBlockVerifiedEventHandler(guardianProverAddress common.Address) *BlockVerifiedEventHandler

NewBlockVerifiedEventHandler creates a new BlockVerifiedEventHandler instance.

func (*BlockVerifiedEventHandler) Handle

Handle handles the BlockVerified event.

type BlockVerifiedHandler

type BlockVerifiedHandler interface {
	Handle(e *bindings.TaikoL1ClientBlockVerifiedV2)
}

BlockVerifiedHandler is the interface for handling `TaikoL1.BlockVerifiedV2` events.

type NewBlockProposedEventHandlerOps

type NewBlockProposedEventHandlerOps struct {
	SharedState           *state.SharedState
	ProverAddress         common.Address
	ProverSetAddress      common.Address
	RPC                   *rpc.Client
	ProofGenerationCh     chan *proofProducer.ProofWithHeader
	AssignmentExpiredCh   chan metadata.TaikoBlockMetaData
	ProofSubmissionCh     chan *proofProducer.ProofRequestBody
	ProofContestCh        chan *proofProducer.ContestRequestBody
	BackOffRetryInterval  time.Duration
	BackOffMaxRetrys      uint64
	ContesterMode         bool
	ProveUnassignedBlocks bool
}

NewBlockProposedEventHandlerOps is the options for creating a new BlockProposedEventHandler.

type NewBlockProposedGuardianEventHandlerOps

type NewBlockProposedGuardianEventHandlerOps struct {
	*NewBlockProposedEventHandlerOps
	GuardianProverHeartbeater guardianProverHeartbeater.BlockSenderHeartbeater
}

NewBlockProposedGuardianEventHandlerOps is the options for creating a new BlockProposedEventHandler.

type TransitionContestedEventHandler

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

TransitionContestedEventHandler is responsible for handling the TransitionContested event.

func NewTransitionContestedEventHandler

func NewTransitionContestedEventHandler(
	rpc *rpc.Client,
	proofSubmissionCh chan *proofProducer.ProofRequestBody,
	contesterMode bool,
) *TransitionContestedEventHandler

NewTransitionContestedEventHandler creates a new TransitionContestedEventHandler instance.

func (*TransitionContestedEventHandler) Handle

Handle implements the TransitionContestedHandler interface.

type TransitionContestedHandler

type TransitionContestedHandler interface {
	Handle(ctx context.Context, event *bindings.TaikoL1ClientTransitionContestedV2) error
}

TransitionContestedHandler is the interface for handling `TaikoL1.TransitionContestedV2` events.

type TransitionProvedEventHandler

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

TransitionProvedEventHandler is responsible for handling the TransitionProved event.

func NewTransitionProvedEventHandler

func NewTransitionProvedEventHandler(
	rpc *rpc.Client,
	proofContestCh chan *proofProducer.ContestRequestBody,
	proofSubmissionCh chan *proofProducer.ProofRequestBody,
	contesterMode bool,
	isGuardian bool,
) *TransitionProvedEventHandler

NewTransitionProvedEventHandler creates a new TransitionProvedEventHandler instance.

func (*TransitionProvedEventHandler) Handle

Handle implements the TransitionProvedHandler interface.

type TransitionProvedHandler

type TransitionProvedHandler interface {
	Handle(ctx context.Context, event *bindings.TaikoL1ClientTransitionProvedV2) error
}

TransitionProvedHandler is the interface for handling `TaikoL1.TransitionProvedV2` events.

Jump to

Keyboard shortcuts

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