Skip to content

Commit 3f25ce0

Browse files
authored
Merge branch 'master' into run-mode-struct
2 parents a2d3751 + eb62315 commit 3f25ce0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

arbitrum/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"time"
77

8+
"github.com/ethereum/go-ethereum/core/rawdb"
89
"github.com/ethereum/go-ethereum/eth/ethconfig"
910
flag "github.com/spf13/pflag"
1011
)
@@ -119,4 +120,5 @@ var DefaultConfig = Config{
119120
TimeoutQueueBound: 512,
120121
},
121122
BlockRedirectsList: "default",
123+
StateScheme: rawdb.HashScheme,
122124
}

core/rawdb/accessors_trie.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,20 @@ func ReadStateScheme(db ethdb.Database) string {
265265
if id := ReadPersistentStateID(vdb); id != 0 {
266266
return PathScheme
267267
}
268+
genesisBlockNumber := uint64(0)
269+
block0Hash := ReadCanonicalHash(db, 0)
270+
if (block0Hash != common.Hash{}) {
271+
chainConfig := ReadChainConfig(db, block0Hash)
272+
if chainConfig != nil {
273+
if chainConfig.IsArbitrum() {
274+
genesisBlockNumber = chainConfig.ArbitrumChainParams.GenesisBlockNum
275+
}
276+
}
277+
}
268278
// In a hash-based scheme, the genesis state is consistently stored
269279
// on the disk. To assess the scheme of the persistent state, it
270280
// suffices to inspect the scheme of the genesis state.
271-
header := ReadHeader(db, ReadCanonicalHash(db, 0), 0)
281+
header := ReadHeader(db, ReadCanonicalHash(db, genesisBlockNumber), genesisBlockNumber)
272282
if header == nil {
273283
return "" // empty datadir
274284
}

0 commit comments

Comments
 (0)