From 261e67fb4ba9eef17a951c1ae66ee1ab88dab7a5 Mon Sep 17 00:00:00 2001 From: joeycli Date: Mon, 12 Aug 2024 15:26:45 +0800 Subject: [PATCH] feat: init genesis --- core/genesis.go | 2 +- core/state/caching_versa_db.go | 4 ++-- go.mod | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index c13f4abb5c..7418aacafd 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -174,7 +174,7 @@ func flushAlloc(ga *types.GenesisAlloc, db ethdb.Database, triedb *triedb.Databa return err } // Commit newly generated states into disk if it's not empty. - if root != types.EmptyRootHash { + if root != types.EmptyRootHash && triedb.Scheme() != rawdb.VersionScheme { if err := triedb.Commit(root, true); err != nil { return err } diff --git a/core/state/caching_versa_db.go b/core/state/caching_versa_db.go index 9559f31cb1..5e33b501d1 100644 --- a/core/state/caching_versa_db.go +++ b/core/state/caching_versa_db.go @@ -52,8 +52,8 @@ func (cv *cachingVersaDB) OpenTrie(root common.Hash) (Trie, error) { panic("account tree has open") } - // TODO:: if root tree, versa db shouldb ignore check version - state, err := cv.versionDB.OpenState(0, root, cv.mode) + // TODO:: if root tree, versa db should ignore check version, temp use -1 + state, err := cv.versionDB.OpenState(-1, root, cv.mode) if err != nil { return nil, err } diff --git a/go.mod b/go.mod index c17d26c0da..2d4e4ed423 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2 github.com/bnb-chain/fastssz v0.1.2 github.com/bnb-chain/ics23 v0.1.0 - github.com/bnb-chain/versioned-state-database v0.0.0-20240809035848-76ffc0e09a92 + github.com/bnb-chain/versioned-state-database v0.0.0-00010101000000-000000000000 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/cespare/cp v1.1.1 github.com/cloudflare/cloudflare-go v0.79.0