Skip to content

Commit 261e67f

Browse files
committed
feat: init genesis
1 parent 6cf5169 commit 261e67f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/genesis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func flushAlloc(ga *types.GenesisAlloc, db ethdb.Database, triedb *triedb.Databa
174174
return err
175175
}
176176
// Commit newly generated states into disk if it's not empty.
177-
if root != types.EmptyRootHash {
177+
if root != types.EmptyRootHash && triedb.Scheme() != rawdb.VersionScheme {
178178
if err := triedb.Commit(root, true); err != nil {
179179
return err
180180
}

core/state/caching_versa_db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ func (cv *cachingVersaDB) OpenTrie(root common.Hash) (Trie, error) {
5252
panic("account tree has open")
5353
}
5454

55-
// TODO:: if root tree, versa db shouldb ignore check version
56-
state, err := cv.versionDB.OpenState(0, root, cv.mode)
55+
// TODO:: if root tree, versa db should ignore check version, temp use -1
56+
state, err := cv.versionDB.OpenState(-1, root, cv.mode)
5757
if err != nil {
5858
return nil, err
5959
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2
1313
github.com/bnb-chain/fastssz v0.1.2
1414
github.com/bnb-chain/ics23 v0.1.0
15-
github.com/bnb-chain/versioned-state-database v0.0.0-20240809035848-76ffc0e09a92
15+
github.com/bnb-chain/versioned-state-database v0.0.0-00010101000000-000000000000
1616
github.com/btcsuite/btcd/btcec/v2 v2.3.2
1717
github.com/cespare/cp v1.1.1
1818
github.com/cloudflare/cloudflare-go v0.79.0

0 commit comments

Comments
 (0)