From 9c804eddc32149807d589037b76e602a552859e4 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Wed, 25 Feb 2026 15:43:10 +0800 Subject: [PATCH] core/state: clear journal entries on reset journal.reset() reslices j.entries to length 0 but does not clear the underlying array. Since j.entries holds interface values that can reference large objects (e.g., codeChange.prevCode), this can retain memory across transactions/blocks compared to the previous newJournal() behavior. --- core/state/journal.go | 1 + 1 file changed, 1 insertion(+) diff --git a/core/state/journal.go b/core/state/journal.go index a79bd7331a..17fc4e9a79 100644 --- a/core/state/journal.go +++ b/core/state/journal.go @@ -68,6 +68,7 @@ func newJournal() *journal { // It is semantically similar to calling 'newJournal', but the underlying slices // can be reused. func (j *journal) reset() { + clear(j.entries) j.entries = j.entries[:0] j.validRevisions = j.validRevisions[:0] clear(j.dirties)