backend

package
v1.16.13 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnexpectedMinSafetyLevel = errors.New("unexpected min-safety level")
	ErrInternalBackendError     = errors.New("internal backend error")
)

Functions

This section is empty.

Types

type Config

type Config struct {
}

type Executor

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)

	RecordCrossUnsafe(chainID eth.ChainID, ref types.BlockSeal)
	RecordCrossSafe(chainID eth.ChainID, ref types.BlockSeal)
	RecordLocalSafe(chainID eth.ChainID, ref types.BlockSeal)
	RecordLocalUnsafe(chainID eth.ChainID, ref types.BlockSeal)

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

	RecordAccessListVerifyFailure(chainID eth.ChainID)

	opmetrics.RPCMetricer
	event.Metrics
}

type MockBackend

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

func NewMockBackend

func NewMockBackend() *MockBackend

func (*MockBackend) AddL2RPC

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

func (*MockBackend) AllSafeDerivedAt

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

func (*MockBackend) CheckAccessList

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

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

func (*MockBackend) CrossSafe

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

func (*MockBackend) Finalized

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

func (*MockBackend) FinalizedL1

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

func (*MockBackend) GetFailsafeEnabled

func (m *MockBackend) GetFailsafeEnabled(ctx context.Context) (bool, error)

func (*MockBackend) LocalSafe

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

func (*MockBackend) LocalUnsafe

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

func (*MockBackend) Rewind

func (m *MockBackend) Rewind(ctx context.Context, chain eth.ChainID, block eth.BlockID) error

func (*MockBackend) SetFailsafeEnabled

func (m *MockBackend) SetFailsafeEnabled(ctx context.Context, enabled bool) 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

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

func (*MockBackend) SyncStatus

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) ActivationBlock

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

func (*SupervisorBackend) AddL2RPC

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

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

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

func (*SupervisorBackend) AttachL1Source

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

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

func (*SupervisorBackend) AttachSyncNode

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

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

func (*SupervisorBackend) CheckAccessList

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

func (*SupervisorBackend) CrossDerivedToSource

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

func (*SupervisorBackend) CrossSafe

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

func (*SupervisorBackend) CrossUnsafe

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

func (*SupervisorBackend) DependencySet

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

func (*SupervisorBackend) Finalized

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

func (*SupervisorBackend) FinalizedL1

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

func (*SupervisorBackend) FindSealedBlock

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

func (*SupervisorBackend) GetFailsafeEnabled

func (su *SupervisorBackend) GetFailsafeEnabled(ctx context.Context) (bool, error)

GetFailsafeEnabled gets the current failsafe mode configuration for the supervisor.

func (*SupervisorBackend) IsCrossSafe

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

func (*SupervisorBackend) IsLocalSafe

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

func (*SupervisorBackend) IsLocalUnsafe

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

func (*SupervisorBackend) L1BlockRefByNumber

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

func (*SupervisorBackend) LocalSafe

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

func (*SupervisorBackend) LocalSafeDerivedAt

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

func (*SupervisorBackend) LocalUnsafe

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

func (*SupervisorBackend) OnEvent

func (su *SupervisorBackend) OnEvent(ctx context.Context, ev event.Event) bool

func (*SupervisorBackend) PullFinalizedL1

func (su *SupervisorBackend) PullFinalizedL1() error

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

func (*SupervisorBackend) PullLatestL1

func (su *SupervisorBackend) PullLatestL1() error

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

func (*SupervisorBackend) Rewind

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

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

func (*SupervisorBackend) SetConfDepthL1

func (su *SupervisorBackend) SetConfDepthL1(depth uint64)

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

func (*SupervisorBackend) SetFailsafeEnabled

func (su *SupervisorBackend) SetFailsafeEnabled(ctx context.Context, enabled bool) error

SetFailsafeEnabled sets the failsafe mode configuration for 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

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

func (*SupervisorBackend) SyncStatus

Directories

Path Synopsis
db
Package reads implements chain read-handles.
Package reads implements chain read-handles.

Jump to

Keyboard shortcuts

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