From 7fc5177602d4dfe417824836c8766a4b3ac020c6 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Thu, 12 May 2022 07:14:26 +0200 Subject: [PATCH 1/2] azimuth: restart %eth-watcher if not running --- pkg/arvo/app/azimuth.hoon | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/app/azimuth.hoon b/pkg/arvo/app/azimuth.hoon index 76066adda5..6a7b81e438 100644 --- a/pkg/arvo/app/azimuth.hoon +++ b/pkg/arvo/app/azimuth.hoon @@ -1,4 +1,4 @@ -/- eth-watcher, *dice +/- eth-watcher, *dice, *hood /+ ethereum, azimuth, naive, @@ -239,6 +239,11 @@ number:(last-block-id:dice logs.state) ~& >> %no-logs-in-azimuth-state last-snap + =+ [our=(scot %p our.bowl) now=(scot %da now.bowl)] + =+ .^(dudes=(set [dude:gall ?]) %ge our %base now /) + =/ running=? (~(has in dudes) [%eth-watcher &]) + =/ installed=? + |((~(has in dudes) [%eth-watcher &]) (~(has in dudes) [%eth-watcher |])) :_ this =/ cards=(list card) :- :: %jael will re-subscribe to get all azimuth diffs @@ -247,6 +252,21 @@ :: we poke eth-watcher to retrieve logs from the latest we have :: %*(start do last-snap last-block) + =? cards !running + :: restart %eth-watcher + :: + ~& >> %starting-eth-watcher + =/ rein=[desk rein] [%base %.y [%eth-watcher ~ ~] ~] + :_ cards + [%pass /rein %agent [our.bowl %hood] %poke kiln-rein+!>(rein)] + =? cards !installed + :: reinstall %base desk + :: + =+ spo=(sein:title [our now our]:bowl) + ~& >> re-installing-base-from+spo + =/ fresh=[desk ship desk] [%base spo %kids] + :_ cards + [%pass /fresh %agent [our.bowl %hood] %poke kiln-install+!>(fresh)] :: resubscribe if we somehow get unsubscribed from eth-watcher :: ?: (~(has by wex.bowl) [/eth-watcher our.bowl %eth-watcher]) From a347172abb4cf93b4accaec642484208cb906ee8 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Fri, 13 May 2022 07:38:17 +0200 Subject: [PATCH 2/2] ethereum: use jetted |base16 to parse hex cords --- pkg/base-dev/lib/ethereum.hoon | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/base-dev/lib/ethereum.hoon b/pkg/base-dev/lib/ethereum.hoon index c292eec3de..26dc0b6515 100644 --- a/pkg/base-dev/lib/ethereum.hoon +++ b/pkg/base-dev/lib/ethereum.hoon @@ -978,5 +978,8 @@ :: ++ hex-to-num |= a=@t - (rash (rsh [3 2] a) hex) + ~| %non-hex-cord + ?> =((end [3 2] a) '0x') + =< ?<(=(0 p) q) %- need + (de:base16:mimes:html (rsh [3 2] a)) --