Skip to content

Commit 651069f

Browse files
authored
Merge pull request bnb-chain#3242 from bnb-chain/develop
Merge develop to master for v1.5.18
2 parents 88763b2 + 350885b commit 651069f

File tree

5 files changed

+9
-15
lines changed

5 files changed

+9
-15
lines changed

cmd/geth/dbcmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ func inspectHistory(ctx *cli.Context) error {
14381438
if header == nil {
14391439
return 0, fmt.Errorf("block #%d is not existent", blockNumber)
14401440
}
1441-
id := rawdb.ReadStateID(db, header.Root)
1441+
id := rawdb.ReadStateID(db.GetStateStore(), header.Root)
14421442
if id == nil {
14431443
first, last, err := triedb.HistoryRange()
14441444
if err == nil {

core/rawdb/ancient_utils.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,7 @@ func InspectFreezerTable(ancient string, freezerName string, tableName string, s
143143
)
144144
switch freezerName {
145145
case ChainFreezerName:
146-
if multiDatabase {
147-
path, tables = resolveChainFreezerDir(filepath.Dir(ancient)+"/block/ancient"), chainFreezerNoSnappy
148-
} else {
149-
path, tables = resolveChainFreezerDir(ancient), chainFreezerNoSnappy
150-
}
146+
path, tables = resolveChainFreezerDir(ancient), chainFreezerNoSnappy
151147

152148
case MerkleStateFreezerName, VerkleStateFreezerName:
153149
if multiDatabase {

core/vm/lightclient/v2/lightclient_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestEncodeConsensusState(t *testing.T) {
132132
require.NoError(t, err)
133133

134134
if !bytes.Equal(csBytes, expectCsBytes) {
135-
t.Fatalf("Consensus state mimatch, expect: %s, real:%s\n", testcase.consensusStateBytes, hex.EncodeToString(csBytes))
135+
t.Fatalf("Consensus state mismatch, expect: %s, real:%s\n", testcase.consensusStateBytes, hex.EncodeToString(csBytes))
136136
}
137137
}
138138
}
@@ -148,11 +148,11 @@ func TestDecodeConsensusState(t *testing.T) {
148148
require.NoError(t, err)
149149

150150
if cs.ChainID != testcase.chainID {
151-
t.Fatalf("Chain ID mimatch, expect: %s, real:%s\n", testcase.chainID, cs.ChainID)
151+
t.Fatalf("Chain ID mismatch, expect: %s, real:%s\n", testcase.chainID, cs.ChainID)
152152
}
153153

154154
if cs.Height != testcase.height {
155-
t.Fatalf("Height mimatch, expect: %d, real:%d\n", testcase.height, cs.Height)
155+
t.Fatalf("Height mismatch, expect: %d, real:%d\n", testcase.height, cs.Height)
156156
}
157157

158158
nextValidatorSetHashBytes, err := hex.DecodeString(testcase.nextValidatorSetHash)
@@ -161,7 +161,7 @@ func TestDecodeConsensusState(t *testing.T) {
161161
}
162162

163163
if !bytes.Equal(cs.NextValidatorSetHash, nextValidatorSetHashBytes) {
164-
t.Fatalf("Next validator set hash mimatch, expect: %s, real:%s\n", testcase.nextValidatorSetHash, hex.EncodeToString(cs.NextValidatorSetHash))
164+
t.Fatalf("Next validator set hash mismatch, expect: %s, real:%s\n", testcase.nextValidatorSetHash, hex.EncodeToString(cs.NextValidatorSetHash))
165165
}
166166
}
167167
}

eth/fetcher/block_fetcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ func (f *BlockFetcher) loop() {
768768
}
769769
case entry := <-f.quickBlockFetchingCh:
770770
annHash := entry.announce.hash
771-
// if there is error or timeout, and the shcedule have not started, just retry the fetch
771+
// if there is error or timeout, and the schedule have not started, just retry the fetch
772772
if entry.err != nil {
773773
quickBlockFetchingErrMeter.Mark(1)
774774
log.Debug("Quick block fetching err", "hash", annHash, "err", entry.err)

node/node.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,6 @@ func (n *Node) OpenAndMergeDatabase(name string, namespace string, readonly bool
774774
var (
775775
err error
776776
stateDiskDb ethdb.Database
777-
disableChainDbFreeze = false
778777
chainDataHandles = config.DatabaseHandles
779778
chainDbCache = config.DatabaseCache
780779
stateDbCache, stateDbHandles int
@@ -791,17 +790,16 @@ func (n *Node) OpenAndMergeDatabase(name string, namespace string, readonly bool
791790

792791
stateDbCache = config.DatabaseCache - chainDbCache
793792
stateDbHandles = config.DatabaseHandles - chainDataHandles
794-
disableChainDbFreeze = true
795793
}
796794

797-
chainDB, err := n.OpenDatabaseWithFreezer(name, chainDbCache, chainDataHandles, config.DatabaseFreezer, namespace, readonly, disableChainDbFreeze)
795+
chainDB, err := n.OpenDatabaseWithFreezer(name, chainDbCache, chainDataHandles, config.DatabaseFreezer, namespace, readonly, false)
798796
if err != nil {
799797
return nil, err
800798
}
801799

802800
if isMultiDatabase {
803801
// Allocate half of the handles and chainDbCache to this separate state data database
804-
stateDiskDb, err = n.OpenDatabaseWithFreezer(name+"/state", stateDbCache, stateDbHandles, "", "eth/db/statedata/", readonly, true)
802+
stateDiskDb, err = n.OpenDatabaseWithFreezer(name+"/state", stateDbCache, stateDbHandles, "", "eth/db/statedata/", readonly, false)
805803
if err != nil {
806804
return nil, err
807805
}

0 commit comments

Comments
 (0)