validator

package
v0.0.0-...-4547e52 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: GPL-3.0, Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BridgeClient

type BridgeClient interface {
	GetRequiredStakeAmount(ctx context.Context) (*big.Int, error)
	GetStaker(ctx context.Context, addr common.Address) (bindings.IRollupStaker, error)
	GetAssertion(ctx context.Context, assertionID *big.Int) (bindings.IRollupAssertion, error)
	GetLastConfirmedAssertionID(ctx context.Context) (*big.Int, error)
	RequireFirstUnresolvedAssertionIsConfirmable(ctx context.Context) error
}

type Config

type Config interface {
	GetAccountAddr() common.Address
	GetValidationInterval() time.Duration
}

type EthState

type EthState interface {
	Head() types.BlockID
	Safe() types.BlockID
	Finalized() types.BlockID
}

type L2Client

type L2Client interface {
	EnsureDialed(ctx context.Context) error
	BlockNumber(ctx context.Context) (uint64, error)
	BlockByNumber(ctx context.Context, number *big.Int) (*ethTypes.Block, error)
	HeaderByTag(ctx context.Context, tag eth.BlockTag) (*ethTypes.Header, error)
}

type TxManager

type TxManager interface {
	Stake(ctx context.Context, stakeAmount *big.Int) (*ethTypes.Receipt, error)
	AdvanceStake(ctx context.Context, assertionID *big.Int) (*ethTypes.Receipt, error)
	CreateAssertion(ctx context.Context, vmHash common.Hash, inboxSize *big.Int) (*ethTypes.Receipt, error)
	ConfirmFirstUnresolvedAssertion(ctx context.Context) (*ethTypes.Receipt, error)
}

type Validator

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

func NewValidator

func NewValidator(
	cfg Config,
	l1TxMgr TxManager,
	l1BridgeClient BridgeClient,
	l1State EthState,
	l2Client L2Client,
) *Validator

func (*Validator) Start

func (v *Validator) Start(ctx context.Context, eg api.ErrGroup) error

Jump to

Keyboard shortcuts

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