diff --git a/sequencer/closingsignalsmanager.go b/sequencer/closingsignalsmanager.go index c0985cb9e0..5c465757d4 100644 --- a/sequencer/closingsignalsmanager.go +++ b/sequencer/closingsignalsmanager.go @@ -5,7 +5,6 @@ import ( "time" "github.com/0xPolygonHermez/zkevm-node/log" - "github.com/ethereum/go-ethereum/common" ) type closingSignalsManager struct { @@ -46,8 +45,13 @@ func (c *closingSignalsManager) checkSendToL1Timeout() { } func (c *closingSignalsManager) checkGERUpdate() { - var lastGERSent common.Hash - + lastBatch, err := c.dbManager.GetLastBatch(c.ctx) + for err != nil { + log.Errorf("error getting last batch: %v", err) + time.Sleep(time.Second) + lastBatch, err = c.dbManager.GetLastBatch(c.ctx) + } + lastGERSent := lastBatch.GlobalExitRoot for { time.Sleep(c.cfg.ClosingSignalsManagerWaitForCheckingGER.Duration)