diff --git a/turbo/app/snapshots_cmd.go b/turbo/app/snapshots_cmd.go index 71ea1cc9969..443e8b818e1 100644 --- a/turbo/app/snapshots_cmd.go +++ b/turbo/app/snapshots_cmd.go @@ -815,6 +815,7 @@ func dbCfg(label kv.Label, path string) mdbx.MdbxOpts { // integration tool don't intent to create db, then easiest way to open db - it's pass mdbx.Accede flag, which allow // to read all options from DB, instead of overriding them opts = opts.Accede() + return opts } func openAgg(ctx context.Context, dirs datadir.Dirs, chainDB kv.RwDB, logger log.Logger) *libstate.Aggregator { diff --git a/turbo/jsonrpc/otterscan_search_trace.go b/turbo/jsonrpc/otterscan_search_trace.go index 38ec3698f91..971c49d0e38 100644 --- a/turbo/jsonrpc/otterscan_search_trace.go +++ b/turbo/jsonrpc/otterscan_search_trace.go @@ -51,6 +51,9 @@ func (api *OtterscanAPIImpl) traceBlock(dbtx kv.Tx, ctx context.Context, blockNu if err != nil { return false, nil, err } + if block == nil { + return false, nil, nil + } reader, err := rpchelper.CreateHistoryStateReader(dbtx, blockNum, 0, api.historyV3(dbtx), chainConfig.ChainName) if err != nil { diff --git a/turbo/jsonrpc/otterscan_transaction_by_sender_and_nonce.go b/turbo/jsonrpc/otterscan_transaction_by_sender_and_nonce.go index 321aec8464b..e09cbef1fed 100644 --- a/turbo/jsonrpc/otterscan_transaction_by_sender_and_nonce.go +++ b/turbo/jsonrpc/otterscan_transaction_by_sender_and_nonce.go @@ -280,6 +280,10 @@ func (api *OtterscanAPIImpl) findNonce(ctx context.Context, tx kv.Tx, addr commo if err != nil { return false, common.Hash{}, err } + if block == nil { + return false, common.Hash{}, fmt.Errorf("block not found: %d", blockNum) + } + senders := block.Body().SendersFromTxs() txs := block.Transactions()