diff --git a/rpc/jsonrpc/server/http_json_handler.go b/rpc/jsonrpc/server/http_json_handler.go index fd39a45c8..0af2f41a2 100644 --- a/rpc/jsonrpc/server/http_json_handler.go +++ b/rpc/jsonrpc/server/http_json_handler.go @@ -97,8 +97,8 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.Han } args = append(args, fnArgs...) } + returns := rpcFunc.f.Call(args) - logger.Debug("HTTPJSONRPC", "method", request.Method, "args", args, "returns", returns) result, err := unreflectResult(returns) if err != nil { responses = append(responses, types.RPCInternalError(request.ID, err)) @@ -106,6 +106,7 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.Han } responses = append(responses, types.NewRPCSuccessResponse(request.ID, result)) } + if len(responses) > 0 { WriteRPCResponseHTTP(w, responses...) } diff --git a/rpc/jsonrpc/server/http_server.go b/rpc/jsonrpc/server/http_server.go index b323d46fd..6799d3665 100644 --- a/rpc/jsonrpc/server/http_server.go +++ b/rpc/jsonrpc/server/http_server.go @@ -197,9 +197,11 @@ func RecoverAndLogHandler(handler http.Handler, logger log.Logger) http.Handler if rww.Status == -1 { rww.Status = 200 } - logger.Info("Served RPC HTTP response", - "method", r.Method, "url", r.URL, - "status", rww.Status, "duration", durationMS, + logger.Debug("served RPC HTTP response", + "method", r.Method, + "url", r.URL, + "status", rww.Status, + "duration", durationMS, "remoteAddr", r.RemoteAddr, ) }() diff --git a/test/e2e/runner/rpc.go b/test/e2e/runner/rpc.go index c50ab6542..adba68781 100644 --- a/test/e2e/runner/rpc.go +++ b/test/e2e/runner/rpc.go @@ -90,18 +90,22 @@ func waitForNode(node *e2e.Node, height int64, timeout time.Duration) (*rpctypes // waitForAllNodes waits for all nodes to become available and catch up to the given block height. func waitForAllNodes(testnet *e2e.Testnet, height int64, timeout time.Duration) (int64, error) { - lastHeight := int64(0) + var lastHeight int64 + for _, node := range testnet.Nodes { if node.Mode == e2e.ModeSeed { continue } - status, err := waitForNode(node, height, 20*time.Second) + + status, err := waitForNode(node, height, timeout) if err != nil { return 0, err } + if status.SyncInfo.LatestBlockHeight > lastHeight { lastHeight = status.SyncInfo.LatestBlockHeight } } + return lastHeight, nil }