diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index e8e3c6132..2edd37aef 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -1104,14 +1104,14 @@ == == $: %9 $% $: %larva - events=(qeu queued-event) + events=(qeu queued-event-11) state=ames-state-9 == [%adult state=ames-state-9] == == $: %10 $% $: %larva - events=(qeu queued-event) + events=(qeu queued-event-11) state=ames-state-10 == [%adult state=ames-state-10] @@ -1137,7 +1137,7 @@ == [%adult state=_ames-state.adult-gate] == == == - ?- old + |^ ?- old [%4 %adult *] $(old [%5 %adult (state-4-to-5:load:adult-core state.old)]) :: @@ -1197,7 +1197,7 @@ [%9 %larva *] ~> %slog.0^leaf/"ames: larva: load" =. cached-state `[%9 state.old] - =. queued-events events.old + =. queued-events (event-11-to-12 events.old) larval-gate :: [%10 %adult *] @@ -1208,7 +1208,7 @@ [%10 %larva *] ~> %slog.1^leaf/"ames: larva: load" =. cached-state `[%10 state.old] - =. queued-events events.old + =. queued-events (event-11-to-12 events.old) larval-gate :: [%11 %adult *] @@ -1219,17 +1219,7 @@ [%11 %larva *] ~> %slog.1^leaf/"ames: larva: load" =. cached-state `[%11 state.old] - =. queued-events - :: "+rep:in on a +qeu looks strange, but works fine." - :: - %- ~(rep in events.old) - |= [e=queued-event-11 q=(qeu queued-event)] - %- ~(put to q) ^- queued-event - ?. ?=(%call -.e) e - =/ task=task-11 ((harden task-11) wrapped-task.e) - %= e - wrapped-task ?.(?=(%snub -.task) task [%snub %deny ships.task]) - == + =. queued-events (event-11-to-12 events.old) larval-gate :: [%12 %adult *] @@ -1252,6 +1242,21 @@ larval-gate :: == + :: + ++ event-11-to-12 + |= events=(qeu queued-event-11) + ^- (qeu queued-event) + :: "+rep:in on a +qeu looks strange, but works fine." + :: + %- ~(rep in events) + |= [e=queued-event-11 q=(qeu queued-event)] + %- ~(put to q) ^- queued-event + ?. ?=(%call -.e) e + =/ task=task-11 ((harden task-11) wrapped-task.e) + %= e + wrapped-task ?.(?=(%snub -.task) task [%snub %deny ships.task]) + == + -- :: +molt: re-evolve to adult-ames :: ++ molt @@ -1864,7 +1869,7 @@ %. & (ev-trace &(dry odd.veb) ship |.((weld "stale %watch plea " log))) :: the current subscription can be safely corked if there - :: is a flow with a naxplanation ack on a backward bone + :: is a flow with a naxplanation ack on a backward bone :: =+ backward-bone=(mix 0b10 bone) ?. =(2 (mod backward-bone 4)) @@ -2469,6 +2474,14 @@ ~| %dangling-bone^her^bone (~(got by by-bone.ossuary.peer-state) bone) :: + ++ is-corked + |= =bone + ?| (~(has in corked.peer-state) bone) + ?& =(1 (end 0 bone)) + =(1 (end 0 (rsh 0 bone))) + (~(has in corked.peer-state) (mix 0b10 bone)) + == == + :: +| %tasks :: ++ on-heed @@ -2518,8 +2531,7 @@ abet:(call:(abed:mi bone) %hear lane shut-packet ?=(~ dud)) :: benign ack on corked bone :: - ?: (~(has in corked.peer-state) bone) - peer-core + ?: (is-corked bone) peer-core :: Just try again on error, printing trace :: :: Note this implies that vanes should never crash on %done, @@ -2600,10 +2612,10 @@ =(1 current:(~(got by snd.peer-state) bone)) == (send-blob | her (attestation-packet [her her-life]:channel)) - ?: (~(has in corked.peer-state) bone) - :: if the bone was corked the flow doesn't exist anymore - :: TODO: clean up corked bones in the peer state when it's _safe_? - :: (e.g. if this bone is N blocks behind the next one) + ?: (is-corked bone) + :: no-op if the bone (or, if a naxplanation, the reference bone) + :: was corked, because the flow doesn't exist anymore + :: TODO: clean up corked bones? :: peer-core :: maybe resend some timed out packets @@ -2765,21 +2777,23 @@ :: ++ handle-cork |= =bone - ^+ peer-core + |^ ^+ peer-core ?. (~(has in closing.peer-state) bone) peer-core - =/ =message-pump-state + =/ pump=message-pump-state (~(gut by snd.peer-state) bone *message-pump-state) - =? peer-core ?=(^ next-wake.packet-pump-state.message-pump-state) - =* next-wake u.next-wake.packet-pump-state.message-pump-state - =/ =wire (make-pump-timer-wire her bone) - :: resetting timer for boons + =? event-core ?=(^ next-wake.packet-pump-state.pump) + :: reset-timer for boons :: - (pe-emit [/ames]~ %pass wire %b %rest next-wake) + (reset-timer her bone u.next-wake.packet-pump-state.pump) =/ nax-bone=^bone (mix 0b10 bone) - =? peer-core (~(has by snd.peer-state) nax-bone) - %. peer-core - %+ pe-trace odd.veb - |.("remove naxplanation flow {<[her bone=nax-bone]>}") + =/ nax-pump=message-pump-state + (~(gut by snd.peer-state) nax-bone *message-pump-state) + =? event-core ?=(^ next-wake.packet-pump-state.nax-pump) + %- %^ ev-trace odd.veb her + |.("remove naxplanation flow {<[her bone=nax-bone]>}") + :: reset timer for naxplanations + :: + (reset-timer her nax-bone u.next-wake.packet-pump-state.nax-pump) =. peer-state =, peer-state %_ peer-state @@ -2791,6 +2805,11 @@ closing (~(del in closing) bone) == peer-core + :: + ++ reset-timer + |= [=ship =^bone wake=@da] + (emit [/ames]~ %pass (make-pump-timer-wire ship bone) %b %rest wake) + -- :: +| %internals :: +mu: constructor for |pump message sender core diff --git a/pkg/arvo/sys/vane/behn.hoon b/pkg/arvo/sys/vane/behn.hoon index 78f13c81a..d5eb8f5df 100644 --- a/pkg/arvo/sys/vane/behn.hoon +++ b/pkg/arvo/sys/vane/behn.hoon @@ -108,10 +108,9 @@ [duct card] =/ =tang (weld u.error `tang`[leaf/"drip failed" ~]) - :: XX should be - :: [duct %hurl fail/tang card] + :: XX we don't know the mote due to the %wake pattern :: - [duct %pass /drip-slog %d %flog %crud %drip-fail tang] + [duct %hurl fail/tang card] :: +| %tasks :: diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index d265dba7a..c2baa47eb 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1404,7 +1404,7 @@ `[[care.mood case.mood syd] path.mood cage]:[u.res syd=syd] ?~ ref [%give %writ riot] - [%slip %b %drip !>([%writ riot])] + [%pass /drip %b %drip !>([%writ riot])] :: ++ case-to-date |= =case @@ -3921,7 +3921,7 @@ (~(run in moods) |=(m=mood [care.m path.m])) =/ gift [%wris cas res] ?: ?=(^ ref) - [%slip %b %drip !>(gift)] + [%pass /drip %b %drip !>(gift)] :: XX s/b [%behn %wris ...] in $sign? [%give gift] ?> ?=([* ~ ~] res) :_ ~ @@ -6065,7 +6065,25 @@ |= [tea=wire hen=duct dud=(unit goof) hin=sign] ^+ [*(list move) ..^$] ?^ dud - ~|(%clay-take-dud (mean tang.u.dud)) + ?+ tea + ~|(%clay-take-dud (mean tang.u.dud)) + :: + [%drip ~] + %. [~ ..^$] + %- slog + ^- tang + :* 'clay: drip fail' + [%rose [": " "" ""] 'bail' mote.u.dud ~] + tang.u.dud + == + == + :: + :: pseudo %slip on %drip + :: + ?: ?=([%drip ~] tea) + ?> ?=([?(%behn %clay) ?(%writ %wris) *] hin) + [[`move`[hen %give +.hin] ~] ..^$] + :: ?: ?=([%lu %load *] tea) ?> ?=(%unto +<.hin) ?> ?=(%poke-ack -.p.hin) @@ -6273,7 +6291,7 @@ ~(tap in ducts) =/ cancel-moves=(list move) %+ turn cancel-ducts - |=(=duct [duct %slip %b %drip !>([%writ ~])]) + |=(=duct [duct %pass /drip %b %drip !>([%writ ~])]) :: delete local state of foreign desk :: =. hoy.ruf (~(del by hoy.ruf) who) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 0972d75c9..94d204331 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -1348,13 +1348,13 @@ :: =/ heartbeat-time=@da (add now ~s20) =/ heartbeat (set-heartbeat-move channel-id heartbeat-time) - :: clear the event queue, record the duct for future output and + :: record the duct for future output and :: record heartbeat-time for possible future cancel :: =. session.channel-state.state %+ ~(jab by session.channel-state.state) channel-id |= =channel - channel(events ~, state [%| duct], heartbeat (some [heartbeat-time duct])) + channel(state [%| duct], heartbeat (some [heartbeat-time duct])) :: [[heartbeat :(weld http-moves cancel-moves moves)] state] :: +acknowledge-events: removes events before :last-event-id on :channel-id diff --git a/pkg/arvo/ted/test.hoon b/pkg/arvo/ted/test.hoon index fb4064bd5..d483fb1ff 100644 --- a/pkg/arvo/ted/test.hoon +++ b/pkg/arvo/ted/test.hoon @@ -26,13 +26,6 @@ &+[leaf+"OK {name}"]~ |+(flop `tang`[leaf+"FAILED {name}" p.run]) == -:: +filter-tests-by-prefix: TODO document -:: -++ filter-tests-by-prefix - |= [prefix=path tests=(list test)] - ^+ tests - =/ prefix-length=@ud (lent prefix) - (skim tests |=([p=path *] =(prefix (scag prefix-length p)))) :: +resolve-test-paths: add test names to file paths to form full identifiers :: ++ resolve-test-paths @@ -130,15 +123,11 @@ gather-tests(fiz t.fiz, build-ok |) ~> %slog.0^leaf+"built {(spud s.beam.i.fiz)}" =/ arms=(list test-arm) (get-test-arms u.cor) - :: - :: XX this logic appears to be vestigial - :: + :: if test path specified an arm prefix, filter arms to match =? arms ?=(^ test.i.fiz) - |- ^+ arms - ?~ arms ~|(no-test-arm+i.fiz !!) - ?: =(name.i.arms u.test.i.fiz) - [i.arms]~ - $(arms t.arms) + %+ skim arms + |= test-arm + =((end [3 (met 3 u.test.i.fiz)] name) u.test.i.fiz) =. test-arms (~(put by test-arms) (snip s.beam.i.fiz) arms) gather-tests(fiz t.fiz) %- pure:m !> ^= ok diff --git a/pkg/base-dev/lib/sss.hoon b/pkg/base-dev/lib/sss.hoon index 3a6d9114c..8a9506d9f 100644 --- a/pkg/base-dev/lib/sss.hoon +++ b/pkg/base-dev/lib/sss.hoon @@ -237,10 +237,27 @@ %+ ~(put by pub) path =/ last=[=aeon =rock:lake] (fall (pry:rok rok.tide) *[key val]:rok) =. wav.tide (put:wav wav.tide next wave) - =. mem.tide (~(del by mem.tide) next) + =. mem.tide ~ ?. =(next (add aeon.last waves.rul.tide)) buoy buoy(tid (form tide)) :: + ++ fork :: Fork a pub into an empty path. + |= [from=paths to=paths] + ^- pubs + :- %0 + ?< (~(has by pub) to) + (~(put by pub) to (~(got by pub) from)) + :: + ++ copy :: Fork a sub into an empty path. + |= [sub=_(mk-subs lake *) from=[ship dude *] to=paths] + ^- pubs + :- %0 + ?< (~(has by pub) to) + %+ ~(put by pub) to + %* . *$<(aeon buoy) + rok.tid (put:rok ~ [aeon rock]:(need (~(got by +:sub) from))) + == + :: ++ perm :: Change permissions with gate. |= [where=(list paths) diff=$-((unit (set ship)) (unit (set ship)))] ^- pubs diff --git a/pkg/base-dev/sur/hood.hoon b/pkg/base-dev/sur/hood.hoon index ece12a30e..f0ec60624 100644 --- a/pkg/base-dev/sur/hood.hoon +++ b/pkg/base-dev/sur/hood.hoon @@ -31,6 +31,18 @@ ++ $ |= [? ? ? ? ?] (report-vats:abed +<) + :: + ++ kel-path + |= =desk + ^- path + /[ego]/[desk]/[wen]/sys/kelvin + :: + ++ desk-exists + |= =desk + ?& !=(ud.cass 0):.^(=cass %cw /[ego]/[desk]/[wen]) + .^(? %cu (kel-path desk)) + == + :: ++ abed %= ..abed cone .^(^cone %cx /[ego]//[wen]/domes) @@ -47,7 +59,7 @@ |= desk=_`desk`%base =/ pike (~(got by pikes) desk) =/ zest -:(~(got by rock) desk) - =/ kel-path /[ego]/[desk]/[wen]/sys/kelvin + =/ kel-path (kel-path desk) =/ sink=sink ?~ s=(~(get by sor) desk) ~ @@ -62,8 +74,6 @@ desk=desk ^= running =(%live zest) ^= suspended =(%dead zest) - ^= exists !=(ud.cass 0):.^(=cass %cw /[ego]/[desk]/[wen]) - ^= bad-desk ?!(.^(? %cu kel-path)) ^= meb :: =(list @uv) ?~ sink [hash]~ (mergebase-hashes our desk now her.u.sink sud.u.sink) @@ -90,6 +100,7 @@ !=(%live zest.pike) !(~(has in wic.pike) kel) == == + :: ++ report-vats |= $: verb=? show-suspended=? @@ -97,33 +108,33 @@ show-blocking=? show-nonexistent=? == + =/ [real=(list desk) fake=(list desk)] + (skid ~(tap in desks) desk-exists) + =; reals=tang + ?. show-nonexistent + reals + %+ weld reals + `tang`(turn fake |=(=desk leaf+"nonexistent desk: {}")) %+ turn - %+ skim - %+ turn ~(tap in desks) - |= =desk (vat-info desk) + %+ skim (turn real vat-info) |= vat-info - :: just unconditionally show "bad" desks, whatever that means - ?| bad-desk - &(suspended show-suspended) + ?| &(suspended show-suspended) &(running show-running) &(blocking show-blocking) - &(!exists show-nonexistent) == |= =vat-info + ^- tank :+ %rose [" " " " "::"] :- leaf+"{}" %- flop %- report-vat [verb vat-info] + :: ++ report-vat |= [verb=? vat-info] ^- tang - ?: !exists - ~[leaf+"desk does not yet exist: {}"] ?: =(%kids desk) ~[leaf+"%kids %cz hash: {}"] - ?: bad-desk - ~[leaf+"bad desk: {}"] %- flop ?. verb :~ leaf/"/sys/kelvin: {kul}"