From 5c9245810b237e43f765cc30973ba128b2dc56f4 Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Thu, 12 Apr 2018 16:00:52 +0200 Subject: [PATCH 1/5] log ex-data for deploy-pending-contracts exception --- src/clj/commiteth/scheduler.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clj/commiteth/scheduler.clj b/src/clj/commiteth/scheduler.clj index 907b143..1be116c 100644 --- a/src/clj/commiteth/scheduler.clj +++ b/src/clj/commiteth/scheduler.clj @@ -95,8 +95,8 @@ (log/infof "issue %s: Trying to re-deploy failed bounty contract deployment" issue-id) (try (bounties/deploy-contract owner owner-address repo issue-id issue-number) - (catch Throwable ex - (log/errorf ex "issue %s: deploy-pending-contracts exception:" issue-id)))))) + (catch Throwable t + (log/errorf t "issue %s: deploy-pending-contracts exception: %s" issue-id (ex-data t))))))) (defn self-sign-bounty "Walks through all issues eligible for bounty payout and signs corresponding transaction" From 248da65d3200860e9b68b41c2cdd8c6eac450a67 Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Fri, 13 Apr 2018 13:24:03 +0200 Subject: [PATCH 2/5] log eth-rpc results + different req-id approach --- src/clj/commiteth/eth/core.clj | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/clj/commiteth/eth/core.clj b/src/clj/commiteth/eth/core.clj index 4db60c1..b172592 100644 --- a/src/clj/commiteth/eth/core.clj +++ b/src/clj/commiteth/eth/core.clj @@ -122,18 +122,24 @@ nil))))) +(def req-id-tracker + ;; HACK to ensure previous random-number approach doesn't lead to + ;; unintended collisions + (atom 0)) + (defn eth-rpc [method params] - (let [request-id (rand-int 4096) - body (json/write-str {:jsonrpc "2.0" - :method method - :params params - :id request-id}) + (let [request-id (swap! req-id-tracker inc) + body {:jsonrpc "2.0" + :method method + :params params + :id request-id} options {:headers {"content-type" "application/json"} - :body body} + :body (json/write-str body)} response @(post (eth-rpc-url) options) result (safe-read-str (:body response))] - (log/debug body "\n" result) + (log/infof "eth-rpc req(%s) body: %s\neth-rpc req(%s) result: %s" + request-id body request-id result) (cond ;; Ignore any responses that have mismatching request ID From 5d8f23201695a021306d0cd70edefccdbac8d0c0 Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Fri, 13 Apr 2018 14:11:17 +0200 Subject: [PATCH 3/5] disable verbose webhook logging for now --- src/clj/commiteth/routes/webhooks.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clj/commiteth/routes/webhooks.clj b/src/clj/commiteth/routes/webhooks.clj index 6c2f1e7..b7fc05d 100644 --- a/src/clj/commiteth/routes/webhooks.clj +++ b/src/clj/commiteth/routes/webhooks.clj @@ -384,7 +384,7 @@ (log/debug "webhook-app POST, headers" headers) (let [raw-payload (slurp body) payload (json/parse-string raw-payload true)] - (log/info "webhook-app POST, payload:" (pr-str payload)) + (log/debug "webhook-app POST, payload:" (pr-str payload)) (if (validate-secret-one-hook payload raw-payload (get headers "x-hub-signature")) (do (log/debug "Github secret validation OK app") From ca439aa1ec8792bb91bc21744115917a02b54dce Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Fri, 13 Apr 2018 14:51:41 +0200 Subject: [PATCH 4/5] log various tx params --- src/clj/commiteth/eth/core.clj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/clj/commiteth/eth/core.clj b/src/clj/commiteth/eth/core.clj index b172592..31ec238 100644 --- a/src/clj/commiteth/eth/core.clj +++ b/src/clj/commiteth/eth/core.clj @@ -73,6 +73,7 @@ data) signed (TransactionEncoder/signMessage tx (creds)) hex-string (Numeric/toHexString signed)] + (log/info "Signing TX: nonce: %s, gas-price: %s, gas-limit: %s, data: %s" nonce gas-price gas-limit data) hex-string)) (defn eth-gasstation-gas-price From 7ab281ff137e961acbb0a036aa1774100529124a Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Fri, 13 Apr 2018 15:09:03 +0200 Subject: [PATCH 5/5] log/infof typo --- src/clj/commiteth/eth/core.clj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/clj/commiteth/eth/core.clj b/src/clj/commiteth/eth/core.clj index 31ec238..f70374d 100644 --- a/src/clj/commiteth/eth/core.clj +++ b/src/clj/commiteth/eth/core.clj @@ -73,7 +73,8 @@ data) signed (TransactionEncoder/signMessage tx (creds)) hex-string (Numeric/toHexString signed)] - (log/info "Signing TX: nonce: %s, gas-price: %s, gas-limit: %s, data: %s" nonce gas-price gas-limit data) + (log/infof "Signing TX: nonce: %s, gas-price: %s, gas-limit: %s, data: %s" + nonce gas-price gas-limit data) hex-string)) (defn eth-gasstation-gas-price