Commit 83deb505 authored by protolambda's avatar protolambda Committed by GitHub

fix(op-node): do not use l2 driver before initialization (#3364)

parent b73552e8
...@@ -238,6 +238,9 @@ func (n *OpNode) Start(ctx context.Context) error { ...@@ -238,6 +238,9 @@ func (n *OpNode) Start(ctx context.Context) error {
func (n *OpNode) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef) { func (n *OpNode) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef) {
n.tracer.OnNewL1Head(ctx, sig) n.tracer.OnNewL1Head(ctx, sig)
if n.l2Driver == nil {
return
}
// Pass on the event to the L2 Engine // Pass on the event to the L2 Engine
ctx, cancel := context.WithTimeout(ctx, time.Second*10) ctx, cancel := context.WithTimeout(ctx, time.Second*10)
defer cancel() defer cancel()
...@@ -247,6 +250,9 @@ func (n *OpNode) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef) { ...@@ -247,6 +250,9 @@ func (n *OpNode) OnNewL1Head(ctx context.Context, sig eth.L1BlockRef) {
} }
func (n *OpNode) OnNewL1Safe(ctx context.Context, sig eth.L1BlockRef) { func (n *OpNode) OnNewL1Safe(ctx context.Context, sig eth.L1BlockRef) {
if n.l2Driver == nil {
return
}
// Pass on the event to the L2 Engine // Pass on the event to the L2 Engine
ctx, cancel := context.WithTimeout(ctx, time.Second*10) ctx, cancel := context.WithTimeout(ctx, time.Second*10)
defer cancel() defer cancel()
...@@ -256,6 +262,9 @@ func (n *OpNode) OnNewL1Safe(ctx context.Context, sig eth.L1BlockRef) { ...@@ -256,6 +262,9 @@ func (n *OpNode) OnNewL1Safe(ctx context.Context, sig eth.L1BlockRef) {
} }
func (n *OpNode) OnNewL1Finalized(ctx context.Context, sig eth.L1BlockRef) { func (n *OpNode) OnNewL1Finalized(ctx context.Context, sig eth.L1BlockRef) {
if n.l2Driver == nil {
return
}
// Pass on the event to the L2 Engine // Pass on the event to the L2 Engine
ctx, cancel := context.WithTimeout(ctx, time.Second*10) ctx, cancel := context.WithTimeout(ctx, time.Second*10)
defer cancel() defer cancel()
......
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