Skip to content

Commit 10179bb

Browse files
authored
Merge branch 'develop' into feat/add_congested_gas_to_fee_history
2 parents c0c3499 + d6b4c96 commit 10179bb

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

core/rawdb/accessors_chain.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import (
2626

2727
"github.com/scroll-tech/go-ethereum/common"
2828
"github.com/scroll-tech/go-ethereum/core/types"
29-
"github.com/scroll-tech/go-ethereum/crypto"
3029
"github.com/scroll-tech/go-ethereum/ethdb"
3130
"github.com/scroll-tech/go-ethereum/log"
3231
"github.com/scroll-tech/go-ethereum/params"
@@ -301,11 +300,9 @@ func WriteFastTxLookupLimit(db ethdb.KeyValueWriter, number uint64) {
301300
func ReadHeaderRLP(db ethdb.Reader, hash common.Hash, number uint64) rlp.RawValue {
302301
var data []byte
303302
db.ReadAncients(func(reader ethdb.AncientReader) error {
304-
// First try to look up the data in ancient database. Extra hash
305-
// comparison is necessary since ancient database only maintains
306-
// the canonical data.
303+
// First try to look up the data in ancient database.
307304
data, _ = reader.Ancient(freezerHeaderTable, number)
308-
if len(data) > 0 && crypto.Keccak256Hash(data) == hash {
305+
if len(data) > 0 {
309306
return nil
310307
}
311308
// If not, try reading from leveldb
@@ -337,6 +334,14 @@ func ReadHeader(db ethdb.Reader, hash common.Hash, number uint64) *types.Header
337334
log.Error("Invalid block header RLP", "hash", hash, "err", err)
338335
return nil
339336
}
337+
338+
// Extra hash
339+
// comparison is necessary since ancient database only maintains
340+
// the canonical data.
341+
if header.Hash() != hash {
342+
return nil
343+
}
344+
340345
return header
341346
}
342347

eth/api.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import (
4444
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
4545
"github.com/scroll-tech/go-ethereum/rpc"
4646
"github.com/scroll-tech/go-ethereum/trie"
47+
"github.com/syndtr/goleveldb/leveldb"
4748
)
4849

4950
// PublicEthereumAPI provides an API to access Ethereum full node-related
@@ -384,7 +385,7 @@ func generateWitness(blockchain *core.BlockChain, block *types.Block) (*stateles
384385
func testWitness(blockchain *core.BlockChain, block *types.Block, witness *stateless.Witness) error {
385386
stateRoot := witness.Root()
386387
diskRoot, err := rawdb.ReadDiskStateRoot(blockchain.Database(), stateRoot)
387-
if err != nil {
388+
if err != nil && !errors.Is(err, leveldb.ErrNotFound) {
388389
return fmt.Errorf("failed to read disk state root for stateRoot %s: %w", stateRoot.Hex(), err)
389390
}
390391
if diskRoot != (common.Hash{}) {
@@ -409,7 +410,7 @@ func testWitness(blockchain *core.BlockChain, block *types.Block, witness *state
409410

410411
postStateRoot := block.Root()
411412
diskRoot, err = rawdb.ReadDiskStateRoot(blockchain.Database(), postStateRoot)
412-
if err != nil {
413+
if err != nil && !errors.Is(err, leveldb.ErrNotFound) {
413414
return fmt.Errorf("failed to read disk state root for postStateRoot %s: %w", postStateRoot.Hex(), err)
414415
}
415416
if diskRoot != (common.Hash{}) {

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
const (
2525
VersionMajor = 5 // Major version component of the current release
2626
VersionMinor = 8 // Minor version component of the current release
27-
VersionPatch = 33 // Patch version component of the current release
27+
VersionPatch = 35 // Patch version component of the current release
2828
VersionMeta = "mainnet" // Version metadata to append to the version string
2929
)
3030

0 commit comments

Comments
 (0)