diff --git a/decode/evm_rpc.go b/decode/evm_rpc.go index 3b224b4..41c2877 100644 --- a/decode/evm_rpc.go +++ b/decode/evm_rpc.go @@ -268,7 +268,12 @@ func (r *EVMRPCRequestEnvelope) ExtractBlockNumberFromEVMRPCRequest(ctx context. } // handle cacheable by block hash if MethodHasBlockHashParam(r.Method) { - return lookupBlockNumberFromHashParam(ctx, blockGetter, r.Method, r.Params) + blockNumber, err := lookupBlockNumberFromHashParam(ctx, blockGetter, r.Method, r.Params) + if err != nil { + return 0, fmt.Errorf("can't lookup block number from hash param: %v", err) + } + + return blockNumber, nil } // handle unable to cached return 0, ErrUncachaebleByBlockNumberEthRequest @@ -291,7 +296,7 @@ func lookupBlockNumberFromHashParam(ctx context.Context, blockGetter EVMBlockGet header, err := blockGetter.HeaderByHash(ctx, common.HexToHash(blockHash)) if err != nil { - return 0, err + return 0, fmt.Errorf("can't get header by %v block hash: %v", blockHash, err) } return header.Number.Int64(), nil diff --git a/service/middleware.go b/service/middleware.go index 2095bc6..9c9e8ab 100644 --- a/service/middleware.go +++ b/service/middleware.go @@ -457,8 +457,9 @@ func createAfterProxyFinalizer(service *ProxyService, config config.Config) http if err != nil { service.ServiceLogger. Error(). + Err(err). Str("method", decodedRequestBody.Method). - Msg(fmt.Sprintf("error %s parsing block number from request %+v", err, decodedRequestBody)) + Msg(fmt.Sprintf("can't parse block number from request %+v", decodedRequestBody)) blockNumber = nil } else {