Documentation
¶
Index ¶
- type CLISyncNodes
- type ManagedNode
- func (m *ManagedNode) AttachEmitter(em event.Emitter)
- func (m *ManagedNode) Close() error
- func (m *ManagedNode) OnEvent(ctx context.Context, ev event.Event) bool
- func (m *ManagedNode) PullEvents(ctx context.Context) (pulledAny bool, err error)
- func (m *ManagedNode) Start()
- func (m *ManagedNode) SubscribeToNodeEvents()
- func (m *ManagedNode) WatchSubscriptionErrors()
- type Node
- type RPCDialSetup
- type RPCSyncNode
- func (rs *RPCSyncNode) AnchorPoint(ctx context.Context) (types.DerivedBlockRefPair, error)
- func (rs *RPCSyncNode) ChainID(ctx context.Context) (eth.ChainID, error)
- func (rs *RPCSyncNode) Contains(ctx context.Context, query types.ContainsQuery) (types.BlockSeal, error)
- func (rs *RPCSyncNode) FetchReceipts(ctx context.Context, blockHash common.Hash) (gethtypes.Receipts, error)
- func (rs *RPCSyncNode) InvalidateBlock(ctx context.Context, seal types.BlockSeal) error
- func (rs *RPCSyncNode) L2BlockRefByNumber(ctx context.Context, number uint64) (eth.L2BlockRef, error)
- func (rs *RPCSyncNode) L2BlockRefByTimestamp(ctx context.Context, timestamp uint64) (eth.L2BlockRef, error)
- func (rs *RPCSyncNode) OutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)
- func (rs *RPCSyncNode) PendingOutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error)
- func (rs *RPCSyncNode) ProvideL1(ctx context.Context, nextL1 eth.BlockRef) error
- func (rs *RPCSyncNode) PullEvent(ctx context.Context) (*types.IndexingEvent, error)
- func (rs *RPCSyncNode) ReconnectRPC(ctx context.Context) error
- func (rs *RPCSyncNode) Reset(ctx context.Context, lUnsafe, xUnsafe, lSafe, xSafe, finalized eth.BlockID) error
- func (rs *RPCSyncNode) ResetPreInterop(ctx context.Context) error
- func (rs *RPCSyncNode) String() string
- func (rs *RPCSyncNode) SubscribeEvents(ctx context.Context, dest chan *types.IndexingEvent) (ethereum.Subscription, error)
- func (rs *RPCSyncNode) UpdateCrossSafe(ctx context.Context, derived eth.BlockID, source eth.BlockID) error
- func (rs *RPCSyncNode) UpdateCrossUnsafe(ctx context.Context, id eth.BlockID) error
- func (rs *RPCSyncNode) UpdateFinalized(ctx context.Context, id eth.BlockID) error
- type SyncControl
- type SyncNode
- type SyncNodeCollection
- type SyncNodeSetup
- type SyncNodesController
- func (snc *SyncNodesController) AttachEmitter(em event.Emitter)
- func (snc *SyncNodesController) AttachNodeController(chainID eth.ChainID, ctrl SyncControl, noSubscribe bool) (Node, error)
- func (snc *SyncNodesController) Close() error
- func (snc *SyncNodesController) OnEvent(ctx context.Context, ev event.Event) bool
- type SyncSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLISyncNodes ¶
func (*CLISyncNodes) Check ¶
func (p *CLISyncNodes) Check() error
func (*CLISyncNodes) Load ¶
func (p *CLISyncNodes) Load(ctx context.Context, logger log.Logger) ([]SyncNodeSetup, error)
type ManagedNode ¶
type ManagedNode struct { Node SyncControl // contains filtered or unexported fields }
func NewManagedNode ¶
func NewManagedNode(log log.Logger, id eth.ChainID, node SyncControl, backend backend, noSubscribe bool) *ManagedNode
func (*ManagedNode) AttachEmitter ¶
func (m *ManagedNode) AttachEmitter(em event.Emitter)
func (*ManagedNode) Close ¶
func (m *ManagedNode) Close() error
func (*ManagedNode) OnEvent ¶
OnEvent handles internal supervisor events and translates these into outgoing actions/signals for the managed node.
func (*ManagedNode) PullEvents ¶
func (m *ManagedNode) PullEvents(ctx context.Context) (pulledAny bool, err error)
PullEvents pulls all events, until there are none left, the ctx is canceled, or an error upon event-pulling occurs.
func (*ManagedNode) Start ¶
func (m *ManagedNode) Start()
func (*ManagedNode) SubscribeToNodeEvents ¶
func (m *ManagedNode) SubscribeToNodeEvents()
func (*ManagedNode) WatchSubscriptionErrors ¶
func (m *ManagedNode) WatchSubscriptionErrors()
type RPCDialSetup ¶
type RPCSyncNode ¶
type RPCSyncNode struct {
// contains filtered or unexported fields
}
func NewRPCSyncNode ¶
func NewRPCSyncNode(name string, cl client.RPC, opts []client.RPCOption, logger log.Logger, dialSetup *RPCDialSetup) *RPCSyncNode
func (*RPCSyncNode) AnchorPoint ¶
func (rs *RPCSyncNode) AnchorPoint(ctx context.Context) (types.DerivedBlockRefPair, error)
func (*RPCSyncNode) Contains ¶ added in v1.13.3
func (rs *RPCSyncNode) Contains(ctx context.Context, query types.ContainsQuery) (types.BlockSeal, error)
Contains returns no error iff the specified logHash is recorded in the specified blockNum and logIdx. If the log is out of reach and the block is complete, an ErrConflict is returned. If the log is out of reach and the block is not complete, an ErrFuture is returned. If the log is determined to conflict with the canonical chain, then ErrConflict is returned. logIdx is the index of the log in the array of all logs in the block. This can be used to check the validity of cross-chain interop events. The block-seal of the blockNum block that the log was included in is returned.
func (*RPCSyncNode) FetchReceipts ¶
func (*RPCSyncNode) InvalidateBlock ¶
func (*RPCSyncNode) L2BlockRefByNumber ¶ added in v1.13.5
func (rs *RPCSyncNode) L2BlockRefByNumber(ctx context.Context, number uint64) (eth.L2BlockRef, error)
func (*RPCSyncNode) L2BlockRefByTimestamp ¶
func (rs *RPCSyncNode) L2BlockRefByTimestamp(ctx context.Context, timestamp uint64) (eth.L2BlockRef, error)
func (*RPCSyncNode) OutputV0AtTimestamp ¶
func (*RPCSyncNode) PendingOutputV0AtTimestamp ¶
func (*RPCSyncNode) PullEvent ¶
func (rs *RPCSyncNode) PullEvent(ctx context.Context) (*types.IndexingEvent, error)
PullEvent pulls an event, as alternative to an event-subscription with SubscribeEvents. This returns an io.EOF error if no new events are available.
func (*RPCSyncNode) ReconnectRPC ¶ added in v1.13.3
func (rs *RPCSyncNode) ReconnectRPC(ctx context.Context) error
func (*RPCSyncNode) ResetPreInterop ¶ added in v1.13.4
func (rs *RPCSyncNode) ResetPreInterop(ctx context.Context) error
func (*RPCSyncNode) String ¶
func (rs *RPCSyncNode) String() string
func (*RPCSyncNode) SubscribeEvents ¶
func (rs *RPCSyncNode) SubscribeEvents(ctx context.Context, dest chan *types.IndexingEvent) (ethereum.Subscription, error)
func (*RPCSyncNode) UpdateCrossSafe ¶
func (*RPCSyncNode) UpdateCrossUnsafe ¶
func (*RPCSyncNode) UpdateFinalized ¶
type SyncControl ¶
type SyncControl interface { SubscribeEvents(ctx context.Context, c chan *types.IndexingEvent) (ethereum.Subscription, error) PullEvent(ctx context.Context) (*types.IndexingEvent, error) L2BlockRefByNumber(ctx context.Context, number uint64) (eth.L2BlockRef, error) UpdateCrossUnsafe(ctx context.Context, id eth.BlockID) error UpdateCrossSafe(ctx context.Context, derived eth.BlockID, source eth.BlockID) error UpdateFinalized(ctx context.Context, id eth.BlockID) error InvalidateBlock(ctx context.Context, seal types.BlockSeal) error Reset(ctx context.Context, lUnsafe, xUnsafe, lSafe, xSafe, finalized eth.BlockID) error ResetPreInterop(ctx context.Context) error ProvideL1(ctx context.Context, nextL1 eth.BlockRef) error AnchorPoint(ctx context.Context) (types.DerivedBlockRefPair, error) ReconnectRPC(ctx context.Context) error fmt.Stringer }
type SyncNode ¶
type SyncNode interface { SyncSource SyncControl }
type SyncNodeCollection ¶
type SyncNodeSetup ¶
type SyncNodesController ¶
type SyncNodesController struct {
// contains filtered or unexported fields
}
SyncNodesController manages a collection of active sync nodes. Sync nodes are used to sync the supervisor, and subject to the canonical chain view as followed by the supervisor.
func NewSyncNodesController ¶
func NewSyncNodesController(l log.Logger, depset depset.DependencySet, eventSys event.System, backend backend) *SyncNodesController
NewSyncNodesController creates a new SyncNodeController
func (*SyncNodesController) AttachEmitter ¶
func (snc *SyncNodesController) AttachEmitter(em event.Emitter)
func (*SyncNodesController) AttachNodeController ¶
func (snc *SyncNodesController) AttachNodeController(chainID eth.ChainID, ctrl SyncControl, noSubscribe bool) (Node, error)
AttachNodeController attaches a node to be managed by the supervisor. If noSubscribe, the node is not actively polled/subscribed to, and requires manual ManagedNode.PullEvents calls.
func (*SyncNodesController) Close ¶
func (snc *SyncNodesController) Close() error
type SyncSource ¶
type SyncSource interface { Contains(ctx context.Context, query types.ContainsQuery) (includedIn types.BlockSeal, err error) L2BlockRefByNumber(ctx context.Context, number uint64) (eth.L2BlockRef, error) FetchReceipts(ctx context.Context, blockHash common.Hash) (gethtypes.Receipts, error) ChainID(ctx context.Context) (eth.ChainID, error) OutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error) PendingOutputV0AtTimestamp(ctx context.Context, timestamp uint64) (*eth.OutputV0, error) L2BlockRefByTimestamp(ctx context.Context, timestamp uint64) (eth.L2BlockRef, error) // String identifies the sync source String() string }