From bea2b7ea8caffe08cbf2de7606c3cfe53c977739 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Fri, 11 Aug 2023 07:42:58 +0200 Subject: [PATCH] remove unnecessary snapshot Cap in flush --- core/genesis.go | 2 +- core/state/statedb.go | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index acfd613fe5..1a3da935f5 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -184,7 +184,7 @@ func (ga *GenesisAlloc) flush(db ethdb.Database, triedb *trie.Database, blockhas } rawdb.WriteGenesisStateSpec(db, blockhash, blob) - return statedb.Cap(root) // XXX check this is still necessary + return nil } // CommitGenesisState loads the stored genesis state with the given block diff --git a/core/state/statedb.go b/core/state/statedb.go index a3616e7a58..f0ec65d1d2 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1215,16 +1215,6 @@ func (s *StateDB) GetTrie() Trie { return s.trie } -// XXX check it's still needed -func (s *StateDB) Cap(root common.Hash) error { - if s.snaps != nil { - return s.snaps.Cap(root, 0) - } - // pre-verkle path: noop if s.snaps hasn't been - // initialized. - return nil -} - // Commit writes the state to the underlying in-memory trie database. // Once the state is committed, tries cached in stateDB (including account // trie, storage tries) will no longer be functional. A new state instance