mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-27 14:07:34 +03:00
Merge branch 'develop' into tinnus/local-provenance
This commit is contained in:
commit
0105be6459
@ -31,15 +31,6 @@ them. "It would be cool if.." probably does not, in itself, constitute a good
|
||||
feature request; instead, try to be specific about what you're requesting, and
|
||||
what your desired feature would accomplish.
|
||||
|
||||
### Feature Branch Names
|
||||
|
||||
Every branch that you intend to put up for review must adhere to the form
|
||||
`i/<N>/<...>`, where `<N>` is the number of the issue that the branch
|
||||
corresponds to and `<...>` is an optional short description of the branch to aid
|
||||
in readability. If `<...>` is omitted, the `/` should be omitted as well, which
|
||||
makes `i/<N>` a well-formed branch name. These feature branches should be based
|
||||
off of `develop`.
|
||||
|
||||
### Commits
|
||||
|
||||
Commits should generally be relevant, atomic, and have descriptions formatted in
|
||||
|
@ -188,7 +188,7 @@
|
||||
%- need %- need
|
||||
(scry:(ames-gate now eny roof) ~ / %x beam)
|
||||
::
|
||||
=/ paz=(list have:ames)
|
||||
=/ paz=(list have:ames)
|
||||
%+ spun meows
|
||||
|= [blob=@ux num=_1]
|
||||
^- [have:ames _num]
|
||||
@ -196,9 +196,10 @@
|
||||
[num (sift-meow:ames blob)]
|
||||
::
|
||||
:- sig:(sift-roar:ames-raw (lent paz) (flop paz))
|
||||
%+ turn meows
|
||||
|= meow=@ux
|
||||
(can 3 4^lop 2^wid wid^`@`pat (met 3 meow)^meow ~)
|
||||
%+ spun meows
|
||||
|= [meow=@ux num=_1]
|
||||
:_ +(num)
|
||||
(can 3 4^num 2^wid wid^`@`pat (met 3 meow)^meow ~)
|
||||
:: ::
|
||||
++ ames-scry-peer
|
||||
|= $: =ames-gate
|
||||
|
1
pkg/arvo/mar/vere.hoon
Symbolic link
1
pkg/arvo/mar/vere.hoon
Symbolic link
@ -0,0 +1 @@
|
||||
../../base-dev/mar/vere.hoon
|
@ -288,13 +288,16 @@
|
||||
^- [sig=@ux dat=$@(~ (cask))]
|
||||
=/ mes=@
|
||||
%+ rep response-size
|
||||
(roll hav |=([=have dat=(list @ux)] [dat.have dat]))
|
||||
%+ turn
|
||||
(sort hav |=([a=have b=have] (lth fra.a fra.b)))
|
||||
|=(=have dat.have)
|
||||
=+ sig=(end 9 mes)
|
||||
:- sig
|
||||
=+ dat=(rsh 9 mes)
|
||||
?~ dat ~
|
||||
=/ non ~|(%fine-cue (cue dat))
|
||||
~| [%fine %response-not-cask]
|
||||
;;((cask) (cue dat))
|
||||
;;((cask) non)
|
||||
:: +etch-hunk: helper core to serialize a $hunk
|
||||
::
|
||||
++ etch-hunk
|
||||
@ -1819,7 +1822,7 @@
|
||||
=/ ship-state (~(get by peers.ames-state) ship)
|
||||
?: ?=([~ %known *] ship-state)
|
||||
abet:on-heed:(abed-peer:pe ship +.u.ship-state)
|
||||
%+ enqueue-alien-todo ship
|
||||
%^ enqueue-alien-todo ship ship-state
|
||||
|= todos=alien-agenda
|
||||
todos(heeds (~(put in heeds.todos) duct))
|
||||
:: +on-jilt: handle request to stop tracking .ship's responsiveness
|
||||
@ -1830,7 +1833,7 @@
|
||||
=/ ship-state (~(get by peers.ames-state) ship)
|
||||
?: ?=([~ %known *] ship-state)
|
||||
abet:on-jilt:(abed-peer:pe ship +.u.ship-state)
|
||||
%+ enqueue-alien-todo ship
|
||||
%^ enqueue-alien-todo ship ship-state
|
||||
|= todos=alien-agenda
|
||||
todos(heeds (~(del in heeds.todos) duct))
|
||||
:: +on-hear: handle raw packet receipt
|
||||
@ -1903,7 +1906,7 @@
|
||||
`p.lane
|
||||
::
|
||||
=/ =blob (etch-shot shot)
|
||||
(send-blob & rcvr.shot blob)
|
||||
(send-blob for=& rcvr.shot blob (~(get by peers.ames-state) rcvr.shot))
|
||||
:: +on-hear-keys: handle receipt of attestion request
|
||||
::
|
||||
++ on-hear-keys
|
||||
@ -1913,7 +1916,8 @@
|
||||
|.("requested attestation")
|
||||
?. =(%pawn (clan:title our))
|
||||
event-core
|
||||
(send-blob | sndr.shot (attestation-packet sndr.shot 1))
|
||||
=/ =blob (attestation-packet sndr.shot 1)
|
||||
(send-blob for=| sndr.shot blob (~(get by peers.ames-state) sndr.shot))
|
||||
:: +on-hear-open: handle receipt of plaintext comet self-attestation
|
||||
::
|
||||
++ on-hear-open
|
||||
@ -1970,7 +1974,7 @@
|
||||
:: will be resent.
|
||||
::
|
||||
?. ?=([~ %known *] sndr-state)
|
||||
(enqueue-alien-todo sndr.shot |=(alien-agenda +<))
|
||||
(enqueue-alien-todo sndr.shot sndr-state |=(alien-agenda +<))
|
||||
:: decrypt packet contents using symmetric-key.channel
|
||||
::
|
||||
:: If we know them, we have a $channel with them, which we've
|
||||
@ -2061,7 +2065,7 @@
|
||||
=/ ship-state (~(get by peers.ames-state) ship)
|
||||
::
|
||||
?. ?=([~ %known *] ship-state)
|
||||
%+ enqueue-alien-todo ship
|
||||
%^ enqueue-alien-todo ship ship-state
|
||||
|= todos=alien-agenda
|
||||
todos(messages [[duct plea] messages.todos])
|
||||
::
|
||||
@ -2083,7 +2087,7 @@
|
||||
=/ =plea [%$ /flow [%cork ~]]
|
||||
=/ ship-state (~(get by peers.ames-state) ship)
|
||||
?. ?=([~ %known *] ship-state)
|
||||
%+ enqueue-alien-todo ship
|
||||
%^ enqueue-alien-todo ship ship-state
|
||||
|= todos=alien-agenda
|
||||
todos(messages [[duct plea] messages.todos])
|
||||
=/ =peer-state +.u.ship-state
|
||||
@ -2436,7 +2440,8 @@
|
||||
:: if we're a comet, send self-attestation packet first
|
||||
::
|
||||
=? event-core =(%pawn (clan:title our))
|
||||
(send-blob | ship (attestation-packet ship life.point))
|
||||
=/ =blob (attestation-packet ship life.point)
|
||||
(send-blob for=| ship blob (~(get by peers.ames-state) ship))
|
||||
:: save current duct
|
||||
::
|
||||
=/ original-duct duct
|
||||
@ -2459,7 +2464,7 @@
|
||||
=. event-core
|
||||
%+ roll ~(tap in packets.todos)
|
||||
|= [=blob core=_event-core]
|
||||
(send-blob:core | ship blob)
|
||||
(send-blob:core for=| ship blob (~(get by peers.ames-state) ship))
|
||||
:: apply remote scry requests
|
||||
::
|
||||
=. event-core (meet-alien-fine keens.todos)
|
||||
@ -2576,7 +2581,7 @@
|
||||
=/ ship-state (~(get by peers.ames-state) ship)
|
||||
?: ?=([~ %known *] ship-state)
|
||||
abet:(on-keen:(abed-peer:pe ship +.u.ship-state) path duct)
|
||||
%+ enqueue-alien-todo ship
|
||||
%^ enqueue-alien-todo ship ship-state
|
||||
|= todos=alien-agenda
|
||||
todos(keens (~(put ju keens.todos) path duct))
|
||||
::
|
||||
@ -2602,10 +2607,11 @@
|
||||
:: If talking to a comet, requests attestation packet.
|
||||
::
|
||||
++ enqueue-alien-todo
|
||||
|= [=ship mutate=$-(alien-agenda alien-agenda)]
|
||||
|= $: =ship
|
||||
ship-state=(unit ship-state)
|
||||
mutate=$-(alien-agenda alien-agenda)
|
||||
==
|
||||
^+ event-core
|
||||
::
|
||||
=/ ship-state (~(get by peers.ames-state) ship)
|
||||
:: create a default $alien-agenda on first contact
|
||||
::
|
||||
=+ ^- [already-pending=? todos=alien-agenda]
|
||||
@ -2633,7 +2639,9 @@
|
||||
|= =ship
|
||||
^+ event-core
|
||||
=+ (ev-trace msg.veb ship |.("requesting attestion"))
|
||||
=. event-core (send-blob | ship (sendkeys-packet ship))
|
||||
=. event-core
|
||||
=/ =blob (sendkeys-packet ship)
|
||||
(send-blob for=| ship blob (~(get by peers.ames-state) ship))
|
||||
=/ =wire /alien/(scot %p ship)
|
||||
(emit duct %pass wire %b %wait (add now ~s30))
|
||||
:: +send-blob: fire packet at .ship and maybe sponsors
|
||||
@ -2646,19 +2654,16 @@
|
||||
::
|
||||
++ send-blob
|
||||
~/ %send-blob
|
||||
|= [for=? =ship =blob]
|
||||
|= [for=? =ship =blob ship-state=(unit ship-state)]
|
||||
::
|
||||
=/ final-ship ship
|
||||
%- (ev-trace rot.veb final-ship |.("send-blob: to {<ship>}"))
|
||||
|-
|
||||
|^ ^+ event-core
|
||||
::
|
||||
=/ ship-state (~(get by peers.ames-state) ship)
|
||||
::
|
||||
?. ?=([~ %known *] ship-state)
|
||||
?: ?=(%pawn (clan:title ship))
|
||||
(try-next-sponsor (^sein:title ship))
|
||||
%+ enqueue-alien-todo ship
|
||||
%^ enqueue-alien-todo ship ship-state
|
||||
|= todos=alien-agenda
|
||||
todos(packets (~(put in packets.todos) blob))
|
||||
::
|
||||
@ -2707,7 +2712,7 @@
|
||||
::
|
||||
?: =(ship sponsor)
|
||||
event-core
|
||||
^$(ship sponsor)
|
||||
^$(ship sponsor, ship-state (~(get by peers.ames-state) sponsor))
|
||||
--
|
||||
:: +attestation-packet: generate signed self-attestation for .her
|
||||
::
|
||||
@ -2901,10 +2906,6 @@
|
||||
:: expire direct route if the peer is not responding
|
||||
::
|
||||
=. peer-state (update-peer-route her peer-state)
|
||||
:: required so that the following +send-blob's (including
|
||||
:: inside +call:mu), access up-to-date peer state
|
||||
::
|
||||
=. event-core abet
|
||||
:: resend comet attestation packet if first message times out
|
||||
::
|
||||
:: The attestation packet doesn't get acked, so if we tried to
|
||||
@ -2918,7 +2919,8 @@
|
||||
?& ?=(%pawn (clan:title our))
|
||||
=(1 current:(~(got by snd.peer-state) bone))
|
||||
==
|
||||
(send-blob | her (attestation-packet [her her-life]:channel))
|
||||
=/ =blob (attestation-packet [her her-life]:channel)
|
||||
(send-blob for=| her blob `known/peer-state)
|
||||
?: (is-corked bone)
|
||||
:: no-op if the bone (or, if a naxplanation, the reference bone)
|
||||
:: was corked, because the flow doesn't exist anymore
|
||||
@ -3046,13 +3048,16 @@
|
||||
:: here.
|
||||
::
|
||||
=. event-core
|
||||
%^ send-blob | her
|
||||
%- etch-shot
|
||||
%: etch-shut-packet
|
||||
shut-packet(bone (mix 1 bone.shut-packet))
|
||||
symmetric-key.channel
|
||||
our her
|
||||
our-life.channel her-life.channel
|
||||
%: send-blob for=| her
|
||||
%- etch-shot
|
||||
%: etch-shut-packet
|
||||
shut-packet(bone (mix 1 bone.shut-packet))
|
||||
symmetric-key.channel
|
||||
our her
|
||||
our-life.channel her-life.channel
|
||||
==
|
||||
::
|
||||
ship-state=`known/peer-state
|
||||
==
|
||||
peer-core
|
||||
:: +recork-one: re-send the next %cork to the peer
|
||||
@ -3363,20 +3368,17 @@
|
||||
::
|
||||
=. snd.peer-state (~(del by snd.peer-state) bone)
|
||||
peer-core
|
||||
:: if odd bone, ack is on "subscription update" message; no-op
|
||||
::
|
||||
?: =(1 (end 0 bone)) peer-core
|
||||
:: even bone; is this bone a nack-trace bone?
|
||||
::
|
||||
?: =(1 (end 0 (rsh 0 bone)))
|
||||
:: nack-trace bone; assume .ok, clear nack from |message-sink
|
||||
?: =(1 (end 0 bone))
|
||||
:: ack is on "subscription update" message; no-op
|
||||
::
|
||||
?: =(0 (end 0 (rsh 0 bone))) peer-core
|
||||
:: nack-trace bone; assume .ok, clear nack from |sink
|
||||
::
|
||||
abet:(call:(abed:mi (mix 0b10 bone)) %drop message-num)
|
||||
?: &(closing ?=(%near -.task))
|
||||
:: if the bone belongs to a closing flow and we got a
|
||||
:: naxplanation, don't relay ack to the client vane
|
||||
::
|
||||
peer-core
|
||||
:: if the bone belongs to a closing flow and we got a
|
||||
:: naxplanation, don't relay ack to the client vane
|
||||
::
|
||||
?: &(closing ?=(%near -.task)) peer-core
|
||||
:: not a nack-trace bone; relay ack to client vane
|
||||
::
|
||||
(pe-emit (got-duct bone) %give %done error)
|
||||
@ -3633,7 +3635,12 @@
|
||||
=/ acc
|
||||
:* found=`?`%.n
|
||||
resends=*(list static-fragment)
|
||||
metrics=metrics.state
|
||||
:: num-live is still present in pump-metrics but not used
|
||||
:: internally by |ga, so we reuse it the +dip traversal to
|
||||
:: keep track of the number of packets waiting acks
|
||||
:: (also used in the accumulator in +on-done:pu)
|
||||
::
|
||||
metrics=metrics.state(num-live ~(wyt by live.state))
|
||||
==
|
||||
::
|
||||
^+ [acc live=live.state]
|
||||
@ -3645,14 +3652,15 @@
|
||||
==
|
||||
^- [new-val=(unit live-packet-val) stop=? _acc]
|
||||
::
|
||||
=/ gauge (ga metrics.acc ~(wyt by live.state))
|
||||
=/ gauge (ga metrics.acc num-live.metrics.acc)
|
||||
:: is this the acked packet?
|
||||
::
|
||||
?: =(key [message-num fragment-num])
|
||||
:: delete acked packet, update metrics, and stop traversal
|
||||
::
|
||||
=. found.acc %.y
|
||||
=. metrics.acc (on-ack:gauge -.val)
|
||||
=. found.acc %.y
|
||||
=. metrics.acc (on-ack:gauge -.val)
|
||||
=. num-live.metrics.acc (dec num-live.metrics.acc)
|
||||
[new-val=~ stop=%.y acc]
|
||||
:: is this a duplicate ack?
|
||||
::
|
||||
@ -3684,6 +3692,9 @@
|
||||
(pu-trace snd.veb |.("done {<num=message-num show:gauge>}"))
|
||||
::
|
||||
^+ [metrics=metrics.state live=live.state]
|
||||
:: number of sent packets awaiting ack
|
||||
::
|
||||
=. num-live.metrics.state ~(wyt by live.state)
|
||||
::
|
||||
%^ (dip:packet-queue pump-metrics) live.state acc=metrics.state
|
||||
|= $: metrics=pump-metrics
|
||||
@ -3692,7 +3703,7 @@
|
||||
==
|
||||
^- [new-val=(unit live-packet-val) stop=? pump-metrics]
|
||||
::
|
||||
=/ gauge (ga metrics ~(wyt by live.state))
|
||||
=/ gauge (ga metrics num-live.metrics)
|
||||
:: if we get an out-of-order ack for a message, skip until it
|
||||
::
|
||||
?: (lth message-num.key message-num)
|
||||
@ -3700,7 +3711,8 @@
|
||||
:: if packet was from acked message, delete it and continue
|
||||
::
|
||||
?: =(message-num.key message-num)
|
||||
[new-val=~ stop=%.n metrics=(on-ack:gauge -.val)]
|
||||
=. metrics (on-ack:gauge -.val)
|
||||
[new-val=~ stop=%.n metrics(num-live (dec num-live.metrics))]
|
||||
:: we've gone past the acked message; we're done
|
||||
::
|
||||
[new-val=`val stop=%.y metrics]
|
||||
@ -3772,20 +3784,45 @@
|
||||
%drop sink(nax.state (~(del in nax.state) message-num.task))
|
||||
%done (done ok.task)
|
||||
::
|
||||
%hear
|
||||
?. ?| corked
|
||||
%hear
|
||||
|^ ?: ?| corked
|
||||
?& %*(corked sink bone (mix 0b10 bone))
|
||||
=(%nack (received bone))
|
||||
== ==
|
||||
(hear [lane shut-packet ok]:task)
|
||||
:: if we %hear a task on a corked bone, always ack
|
||||
ack-on-corked-bone
|
||||
::
|
||||
=. peer-core
|
||||
%+ send-shut-packet bone
|
||||
[message-num.shut-packet.task %| %| ok=& lag=*@dr]
|
||||
%. sink
|
||||
%+ pe-trace odd.veb
|
||||
|.("hear {<(received bone)>} on corked bone={<bone>}")
|
||||
?> ?=(%& -.meat.shut-packet.task)
|
||||
=+ [num-fragments fragment-num fragment]=+.meat.shut-packet.task
|
||||
?: &(=(num-fragments 1) =(fragment-num 0))
|
||||
(check-pending-acks fragment)
|
||||
(hear [lane shut-packet ok]:task)
|
||||
::
|
||||
++ ack-on-corked-bone
|
||||
:: if we %hear a fragment on a corked bone, always ack
|
||||
::
|
||||
=. peer-core
|
||||
%+ send-shut-packet bone
|
||||
[message-num.shut-packet.task %| %| ok=& lag=*@dr]
|
||||
%. sink
|
||||
%+ pe-trace odd.veb
|
||||
|.("hear {<(received bone)>} on corked bone={<bone>}")
|
||||
::
|
||||
++ check-pending-acks
|
||||
:: if this is a %cork %plea and we are still waiting to
|
||||
:: hear %acks for previous naxplanations we sent, no-op
|
||||
::
|
||||
|= frag=@uw
|
||||
^+ sink
|
||||
=/ blob=* (cue (rep packet-size [frag]~))
|
||||
=+ pump=(abed:mu (mix 0b10 bone))
|
||||
?. ?& ?=(^ ;;((soft [%$ path %cork ~]) blob))
|
||||
?=(^ live.packet-pump-state.state.pump)
|
||||
==
|
||||
(hear [lane shut-packet ok]:task)
|
||||
%. sink
|
||||
%+ pe-trace odd.veb
|
||||
|.("pending ack for naxplanation, skip %cork bone={<bone>}")
|
||||
--
|
||||
==
|
||||
::
|
||||
+| %tasks
|
||||
@ -4016,6 +4053,7 @@
|
||||
::
|
||||
=/ dat [her bone=bone message-num=message-num]
|
||||
?:(ok "sink boon {<dat>}" "crashed on sink boon {<dat>}")
|
||||
=. peer-core (pe-emit (got-duct bone) %give %boon message)
|
||||
=? moves !ok
|
||||
:: we previously crashed on this message; notify client vane
|
||||
::
|
||||
@ -4023,8 +4061,6 @@
|
||||
|= =move
|
||||
?. ?=([* %give %boon *] move) move
|
||||
[duct.move %give %lost ~]
|
||||
::
|
||||
=. peer-core (pe-emit (got-duct bone) %give %boon message)
|
||||
:: send ack unconditionally
|
||||
::
|
||||
(call %done ok=%.y)
|
||||
@ -4161,7 +4197,8 @@
|
||||
|=(frag=@ud `hoot``@`(etch-shot (make-shot %0 fi-full-path frag)))
|
||||
::
|
||||
++ fi-send
|
||||
|=(=blob fine(event-core (send-blob for=| her blob)))
|
||||
|= =blob
|
||||
fine(event-core (send-blob for=| her blob `known/peer-state))
|
||||
::
|
||||
++ fi-give-tune
|
||||
|= dat=(unit roar)
|
||||
@ -4309,12 +4346,12 @@
|
||||
::
|
||||
++ fi-sift-full
|
||||
=, keen
|
||||
~| %frag-mismatch
|
||||
~| have/num-received
|
||||
~| need/num-fragments
|
||||
~| path/path
|
||||
?> =(num-fragments num-received)
|
||||
?> =((lent hav) num-received)
|
||||
?. ?& =(num-fragments num-received)
|
||||
=((lent hav) num-received)
|
||||
==
|
||||
~| :- %frag-mismatch
|
||||
[have/num-received need/num-fragments path/path]
|
||||
!!
|
||||
(sift-roar num-fragments hav)
|
||||
::
|
||||
++ fi-fast-retransmit
|
||||
|
@ -8,6 +8,9 @@
|
||||
++ grab |%
|
||||
++ noun *
|
||||
--
|
||||
++ grow |%
|
||||
++ mime [/application/x-urb-jam (as-octs:mimes:html (jam non))]
|
||||
--
|
||||
++ grad
|
||||
|%
|
||||
++ form %noun
|
||||
|
17
pkg/base-dev/mar/vere.hoon
Normal file
17
pkg/base-dev/mar/vere.hoon
Normal file
@ -0,0 +1,17 @@
|
||||
|_ v=vere
|
||||
++ grab
|
||||
|%
|
||||
++ noun vere
|
||||
--
|
||||
++ grow
|
||||
|%
|
||||
++ json
|
||||
%- pairs:enjs:format
|
||||
:- [%non s+non.v]
|
||||
:- [%rev (path:enjs:format rev.v)]
|
||||
%+ turn kel.v
|
||||
|= w=weft
|
||||
[lal.w (numb:enjs:format num.w)]
|
||||
--
|
||||
++ grad %noun
|
||||
--
|
@ -3,44 +3,30 @@
|
||||
/+ *test, v=test-ames-gall
|
||||
/* kelvin %hoon /sys/kelvin
|
||||
=> |%
|
||||
++ crypto-core
|
||||
|% ++ nec (pit:nu:crub:crypto 512 (shaz 'nec'))
|
||||
++ bud (pit:nu:crub:crypto 512 (shaz 'bud'))
|
||||
++ sign
|
||||
|= [=ship data=@ux]
|
||||
%. data
|
||||
?:(=(ship ~nec) sigh:as:nec sigh:as:bud)
|
||||
--
|
||||
::
|
||||
++ n-frags
|
||||
|= n=@
|
||||
^- @ux
|
||||
:: 6 chosen randomly to get some trailing zeros
|
||||
::
|
||||
%+ rsh 10
|
||||
%+ rep 13
|
||||
%+ turn (gulf 1 n)
|
||||
|=(x=@ (fil 3 1.024 (dis 0xff x)))
|
||||
::
|
||||
++ custom-roof
|
||||
++ kelvin-roof
|
||||
^- roof
|
||||
::
|
||||
|= [lyc=gang pov=path vis=view bem=beam]
|
||||
^- (unit (unit cage))
|
||||
?> =(s.bem /sys/kelvin)
|
||||
?+ vis ~
|
||||
%cp
|
||||
=/ black=dict:clay
|
||||
%*(. *dict:clay mod.rul %black)
|
||||
``noun+!>([black black])
|
||||
::
|
||||
%cz
|
||||
?+ -.r.bem !!
|
||||
%ud ``noun+!>((n-frags p.r.bem))
|
||||
==
|
||||
::
|
||||
%cx ``hoon+!>(kelvin)
|
||||
==
|
||||
::
|
||||
++ bex-roof
|
||||
^- roof
|
||||
|= [lyc=gang vis=view bem=beam]
|
||||
^- (unit (unit cage))
|
||||
?> =(s.bem //some/data/atom)
|
||||
?+ vis ~
|
||||
%gx ``atom+!>((bex (bex 14)))
|
||||
==
|
||||
::
|
||||
++ etch-request-content
|
||||
|= [our=@p =path num=@ud]
|
||||
^- @
|
||||
@ -77,7 +63,7 @@
|
||||
sndr-tick=0b1
|
||||
rcvr-tick=0b1
|
||||
origin=~
|
||||
content=(etch-request-content ~nec /~bud/1/1/c/x/1/kids/sys/kelvin 1)
|
||||
content=(etch-request-content ~nec (weld /~bud/1/1 scry-path) 1)
|
||||
==
|
||||
~& > 'poke requester %ames with a %keen task'
|
||||
=^ t1 ames.nec
|
||||
@ -116,9 +102,9 @@
|
||||
~& > 'gives a remote scry response to listeners'
|
||||
=/ [sig=@ux meows=(list @ux)]
|
||||
%: ames-scry-hunk:v ames.bud
|
||||
[~1111.1.2 0xbeef.dead custom-roof]
|
||||
[~1111.1.2 0xbeef.dead kelvin-roof]
|
||||
~bud
|
||||
[1 16.384 /~bud/1/1/c/x/1/kids/sys/kelvin]
|
||||
[1 16.384 (weld /~bud/1/1 scry-path)]
|
||||
==
|
||||
=/ response=shot:ames
|
||||
:* [sndr=~bud rcvr=~nec]
|
||||
@ -132,7 +118,7 @@
|
||||
==
|
||||
::
|
||||
=/ roar=(unit roar:ames)
|
||||
:+ ~ [/~bud/1/1/c/x/1/kids/sys/kelvin `hoon+kelvin]
|
||||
:+ ~ [(weld /~bud/1/1 scry-path) `hoon+kelvin]
|
||||
[[~bud [1 sig]] ~ ~]
|
||||
=^ t4 ames.nec
|
||||
%: ames-check-call:v ames.nec
|
||||
@ -155,7 +141,7 @@
|
||||
sndr-tick=0b1
|
||||
rcvr-tick=0b1
|
||||
origin=~
|
||||
content=(etch-request-content ~nec /~bud/1/1/c/x/5/kids/sys/kelvin 1)
|
||||
content=(etch-request-content ~nec (weld /~bud/1/1 future-path) 1)
|
||||
==
|
||||
~& > 'poke requester %ames with a %keen task for a future case'
|
||||
=^ t5 ames.nec
|
||||
@ -201,8 +187,8 @@
|
||||
%: ames-check-call:v ames.nec
|
||||
[~1111.1.1 0xdead.beef *roof]
|
||||
[~[/wham-duct] %wham ~bud future-path]
|
||||
:~ [~[/keen-duct-4] [%give %tune [~bud /c/x/5/kids/sys/kelvin] ~]]
|
||||
[~[/keen-duct-5] [%give %tune [~bud /c/x/5/kids/sys/kelvin] ~]]
|
||||
:~ [~[/keen-duct-4] [%give %tune [~bud future-path] ~]]
|
||||
[~[/keen-duct-5] [%give %tune [~bud future-path] ~]]
|
||||
[~[//unix] %pass future-behn %b %rest ~1111.1.1..00.00.01]
|
||||
==
|
||||
==
|
||||
@ -215,4 +201,111 @@
|
||||
listeners:u.keen
|
||||
~& > 'checks no more listeners'
|
||||
(expect-eq !>(~) !>(listeners))
|
||||
::
|
||||
++ test-fine-misordered
|
||||
%- run-chain
|
||||
|. :- %|
|
||||
=+ (nec-bud:v life=[nec=1 bud=1] rift=[nec=1 bud=1])
|
||||
:: uncomment to turn on verbose debug output
|
||||
::=^ * ames.nec
|
||||
:: (ames-call:v ames.nec ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof)
|
||||
::=^ * ames.bud
|
||||
:: (ames-call:v ames.bud ~[/none] [%spew ~[%msg %snd %rcv %odd]] *roof)
|
||||
=/ scry-path=path /g/x/0/dap//some/data/atom
|
||||
=/ fine-behn-wire=wire (weld /fine/behn/wake/~bud scry-path)
|
||||
=/ =task:ames [%keen ~bud scry-path]
|
||||
::
|
||||
=/ requests=(list shot:ames)
|
||||
%+ turn (gulf 1 3)
|
||||
|= frag=@ud
|
||||
^- shot:ames
|
||||
:* [sndr=~nec rcvr=~bud]
|
||||
req=& sam=|
|
||||
sndr-tick=0b1
|
||||
rcvr-tick=0b1
|
||||
origin=~
|
||||
content=(etch-request-content ~nec (weld /~bud/1/1 scry-path) frag)
|
||||
==
|
||||
=+ ^= [req1 req2 req3]
|
||||
?> ?=([^ ^ ^ *] requests)
|
||||
[i i.t i.t.t]:requests
|
||||
~& > 'poke requester %ames with a %keen task'
|
||||
=^ t1 ames.nec
|
||||
%: ames-check-call:v ames.nec
|
||||
[~1111.1.1 0xdead.beef *roof]
|
||||
[~[/keen-duct-1] task]
|
||||
:~ [~[//unix] [%give %send [%& ~bud] (etch-shot:ames req1)]]
|
||||
[~[//unix] %pass fine-behn-wire %b %wait ~1111.1.1..00.00.01]
|
||||
==
|
||||
==
|
||||
::
|
||||
=/ [sig=@ux meows=(list @ux)]
|
||||
%: ames-scry-hunk:v ames.bud
|
||||
[~1111.1.1 0xbeef.dead bex-roof]
|
||||
~bud
|
||||
[1 16.384 (weld /~bud/1/1 scry-path)]
|
||||
==
|
||||
=/ responses=(list shot:ames)
|
||||
%+ turn meows
|
||||
|= m=@ux
|
||||
^- shot:ames
|
||||
:* [sndr=~bud rcvr=~nec]
|
||||
req=| sam=|
|
||||
sndr-tick=0b1
|
||||
rcvr-tick=0b1
|
||||
origin=~
|
||||
content=m
|
||||
==
|
||||
=+ ^= [resp1 resp2 resp3]
|
||||
?> ?=([^ ^ ^ *] responses)
|
||||
[i i.t i.t.t]:responses
|
||||
::
|
||||
=/ roar=(unit roar:ames)
|
||||
:+ ~ [(weld /~bud/1/1 scry-path) `atom+(bex (bex 14))]
|
||||
[[~bud [1 sig]] ~ ~]
|
||||
::
|
||||
:- t1 |. :- %|
|
||||
~& > 'hear first response fragment'
|
||||
=^ t2 ames.nec
|
||||
%: ames-check-call:v ames.nec
|
||||
[~1111.1.2 0xbeef.dead *roof]
|
||||
:- ~[//fine]
|
||||
:* %hear [%& ~bud]
|
||||
(etch-shot:ames resp1)
|
||||
==
|
||||
:~ [~[//fine] %pass /qos %d %flog %text "; ~bud is your neighbor"]
|
||||
[~[//unix] [%give %send [%& ~bud] (etch-shot:ames req2)]]
|
||||
[~[//unix] [%give %send [%& ~bud] (etch-shot:ames req3)]]
|
||||
[~[//unix] %pass fine-behn-wire %b %rest ~1111.1.1..00.00.01]
|
||||
[~[//unix] %pass fine-behn-wire %b %wait ~1111.1.2..00.02.00]
|
||||
==
|
||||
==
|
||||
::
|
||||
:- t2 |. :- %|
|
||||
~& > 'hear third response fragment'
|
||||
=^ t3 ames.nec
|
||||
%: ames-check-call:v ames.nec
|
||||
[~1111.1.2 0xbeef.dead *roof]
|
||||
:- ~[//fine]
|
||||
:* %hear [%& ~bud]
|
||||
(etch-shot:ames resp3)
|
||||
==
|
||||
::
|
||||
~
|
||||
==
|
||||
:- t3 |. :- %&
|
||||
~& > 'hear second response fragment'
|
||||
=^ t4 ames.nec
|
||||
%: ames-check-call:v ames.nec
|
||||
[~1111.1.3 0xbeef.dead *roof]
|
||||
:- ~[//fine]
|
||||
:* %hear [%& ~bud]
|
||||
(etch-shot:ames resp2)
|
||||
==
|
||||
:~ [~[/keen-duct-1] %give %tune [~bud scry-path] roar]
|
||||
[~[//unix] %pass fine-behn-wire %b %rest ~1111.1.2..00.02.00]
|
||||
==
|
||||
==
|
||||
::
|
||||
t4
|
||||
--
|
||||
|
@ -503,6 +503,25 @@
|
||||
!> [~[/g/talk] %give %done `error]
|
||||
!> (snag 0 `(list move:ames)`moves5)
|
||||
::
|
||||
++ test-boon-lost ^- tang
|
||||
:: ~nec -> %plea -> ~bud
|
||||
::
|
||||
=^ moves1 nec (call nec ~[/g/talk] %plea ~bud %g /talk [%get %post])
|
||||
=^ moves2 bud (call bud ~[//unix] %hear (snag-packet 0 moves1))
|
||||
:: ~bud -> %done -> ~nec
|
||||
::
|
||||
=^ moves3 bud (take bud /bone/~nec/0/1 ~[//unix] %g %done ~)
|
||||
=^ moves4 nec (call nec ~[//unix] %hear (snag-packet 0 moves3))
|
||||
:: ~bud -> %boon -> ~nec, but we tell ~nec it crashed during the handling
|
||||
::
|
||||
=^ moves5 bud (take bud /bone/~nec/0/1 ~[//unix] %g %boon [%post 'first1'])
|
||||
=^ moves6 nec
|
||||
=/ vane-core (nec(now `@da`(add ~s1 now.nec)))
|
||||
(call:vane-core ~[//unix] `[%test-error ~] %hear (snag-packet 0 moves5))
|
||||
%+ expect-eq
|
||||
!> [~[/g/talk] %give %lost ~]
|
||||
!> (snag 0 `(list move:ames)`moves6)
|
||||
::
|
||||
++ test-fine-request
|
||||
^- tang
|
||||
=/ want=path /c/z/1/kids/sys
|
||||
|
Loading…
Reference in New Issue
Block a user