Skip to content

Commit

Permalink
Merge pull request #6507 from urbit/release/urbit-os-v2.138
Browse files Browse the repository at this point in the history
Release urbit-os-v2.138
  • Loading branch information
pkova committed Apr 25, 2023
2 parents d6f7524 + d8ce64b commit c2c36f4
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 52 deletions.
5 changes: 2 additions & 3 deletions pkg/arvo/app/ping.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@
%- (slog leaf+"ping: strange state {<ship s>}" ~)
`state
:: NAT timeouts are often pretty short for UDP entries. 5
:: minutes is a common value. We use 30 seconds, which is fairly
:: aggressive, but should be safe.
:: minutes is a common value. We use 25 seconds, same as Wireguard.
::
=/ until (add ~s30 now)
=/ until (add ~s25 now)
=. ships.state
(~(put by ships.state) ship u.s(ship-state [%waiting until]))
:_ state
Expand Down
11 changes: 10 additions & 1 deletion pkg/arvo/sys/arvo.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@
::
~> %slog.[0 leaf+"1-c (compiling compiler, wait a few minutes)"]
=/ compiler-tool
~> %bout
.*([compiler-gate noun/hoon.log] [%9 2 %10 [6 %0 3] %0 2])
::
:: switch to the second-generation compiler. we want to be
Expand All @@ -781,7 +782,7 @@
:: generate last-generation spans for `!>`, etc.
::
~> %slog.[0 leaf+"1-d"]
=. compiler-gate .*(0 +.compiler-tool)
=. compiler-gate ~>(%bout .*(0 +.compiler-tool))
::
:: get the span (type) of the kernel core, which is the context
:: of the compiler gate. we just compiled the compiler,
Expand All @@ -791,17 +792,20 @@
::
~> %slog.[0 leaf+"1-e"]
=/ kernel-span
~> %bout
-:.*([compiler-gate -.compiler-tool '+>'] [%9 2 %10 [6 %0 3] %0 2])
::
:: compile the arvo source against the kernel core.
::
~> %slog.[0 leaf+"1-f"]
=/ kernel-tool
~> %bout
.*([compiler-gate kernel-span arvo.log] [%9 2 %10 [6 %0 3] %0 2])
::
:: create the arvo kernel, whose subject is the kernel core.
::
~> %slog.[0 leaf+"1-g"]
~> %bout
[.*(+>.compiler-gate +.kernel-tool) epic.log]
--
::
Expand Down Expand Up @@ -1046,6 +1050,7 @@
|= [cap=tape sub=vase pax=path txt=@t]
^- vase
~> %slog.[0 leaf/"{cap}: {(scow p+(mug txt))}"]
~> %bout
%- road |.
~_ leaf/"{cap}: build failed"
(slap sub (rain pax txt))
Expand Down Expand Up @@ -1623,6 +1628,7 @@
?~ hun
=/ gat
~> %slog.[0 'arvo: compiling next arvo']
~> %bout
%- road |.
(slap !>(..ride) (rain /sys/arvo/hoon van))
=/ lod
Expand All @@ -1640,6 +1646,7 @@
::
=/ raw
~> %slog.[0 'arvo: compiling hoon']
~> %bout
(road |.((ride %noun u.hun)))
:: activate the new compiler gate, producing +ride
::
Expand All @@ -1665,6 +1672,7 @@
[raw cop]
=/ hot
~> %slog.[0 leaf/"arvo: recompiling hoon %{(scow %ud nex)}"]
~> %bout
(road |.((slum cop [%noun u.hun])))
[hot .*(0 +.hot)]
:: extract the hoon core from the outer gate (+ride)
Expand All @@ -1680,6 +1688,7 @@
::
=/ rav
~> %slog.[0 'arvo: compiling next arvo']
~> %bout
(road |.((slum cop [hyp van])))
:: activate arvo and extract the arvo core from the outer gate
::
Expand Down
61 changes: 40 additions & 21 deletions pkg/arvo/sys/vane/ames.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,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))
Expand Down Expand Up @@ -2352,6 +2352,13 @@
::
++ pump-core |=(=bone (mu bone *message-pump-state))
++ sink-core |=(=bone (mi bone *message-sink-state))
++ 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
::
Expand Down Expand Up @@ -2399,10 +2406,9 @@
:_ tang.u.dud
leaf+"ames: {<her>} fragment crashed {<mote.u.dud>}"
abet:(call:abed:(sink-core bone) %hear lane shut-packet ?=(~ dud))
:: benign ack on corked bone
:: benign ack on corked bone (also for naxplanation acks)
::
?: (~(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,
Expand Down Expand Up @@ -2503,10 +2509,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
Expand Down Expand Up @@ -2645,21 +2651,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
Expand All @@ -2671,6 +2679,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
Expand Down Expand Up @@ -3330,13 +3343,19 @@
++ num-slots
^- @ud
(sub-safe cwnd live-packets)
::
:: +clamp-rto: apply min and max to an .rto value
::
++ clamp-rto
|= rto=@dr
^+ rto
(min ~m2 (max ^~((div ~s1 5)) rto))
(min max-backoff (max ^~((div ~s1 5)) rto))
:: +max-backoff: calculate highest re-send interval
::
:: Keeps pinhole to sponsors open by inspecting the duct (hack).
::
++ max-backoff
^- @dr
?:(?=([[%gall %use %ping *] *] duct) ~s25 ~m2)
:: +in-slow-start: %.y iff we're in "slow-start" mode
::
++ in-slow-start
Expand Down
5 changes: 2 additions & 3 deletions pkg/arvo/sys/vane/behn.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -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
::
Expand Down
26 changes: 22 additions & 4 deletions pkg/arvo/sys/vane/clay.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,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
Expand Down Expand Up @@ -3781,7 +3781,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)
:_ ~
Expand Down Expand Up @@ -5753,7 +5753,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)
Expand Down Expand Up @@ -5909,7 +5927,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)
Expand Down
6 changes: 4 additions & 2 deletions pkg/arvo/sys/vane/dill.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@
wrapped-task=(hobo task)
==
^+ [*(list move) ..^$]
~| wrapped-task
=/ task=task ((harden task) wrapped-task)
=/ task=task
~| wrapped-task
((harden task) wrapped-task)
~| -.task
:: unwrap session tasks, default to session %$
::
=^ ses=@tas task
Expand Down
4 changes: 2 additions & 2 deletions pkg/arvo/sys/vane/eyre.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 4 additions & 15 deletions pkg/arvo/ted/test.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
19 changes: 18 additions & 1 deletion pkg/base-dev/lib/sss.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2c36f4

Please sign in to comment.