backend

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: MIT Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

type Executor added in v1.11.0

type Executor interface {
	Start()
}

type Metrics

type Metrics interface {
	CacheAdd(chainID eth.ChainID, label string, cacheSize int, evicted bool)
	CacheGet(chainID eth.ChainID, label string, hit bool)

	RecordCrossUnsafeRef(chainID eth.ChainID, ref eth.BlockRef)
	RecordCrossSafeRef(chainID eth.ChainID, ref eth.BlockRef)

	RecordDBEntryCount(chainID eth.ChainID, kind string, count int64)
	RecordDBSearchEntriesRead(chainID eth.ChainID, count int64)

	opmetrics.RPCMetricer
	event.Metrics
}

type MockBackend

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

func NewMockBackend

func NewMockBackend() *MockBackend

func (*MockBackend) AddL2RPC added in v1.9.3

func (m *MockBackend) AddL2RPC(ctx context.Context, rpc string, jwtSecret eth.Bytes32) error

func (*MockBackend) AllSafeDerivedAt added in v1.11.0

func (m *MockBackend) AllSafeDerivedAt(ctx context.Context, source eth.BlockID) (derived map[eth.ChainID]eth.BlockID, err error)

func (*MockBackend) CheckAccessList added in v1.12.2

func (m *MockBackend) CheckAccessList(ctx context.Context, inboxEntries []common.Hash,
	minSafety types.SafetyLevel, executingDescriptor types.ExecutingDescriptor) error

func (*MockBackend) Close

func (m *MockBackend) Close() error

func (*MockBackend) CrossDerivedToSource added in v1.11.0

func (m *MockBackend) CrossDerivedToSource(ctx context.Context, chainID eth.ChainID, derived eth.BlockID) (source eth.BlockRef, err error)

func (*MockBackend) CrossSafe added in v1.11.0

func (m *MockBackend) CrossSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)

func (*MockBackend) Finalized added in v1.9.5

func (m *MockBackend) Finalized(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)

func (*MockBackend) FinalizedL1 added in v1.11.0

func (m *MockBackend) FinalizedL1(ctx context.Context) (eth.BlockRef, error)

func (*MockBackend) LocalUnsafe added in v1.11.0

func (m *MockBackend) LocalUnsafe(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)

func (*MockBackend) Start

func (m *MockBackend) Start(ctx context.Context) error

func (*MockBackend) Stop

func (m *MockBackend) Stop(ctx context.Context) error

func (*MockBackend) SuperRootAtTimestamp added in v1.11.0

func (m *MockBackend) SuperRootAtTimestamp(ctx context.Context, timestamp hexutil.Uint64) (eth.SuperRootResponse, error)

func (*MockBackend) SyncStatus added in v1.11.0

func (m *MockBackend) SyncStatus(ctx context.Context) (eth.SupervisorSyncStatus, error)

type SupervisorBackend

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

func NewSupervisorBackend

func NewSupervisorBackend(ctx context.Context, logger log.Logger,
	m Metrics, cfg *config.Config, eventExec event.Executor) (*SupervisorBackend, error)

func (*SupervisorBackend) AddL2RPC added in v1.9.3

func (su *SupervisorBackend) AddL2RPC(ctx context.Context, rpc string, jwtSecret eth.Bytes32) error

AddL2RPC attaches an RPC as the RPC for the given chain, overriding the previous RPC source, if any.

func (*SupervisorBackend) AllSafeDerivedAt added in v1.11.0

func (su *SupervisorBackend) AllSafeDerivedAt(ctx context.Context, source eth.BlockID) (map[eth.ChainID]eth.BlockID, error)

AllSafeDerivedAt returns the last derived block for each chain, from the given L1 block

func (*SupervisorBackend) AttachEmitter added in v1.11.0

func (su *SupervisorBackend) AttachEmitter(em event.Emitter)

func (*SupervisorBackend) AttachL1Source added in v1.11.0

func (su *SupervisorBackend) AttachL1Source(source l1access.L1Source)

AttachL1Source attaches an L1 source to the L1 accessor if the L1 accessor does not exist, it is created if an L1 source is already attached, it is replaced

func (*SupervisorBackend) AttachProcessorSource added in v1.9.5

func (su *SupervisorBackend) AttachProcessorSource(chainID eth.ChainID, src processors.Source) error

func (*SupervisorBackend) AttachSyncNode added in v1.11.0

func (su *SupervisorBackend) AttachSyncNode(ctx context.Context, src syncnode.SyncNode, noSubscribe bool) (syncnode.Node, error)

AttachSyncNode attaches a node to be managed by the supervisor. If noSubscribe, the node is not actively polled/subscribed to, and requires manual Node.PullEvents calls.

func (*SupervisorBackend) AttachSyncSource added in v1.11.0

func (su *SupervisorBackend) AttachSyncSource(chainID eth.ChainID, src syncnode.SyncSource) error

func (*SupervisorBackend) CheckAccessList added in v1.12.2

func (su *SupervisorBackend) CheckAccessList(ctx context.Context, inboxEntries []common.Hash,
	minSafety types.SafetyLevel, executingDescriptor types.ExecutingDescriptor) error

func (*SupervisorBackend) CrossDerivedToSource added in v1.11.0

func (su *SupervisorBackend) CrossDerivedToSource(ctx context.Context, chainID eth.ChainID, derived eth.BlockID) (source eth.BlockRef, err error)

func (*SupervisorBackend) CrossSafe added in v1.11.0

func (su *SupervisorBackend) CrossSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)

func (*SupervisorBackend) CrossUnsafe added in v1.11.0

func (su *SupervisorBackend) CrossUnsafe(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)

func (*SupervisorBackend) DependencySet added in v1.9.5

func (su *SupervisorBackend) DependencySet() depset.DependencySet

func (*SupervisorBackend) Finalized added in v1.9.5

func (su *SupervisorBackend) Finalized(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)

func (*SupervisorBackend) FinalizedL1 added in v1.11.0

func (su *SupervisorBackend) FinalizedL1(ctx context.Context) (eth.BlockRef, error)

func (*SupervisorBackend) FindSealedBlock added in v1.12.0

func (su *SupervisorBackend) FindSealedBlock(ctx context.Context, chainID eth.ChainID, number uint64) (eth.BlockID, error)

func (*SupervisorBackend) IsCrossSafe added in v1.12.0

func (su *SupervisorBackend) IsCrossSafe(ctx context.Context, chainID eth.ChainID, block eth.BlockID) error

func (*SupervisorBackend) IsLocalSafe added in v1.12.0

func (su *SupervisorBackend) IsLocalSafe(ctx context.Context, chainID eth.ChainID, block eth.BlockID) error

func (*SupervisorBackend) IsLocalUnsafe added in v1.12.0

func (su *SupervisorBackend) IsLocalUnsafe(ctx context.Context, chainID eth.ChainID, block eth.BlockID) error

func (*SupervisorBackend) L1BlockRefByNumber added in v1.11.0

func (su *SupervisorBackend) L1BlockRefByNumber(ctx context.Context, number uint64) (eth.L1BlockRef, error)

func (*SupervisorBackend) LocalSafe added in v1.11.0

func (su *SupervisorBackend) LocalSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)

func (*SupervisorBackend) LocalUnsafe added in v1.11.0

func (su *SupervisorBackend) LocalUnsafe(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)

func (*SupervisorBackend) OnEvent added in v1.11.0

func (su *SupervisorBackend) OnEvent(ev event.Event) bool

func (*SupervisorBackend) PullFinalizedL1 added in v1.11.0

func (su *SupervisorBackend) PullFinalizedL1() error

PullFinalizedL1 makes the supervisor aware of the finalized L1 block. Exposed for testing purposes.

func (*SupervisorBackend) PullLatestL1 added in v1.11.0

func (su *SupervisorBackend) PullLatestL1() error

PullLatestL1 makes the supervisor aware of the latest L1 block. Exposed for testing purposes.

func (*SupervisorBackend) QueryAnchorpoint added in v1.11.2

func (su *SupervisorBackend) QueryAnchorpoint(chainID eth.ChainID, src syncnode.SyncNode) error

func (*SupervisorBackend) Rewind added in v1.11.0

func (su *SupervisorBackend) Rewind(chain eth.ChainID, block eth.BlockID) error

Rewind rolls back the state of the supervisor for the given chain.

func (*SupervisorBackend) SafeDerivedAt added in v1.11.0

func (su *SupervisorBackend) SafeDerivedAt(ctx context.Context, chainID eth.ChainID, source eth.BlockID) (eth.BlockID, error)

func (*SupervisorBackend) SetConfDepthL1 added in v1.11.0

func (su *SupervisorBackend) SetConfDepthL1(depth uint64)

SetConfDepthL1 changes the confirmation depth of the L1 chain that is accessible to the supervisor.

func (*SupervisorBackend) Start

func (su *SupervisorBackend) Start(ctx context.Context) error

func (*SupervisorBackend) Stop

func (su *SupervisorBackend) Stop(ctx context.Context) error

func (*SupervisorBackend) SuperRootAtTimestamp added in v1.11.0

func (su *SupervisorBackend) SuperRootAtTimestamp(ctx context.Context, timestamp hexutil.Uint64) (eth.SuperRootResponse, error)

func (*SupervisorBackend) SyncStatus added in v1.11.0

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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