From 902c680a83cfd5b6583f5e892bbe27f9e3bb3346 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Fri, 20 Mar 2026 11:24:37 +0800 Subject: [PATCH] triedb/pathdb: fix panic --- triedb/pathdb/history_index_pruner.go | 2 +- triedb/pathdb/history_index_pruner_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/triedb/pathdb/history_index_pruner.go b/triedb/pathdb/history_index_pruner.go index 25407b9805..c9be3618e8 100644 --- a/triedb/pathdb/history_index_pruner.go +++ b/triedb/pathdb/history_index_pruner.go @@ -38,7 +38,7 @@ const ( // being released and re-opened. Long-lived iterators hold a read snapshot // that blocks LSM compaction; periodically re-opening avoids stalling the // compactor during a large scan. - iteratorReopenInterval = 3 * time.Minute + iteratorReopenInterval = 30 * time.Second ) // indexPruner is responsible for pruning stale index data from the tail side diff --git a/triedb/pathdb/history_index_pruner_test.go b/triedb/pathdb/history_index_pruner_test.go index 898557e682..a382152c83 100644 --- a/triedb/pathdb/history_index_pruner_test.go +++ b/triedb/pathdb/history_index_pruner_test.go @@ -23,6 +23,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/rawdb" "github.com/ethereum/go-ethereum/ethdb" + "github.com/ethereum/go-ethereum/log" ) func writeMultiBlockIndex(t *testing.T, db ethdb.Database, ident stateIdent, bitmapSize int, startID uint64) []*indexBlockDesc { @@ -278,6 +279,7 @@ func TestPrunePauseResume(t *testing.T) { pruner := &indexPruner{ disk: db, typ: typeStateHistory, + log: log.New("type", "account"), closed: make(chan struct{}), pauseReq: make(chan chan struct{}), resumeCh: make(chan struct{}),