From e39a2c04672dba02e9e3da6184e6f6caef81da65 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 29 Jul 2019 15:09:08 -0700 Subject: [PATCH] all breach tests pass --- pkg/arvo/app/ph.hoon | 10 ++++++++++ pkg/arvo/lib/ph/azimuth.hoon | 14 +++++++------- pkg/arvo/sur/aquarium.hoon | 2 +- pkg/arvo/sys/vane/clay.hoon | 1 - pkg/arvo/sys/vane/kale.hoon | 27 +++++++++++---------------- pkg/arvo/sys/zuse.hoon | 17 +++++++++++------ 6 files changed, 40 insertions(+), 31 deletions(-) diff --git a/pkg/arvo/app/ph.hoon b/pkg/arvo/app/ph.hoon index 79d1bac35..34038eaa4 100644 --- a/pkg/arvo/app/ph.hoon +++ b/pkg/arvo/app/ph.hoon @@ -216,24 +216,34 @@ %+ (wrap-philter ,_eth-node ,~) router:eth-node ;< ~ bind:m (raw-ship ~bud `(dawn:eth-node ~bud)) + ~& > 'BUD DONE' ;< ~ bind:m (raw-ship ~marbud `(dawn:eth-node ~marbud)) + ~& > 'MARBUD DONE' ;< file=@t bind:m (touch-file ~bud %base) + ~& > 'TOUCH DONE' (check-file-touched ~marbud %home file) ;< eth-node=_eth-node bind:m (breach-and-hear:eth-node our.hid ~bud ~marbud) + ~& > 'BREACH-1 DONE' ;< [eth-node=_eth-node ~] bind:m %+ (wrap-philter ,_eth-node ,~) router:eth-node (raw-ship ~bud `(dawn:eth-node ~bud)) + ~& > 'BUD RE DONE' ;< eth-node=_eth-node bind:m (breach-and-hear:eth-node our.hid ~marbud ~bud) + ~& > 'BREACH-2 DONE' ;< [eth-node=_eth-node ~] bind:m %+ (wrap-philter ,_eth-node ,~) router:eth-node ;< ~ bind:m (raw-ship ~marbud `(dawn:eth-node ~marbud)) + ~& > 'MARBUD RE DONE' ;< file=@t bind:m (touch-file ~bud %base) + ~& > 'TOUCH-1 DONE' ;< file=@t bind:m (touch-file ~bud %base) + ~& > 'TOUCH-2 DONE' (check-file-touched ~marbud %home file) + ~& > 'DONE DONE' (pure:m ~) == :: diff --git a/pkg/arvo/lib/ph/azimuth.hoon b/pkg/arvo/lib/ph/azimuth.hoon index 0b5f410d0..a2386035f 100644 --- a/pkg/arvo/lib/ph/azimuth.hoon +++ b/pkg/arvo/lib/ph/azimuth.hoon @@ -47,10 +47,10 @@ :- | :_ [%wait ~] %+ answer-request req :- %o - =/ number (hex-to-num:ethereum (get-block-hash req)) + =/ number (hex-to-num:ethereum (get-first-param req)) + =/ hash (number-to-hash number) ~& who=who.pin ~& number=number - =/ hash (number-to-hash number) ~& hash=hash =/ parent-hash (number-to-hash ?~(number number (dec number))) ~& parent-hash=parent-hash @@ -156,7 +156,7 @@ ?> ?=([* ~] id) i.id :: - ++ get-block-hash + ++ get-first-param |= req=@t =, dejs:format =/ id @@ -197,7 +197,7 @@ :: ++ logs-by-range |= [from-block=@ud to-block=@ud] - %+ logs-to-json from-block + %+ logs-to-json (max launch:contracts:azimuth from-block) ?: (lth to-block launch:contracts:azimuth) ~ %+ swag @@ -232,7 +232,7 @@ (crip (prefix-hex:ethereum (render-hex-bytes:ethereum 32 hash))) :: :+ 'blockNumber' %s - (crip (num-to-hex:ethereum (add launch:contracts:azimuth count))) + (crip (num-to-hex:ethereum count)) :: :+ 'address' %s (crip (address-to-hex:ethereum azimuth:contracts:azimuth)) @@ -268,7 +268,7 @@ :: Should only do galaxies :: ++ get-czars - ^- (map ship [life pass]) + ^- (map ship [rift life pass]) %- malt %+ murn ~(tap by lives) @@ -276,7 +276,7 @@ ?. =(%czar (clan:title who)) ~ %- some - :+ who lyfe + :^ who rut lyfe %^ pass-from-eth:azimuth (as-octs:mimes:html (get-public who lyfe %crypt)) (as-octs:mimes:html (get-public who lyfe %auth)) diff --git a/pkg/arvo/sur/aquarium.hoon b/pkg/arvo/sur/aquarium.hoon index 59d56f781..6d75b203e 100644 --- a/pkg/arvo/sur/aquarium.hoon +++ b/pkg/arvo/sur/aquarium.hoon @@ -66,7 +66,7 @@ +$ dawn-event $: =seed:able:jael spon=ship - czar=(map ship [=life =pass]) + czar=(map ship [=rift =life =pass]) turf=(list turf) bloq=@ud node=(unit purl:eyre) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index f932cbf69..a1e194b2c 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -2641,7 +2641,6 @@ ?. =(our her) :: no duct, foreign +rede or default :: - :+ ?: (~(has by hoy.ruf) her) ~ [hun.rom.ruf %pass /sinks %k %public-keys (silt her ~)]~ diff --git a/pkg/arvo/sys/vane/kale.hoon b/pkg/arvo/sys/vane/kale.hoon index 489d5b0fe..3a0b2c6ec 100644 --- a/pkg/arvo/sys/vane/kale.hoon +++ b/pkg/arvo/sys/vane/kale.hoon @@ -278,21 +278,14 @@ =. tuf.own.pki turf.tac :: our initial galaxy table as a +map from +life to +public :: - =/ diffs=(list [=ship =diff:point]) - %~ tap by + =/ points=(map =ship =point) %- ~(run by czar.tac) - |= [=a=life =a=pass] - ^- diff:point - [%keys [*life 0 *pass] [a-life 1 a-pass]] + |= [=a=rift =a=life =a=pass] + ^- point + [a-rift a-life (malt [a-life 1 a-pass] ~) ~] =. +>.$ - |- ^+ +>.^$ - ?~ diffs - +>.^$ - =. +>.^$ - %- curd =< abet - %- public-keys:~(feel su hen our pki etn sap) - [%diff ship diff]:i.diffs - $(diffs t.diffs) + %- curd =< abet + (public-keys:~(feel su hen our pki etn sap) %full points) :: :: start subscriptions :: @@ -700,9 +693,11 @@ ++ new-event |= [=a=ship =a=udiff:point] ^+ this-su - =/ a-point=point (~(gut by pos.zim.pki) a-ship *point) - =/ a-diff=diff:point (udiff-to-diff:point a-udiff a-point) - (public-keys:feel %diff a-ship a-diff) + =/ a-point=point (~(gut by pos.zim.pki) a-ship *point) + =/ a-diff=(unit diff:point) (udiff-to-diff:point a-udiff a-point) + ?~ a-diff + this-su + (public-keys:feel %diff a-ship u.a-diff) :: ++ extract-snap :: extract rewind point ^- snapshot diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index 285d78ff8..1a081fe84 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -2135,7 +2135,7 @@ $: %dawn :: boot from keys =seed:able:jael :: identity params spon=ship :: sponsor - czar=(map ship [=life =pass]) :: galaxy table + czar=(map ship [=rift =life =pass]) :: galaxy table turf=(list turf) :: domains bloq=@ud :: block number node=(unit purl:eyre) :: gateway url @@ -2307,7 +2307,7 @@ $% $: %dawn :: boot from keys =seed:able:kale :: identity params spon=ship :: sponsor - czar=(map ship [=life =pass]) :: galaxy table + czar=(map ship [=rift =life =pass]) :: galaxy table turf=(list turf) :: domains bloq=@ud :: block number node=(unit purl:eyre) :: gateway url @@ -2411,13 +2411,18 @@ :: ++ udiff-to-diff |= [=a=udiff =a=point] - ^- diff + ^- (unit diff) ?- +<.a-udiff %disavow ~|(%udiff-to-diff-disavow !!) - %rift [%rift rift.a-point rift.a-udiff] - %spon [%spon sponsor.a-point sponsor.a-udiff] + %spon `[%spon sponsor.a-point sponsor.a-udiff] + %rift + ?: =(rift.a-udiff +(rift.a-point)) + `[%rift rift.a-point rift.a-udiff] + ~& [%ignoring-udiff a-udiff a-point] + ~ + :: %keys - :+ %keys + :^ ~ %keys [life.a-point (~(gut by keys.a-point) life.a-point *[@ud pass])] [life crypto-suite pass]:a-udiff ==