Commit 31927933 authored by protolambda's avatar protolambda Committed by GitHub

op-node: RPC alt-sync comment review fixes

Co-authored-by: default avatarAdrian Sutton <adrian@oplabs.co>
parent cdac0970
...@@ -215,7 +215,6 @@ func (n *OpNode) initRPCSync(ctx context.Context, cfg *Config) error { ...@@ -215,7 +215,6 @@ func (n *OpNode) initRPCSync(ctx context.Context, cfg *Config) error {
return nil return nil
} }
// The sync client's RPC is always trusted
config := sources.SyncClientDefaultConfig(&cfg.Rollup, trustRPC) config := sources.SyncClientDefaultConfig(&cfg.Rollup, trustRPC)
syncClient, err := sources.NewSyncClient(n.OnUnsafeL2Payload, rpcSyncClient, n.log, n.metrics.L2SourceCache, config) syncClient, err := sources.NewSyncClient(n.OnUnsafeL2Payload, rpcSyncClient, n.log, n.metrics.L2SourceCache, config)
......
...@@ -84,6 +84,7 @@ type Network interface { ...@@ -84,6 +84,7 @@ type Network interface {
type AltSync interface { type AltSync interface {
// RequestL2Range informs the sync source that the given range of L2 blocks is missing, // RequestL2Range informs the sync source that the given range of L2 blocks is missing,
// and should be retrieved from any available alternative syncing source. // and should be retrieved from any available alternative syncing source.
// The start of the range is inclusive, the end is exclusive.
// The sync results should be returned back to the driver via the OnUnsafeL2Payload(ctx, payload) method. // The sync results should be returned back to the driver via the OnUnsafeL2Payload(ctx, payload) method.
// The latest requested range should always take priority over previous requests. // The latest requested range should always take priority over previous requests.
// There may be overlaps in requested ranges. // There may be overlaps in requested ranges.
......
...@@ -199,8 +199,8 @@ func (s *Driver) eventLoop() { ...@@ -199,8 +199,8 @@ func (s *Driver) eventLoop() {
sequencerTimer.Reset(delay) sequencerTimer.Reset(delay)
} }
// Create a ticker to check if there is a gap in the engine queue, whenever // Create a ticker to check if there is a gap in the engine queue. Whenever
// If there is, we send requests to sync source to retrieve the missing payloads. // there is, we send requests to sync source to retrieve the missing payloads.
syncCheckInterval := time.Duration(s.config.BlockTime) * time.Second * 2 syncCheckInterval := time.Duration(s.config.BlockTime) * time.Second * 2
altSyncTicker := time.NewTicker(syncCheckInterval) altSyncTicker := time.NewTicker(syncCheckInterval)
defer altSyncTicker.Stop() defer altSyncTicker.Stop()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment