Skip to content

Commit c92eb07

Browse files
committed
fix: ignore key-not-found errors in testWitness
1 parent bbe9809 commit c92eb07

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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{}) {

0 commit comments

Comments
 (0)