From becca46010178249d79af7ef5c5ea0837f2f78ec Mon Sep 17 00:00:00 2001 From: Zhou Date: Wed, 16 Jul 2025 23:59:47 -0300 Subject: [PATCH] eth/protocols/snap: fix negative eta in state progress logging (#32225) --- eth/protocols/snap/sync.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eth/protocols/snap/sync.go b/eth/protocols/snap/sync.go index 9982d0f55c..84ceb9105e 100644 --- a/eth/protocols/snap/sync.go +++ b/eth/protocols/snap/sync.go @@ -3111,6 +3111,10 @@ func (s *Syncer) reportSyncProgress(force bool) { if estBytes < 1.0 { return } + // Cap the estimated state size using the synced size to avoid negative values + if estBytes < float64(synced) { + estBytes = float64(synced) + } elapsed := time.Since(s.startTime) estTime := elapsed / time.Duration(synced) * time.Duration(estBytes)