Documentation
¶
Index ¶
- Variables
- type Config
- type Executor
- type Metrics
- type MockBackend
- func (m *MockBackend) AddL2RPC(ctx context.Context, rpc string, jwtSecret eth.Bytes32) error
- func (m *MockBackend) AllSafeDerivedAt(ctx context.Context, source eth.BlockID) (derived map[eth.ChainID]eth.BlockID, err error)
- func (m *MockBackend) CheckAccessList(ctx context.Context, inboxEntries []common.Hash, minSafety types.SafetyLevel, ...) error
- func (m *MockBackend) Close() error
- func (m *MockBackend) CrossDerivedToSource(ctx context.Context, chainID eth.ChainID, derived eth.BlockID) (source eth.BlockRef, err error)
- func (m *MockBackend) CrossSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)
- func (m *MockBackend) Finalized(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)
- func (m *MockBackend) FinalizedL1(ctx context.Context) (eth.BlockRef, error)
- func (m *MockBackend) GetFailsafeEnabled(ctx context.Context) (bool, error)
- func (m *MockBackend) LocalSafe(ctx context.Context, chainID eth.ChainID) (result types.DerivedIDPair, err error)
- func (m *MockBackend) LocalUnsafe(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)
- func (m *MockBackend) Rewind(ctx context.Context, chain eth.ChainID, block eth.BlockID) error
- func (m *MockBackend) SetFailsafeEnabled(ctx context.Context, enabled bool) error
- func (m *MockBackend) Start(ctx context.Context) error
- func (m *MockBackend) Stop(ctx context.Context) error
- func (m *MockBackend) SuperRootAtTimestamp(ctx context.Context, timestamp hexutil.Uint64) (eth.SuperRootResponse, error)
- func (m *MockBackend) SyncStatus(ctx context.Context) (eth.SupervisorSyncStatus, error)
- type SupervisorBackend
- func (su *SupervisorBackend) ActivationBlock(ctx context.Context, chainID eth.ChainID) (types.DerivedBlockSealPair, error)
- func (su *SupervisorBackend) AddL2RPC(ctx context.Context, rpc string, jwtSecret eth.Bytes32) error
- func (su *SupervisorBackend) AllSafeDerivedAt(ctx context.Context, source eth.BlockID) (map[eth.ChainID]eth.BlockID, error)
- func (su *SupervisorBackend) AttachEmitter(em event.Emitter)
- func (su *SupervisorBackend) AttachL1Source(source l1access.L1Source)
- func (su *SupervisorBackend) AttachProcessorSource(chainID eth.ChainID, src processors.Source) error
- func (su *SupervisorBackend) AttachSyncNode(ctx context.Context, src syncnode.SyncNode, noSubscribe bool) (syncnode.Node, error)
- func (su *SupervisorBackend) AttachSyncSource(chainID eth.ChainID, src syncnode.SyncSource) error
- func (su *SupervisorBackend) CheckAccessList(ctx context.Context, inboxEntries []common.Hash, minSafety types.SafetyLevel, ...) error
- func (su *SupervisorBackend) CrossDerivedToSource(ctx context.Context, chainID eth.ChainID, derived eth.BlockID) (source eth.BlockRef, err error)
- func (su *SupervisorBackend) CrossSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)
- func (su *SupervisorBackend) CrossUnsafe(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)
- func (su *SupervisorBackend) DependencySet() depset.DependencySet
- func (su *SupervisorBackend) Finalized(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)
- func (su *SupervisorBackend) FinalizedL1(ctx context.Context) (eth.BlockRef, error)
- func (su *SupervisorBackend) FindSealedBlock(ctx context.Context, chainID eth.ChainID, number uint64) (eth.BlockID, error)
- func (su *SupervisorBackend) GetFailsafeEnabled(ctx context.Context) (bool, error)
- func (su *SupervisorBackend) IsCrossSafe(ctx context.Context, chainID eth.ChainID, block eth.BlockID) error
- func (su *SupervisorBackend) IsLocalSafe(ctx context.Context, chainID eth.ChainID, block eth.BlockID) error
- func (su *SupervisorBackend) IsLocalUnsafe(ctx context.Context, chainID eth.ChainID, block eth.BlockID) error
- func (su *SupervisorBackend) L1BlockRefByNumber(ctx context.Context, number uint64) (eth.L1BlockRef, error)
- func (su *SupervisorBackend) LocalSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)
- func (su *SupervisorBackend) LocalSafeDerivedAt(ctx context.Context, chainID eth.ChainID, source eth.BlockID) (eth.BlockID, error)
- func (su *SupervisorBackend) LocalUnsafe(ctx context.Context, chainID eth.ChainID) (eth.BlockID, error)
- func (su *SupervisorBackend) OnEvent(ctx context.Context, ev event.Event) bool
- func (su *SupervisorBackend) PullFinalizedL1() error
- func (su *SupervisorBackend) PullLatestL1() error
- func (su *SupervisorBackend) Rewind(ctx context.Context, chain eth.ChainID, block eth.BlockID) error
- func (su *SupervisorBackend) SetConfDepthL1(depth uint64)
- func (su *SupervisorBackend) SetFailsafeEnabled(ctx context.Context, enabled bool) error
- func (su *SupervisorBackend) Start(ctx context.Context) error
- func (su *SupervisorBackend) Stop(ctx context.Context) error
- func (su *SupervisorBackend) SuperRootAtTimestamp(ctx context.Context, timestamp hexutil.Uint64) (eth.SuperRootResponse, error)
- func (su *SupervisorBackend) SyncStatus(ctx context.Context) (eth.SupervisorSyncStatus, error)
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnexpectedMinSafetyLevel = errors.New("unexpected min-safety level") ErrInternalBackendError = errors.New("internal backend error") )
Functions ¶
This section is empty.
Types ¶
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) AllSafeDerivedAt ¶
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 (*MockBackend) CrossSafe ¶
func (m *MockBackend) CrossSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)
func (*MockBackend) FinalizedL1 ¶
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 (*MockBackend) SetFailsafeEnabled ¶
func (m *MockBackend) SetFailsafeEnabled(ctx context.Context, enabled bool) 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 (*SupervisorBackend) ActivationBlock ¶
func (su *SupervisorBackend) ActivationBlock(ctx context.Context, chainID eth.ChainID) (types.DerivedBlockSealPair, error)
func (*SupervisorBackend) AddL2RPC ¶
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 (*SupervisorBackend) CrossSafe ¶
func (su *SupervisorBackend) CrossSafe(ctx context.Context, chainID eth.ChainID) (types.DerivedIDPair, error)
func (*SupervisorBackend) CrossUnsafe ¶
func (*SupervisorBackend) DependencySet ¶
func (su *SupervisorBackend) DependencySet() depset.DependencySet
func (*SupervisorBackend) FinalizedL1 ¶
func (*SupervisorBackend) FindSealedBlock ¶
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 (*SupervisorBackend) IsLocalSafe ¶
func (*SupervisorBackend) IsLocalUnsafe ¶
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 (*SupervisorBackend) LocalUnsafe ¶
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) SuperRootAtTimestamp ¶
func (su *SupervisorBackend) SuperRootAtTimestamp(ctx context.Context, timestamp hexutil.Uint64) (eth.SuperRootResponse, error)
func (*SupervisorBackend) SyncStatus ¶
func (su *SupervisorBackend) SyncStatus(ctx context.Context) (eth.SupervisorSyncStatus, error)