l1

package
v0.0.0-...-eb934a0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnectionTimeout = 30 * time.Second
	DefaultMaxBatchSize      = 100
)

Variables

View Source
var ZeroAddress common.Address

Functions

func QueryStateBatches

func QueryStateBatches(filterer *legacy_bindings.StateCommitmentChainFilterer, startHeight, endHeight uint64, ctx context.Context) (map[common.Hash][]db.StateBatch, error)

Types

type ConfirmedHeaderSelector

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

func NewConfirmedHeaderSelector

func NewConfirmedHeaderSelector(cfg HeaderSelectorConfig) (*ConfirmedHeaderSelector,
	error)

func (*ConfirmedHeaderSelector) NewHead

func (f *ConfirmedHeaderSelector) NewHead(
	ctx context.Context,
	lowest uint64,
	header *types.Header,
	client *rpc.Client,
) ([]*NewHeader, error)

type Driver

type Driver interface {
	// Name is an identifier used to prefix logs for a particular service.
	Name() string
}

Driver is an interface for indexing deposits from l1.

type HeaderSelectorConfig

type HeaderSelectorConfig struct {
	ConfDepth    uint64
	MaxBatchSize uint64
}

type IndexerStatus

type IndexerStatus struct {
	Synced  float64         `json:"synced"`
	Highest db.BlockLocator `json:"highest_block"`
}

type NewHeader

type NewHeader struct {
	types.Header
	Hash common.Hash
}

func HeadersByRange

func HeadersByRange(ctx context.Context, client *rpc.Client, startHeight uint64, count int) ([]*NewHeader, error)

func (*NewHeader) UnmarshalJSON

func (h *NewHeader) UnmarshalJSON(input []byte) error

type Service

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

func NewService

func NewService(cfg ServiceConfig) (*Service, error)

func (*Service) GetDeposits

func (s *Service) GetDeposits(w http.ResponseWriter, r *http.Request)

func (*Service) GetIndexerStatus

func (s *Service) GetIndexerStatus(w http.ResponseWriter, r *http.Request)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop()

func (*Service) Update

func (s *Service) Update(newHeader *types.Header) error

type ServiceConfig

type ServiceConfig struct {
	Context            context.Context
	Metrics            *metrics.Metrics
	L1Client           *ethclient.Client
	RawL1Client        *rpc.Client
	ChainID            *big.Int
	AddressManager     services.AddressManager
	ConfDepth          uint64
	MaxHeaderBatchSize uint64
	StartBlockNumber   uint64
	DB                 *db.Database
	Bedrock            bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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