From 9ce53fe1eddacd09f665c988fee6812aa5f71705 Mon Sep 17 00:00:00 2001 From: zale144 Date: Wed, 1 Jan 2025 19:05:01 +0100 Subject: [PATCH] handle no last finalized height scenario --- eibc/lp.go | 2 +- eibc/order_poller.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/eibc/lp.go b/eibc/lp.go index 49ae36f..a178452 100644 --- a/eibc/lp.go +++ b/eibc/lp.go @@ -215,7 +215,7 @@ func (or *orderTracker) loadLPs(ctx context.Context) error { if len(or.lps) == 0 { or.logger.Info("no LPs found") } else { - or.logger.Info("loaded LPs", zap.Int("count", len(or.lps))) + or.logger.Debug("loaded LPs", zap.Int("count", len(or.lps))) } if lpsUpdated || (currentLPCount > 0 && len(or.lps) > currentLPCount) { diff --git a/eibc/order_poller.go b/eibc/order_poller.go index 102329b..908be92 100644 --- a/eibc/order_poller.go +++ b/eibc/order_poller.go @@ -234,7 +234,9 @@ func (p *orderPoller) getRollappDemandOrdersFromIndexer(ctx context.Context, rol RollappId: rollappId, Finalized: true, }) - if err == nil { + if err != nil { + p.logger.Warn("failed to get latest height, using 0", zap.Error(err)) + } else { lastFinalizedHeight = fmt.Sprint(lastHeightResp.Height) }