Documentation
¶
Index ¶
- type CLISyncNodes
- type ManagedNode
- func (m *ManagedNode) AttachEmitter(em event.Emitter)
- func (m *ManagedNode) Close() error
- func (m *ManagedNode) OnEvent(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) BlockRefByNumber(ctx context.Context, number uint64) (eth.BlockRef, error)
- func (rs *RPCSyncNode) ChainID(ctx context.Context) (eth.ChainID, 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) 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.ManagedEvent, error)
- func (rs *RPCSyncNode) Reset(ctx context.Context, unsafe, safe, finalized eth.BlockID) error
- func (rs *RPCSyncNode) String() string
- func (rs *RPCSyncNode) SubscribeEvents(ctx context.Context, dest chan *types.ManagedEvent) (ethereum.Subscription, error)
- func (rs *RPCSyncNode) UpdateCrossSafe(ctx context.Context, derived eth.BlockID, derivedFrom 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
- 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) 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) *RPCSyncNode
func (*RPCSyncNode) AnchorPoint ¶
func (rs *RPCSyncNode) AnchorPoint(ctx context.Context) (types.DerivedBlockRefPair, error)
func (*RPCSyncNode) BlockRefByNumber ¶
func (*RPCSyncNode) FetchReceipts ¶
func (*RPCSyncNode) InvalidateBlock ¶
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.ManagedEvent, 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) String ¶
func (rs *RPCSyncNode) String() string
func (*RPCSyncNode) SubscribeEvents ¶
func (rs *RPCSyncNode) SubscribeEvents(ctx context.Context, dest chan *types.ManagedEvent) (ethereum.Subscription, error)
func (*RPCSyncNode) UpdateCrossSafe ¶
func (*RPCSyncNode) UpdateCrossUnsafe ¶
func (*RPCSyncNode) UpdateFinalized ¶
type SyncControl ¶
type SyncControl interface {
SubscribeEvents(ctx context.Context, c chan *types.ManagedEvent) (ethereum.Subscription, error)
PullEvent(ctx context.Context) (*types.ManagedEvent, error)
UpdateCrossUnsafe(ctx context.Context, id eth.BlockID) error
UpdateCrossSafe(ctx context.Context, derived eth.BlockID, derivedFrom eth.BlockID) error
UpdateFinalized(ctx context.Context, id eth.BlockID) error
InvalidateBlock(ctx context.Context, seal types.BlockSeal) error
Reset(ctx context.Context, unsafe, safe, finalized eth.BlockID) error
ProvideL1(ctx context.Context, nextL1 eth.BlockRef) error
AnchorPoint(ctx context.Context) (types.DerivedBlockRefPair, 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 {
BlockRefByNumber(ctx context.Context, number uint64) (eth.BlockRef, 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
}