Commit 0be1eb3e authored by protolambda's avatar protolambda Committed by GitHub

op-supervisor: improve finality errors and logging (#13662)

parent a1353f90
......@@ -169,11 +169,11 @@ func (db *ChainsDB) FinalizedL1() eth.BlockRef {
func (db *ChainsDB) Finalized(chainID types.ChainID) (types.BlockSeal, error) {
finalizedL1 := db.finalizedL1.Get()
if finalizedL1 == (eth.L1BlockRef{}) {
return types.BlockSeal{}, errors.New("no finalized L1 signal, cannot determine L2 finality yet")
return types.BlockSeal{}, fmt.Errorf("no finalized L1 signal, cannot determine L2 finality of chain %s yet", chainID)
}
derived, err := db.LastDerivedFrom(chainID, finalizedL1.ID())
if err != nil {
return types.BlockSeal{}, errors.New("could not find what was last derived from the finalized L1 block")
return types.BlockSeal{}, fmt.Errorf("could not find what was last derived in L2 chain %s from the finalized L1 block %s: %w", chainID, finalizedL1, err)
}
return derived, nil
}
......
......@@ -114,7 +114,7 @@ func (db *ChainsDB) UpdateFinalizedL1(finalized eth.BlockRef) error {
db.logger.Info("Updated finalized L1", "finalizedL1", finalized)
db.finalizedL1.Unlock()
// whenver the L1 Finalized changes, the L2 Finalized may change, notify subscribers
// whenever the L1 Finalized changes, the L2 Finalized may change, notify subscribers
db.NotifyL2Finalized()
return nil
......
......@@ -245,7 +245,7 @@ func (m *ManagedNode) onCrossSafeUpdate(pair types.DerivedBlockSealPair) {
}
func (m *ManagedNode) onFinalizedL2(seal types.BlockSeal) {
m.log.Debug("updating finalized L2", "finalized", seal)
m.log.Info("updating finalized L2", "finalized", seal)
ctx, cancel := context.WithTimeout(m.ctx, nodeTimeout)
defer cancel()
id := seal.ID()
......
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