fix: ignore key-not-found errors in testWitness (#1164)

* fix: ignore key-not-found errors in testWitness

* chore: auto version bump [bot]

---------

Co-authored-by: omerfirmak <10325815+omerfirmak@users.noreply.github.com>
This commit is contained in:
Ömer Faruk Irmak 2025-04-03 01:18:49 +03:00 committed by GitHub
parent bbe9809b12
commit d6b4c96bf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -44,6 +44,7 @@ import (
"github.com/scroll-tech/go-ethereum/rollup/rcfg"
"github.com/scroll-tech/go-ethereum/rpc"
"github.com/scroll-tech/go-ethereum/trie"
"github.com/syndtr/goleveldb/leveldb"
)
// PublicEthereumAPI provides an API to access Ethereum full node-related
@ -384,7 +385,7 @@ func generateWitness(blockchain *core.BlockChain, block *types.Block) (*stateles
func testWitness(blockchain *core.BlockChain, block *types.Block, witness *stateless.Witness) error {
stateRoot := witness.Root()
diskRoot, err := rawdb.ReadDiskStateRoot(blockchain.Database(), stateRoot)
if err != nil {
if err != nil && !errors.Is(err, leveldb.ErrNotFound) {
return fmt.Errorf("failed to read disk state root for stateRoot %s: %w", stateRoot.Hex(), err)
}
if diskRoot != (common.Hash{}) {
@ -409,7 +410,7 @@ func testWitness(blockchain *core.BlockChain, block *types.Block, witness *state
postStateRoot := block.Root()
diskRoot, err = rawdb.ReadDiskStateRoot(blockchain.Database(), postStateRoot)
if err != nil {
if err != nil && !errors.Is(err, leveldb.ErrNotFound) {
return fmt.Errorf("failed to read disk state root for postStateRoot %s: %w", postStateRoot.Hex(), err)
}
if diskRoot != (common.Hash{}) {

View file

@ -24,7 +24,7 @@ import (
const (
VersionMajor = 5 // Major version component of the current release
VersionMinor = 8 // Minor version component of the current release
VersionPatch = 34 // Patch version component of the current release
VersionPatch = 35 // Patch version component of the current release
VersionMeta = "mainnet" // Version metadata to append to the version string
)