1
0
mirror of https://github.com/ilyakooo0/urbit.git synced 2024-12-19 04:41:37 +03:00

Merge pull request from urbit/release/urbit-os-v2.138

Release urbit-os-v2.138
This commit is contained in:
Pyry Kovanen 2023-04-25 17:58:36 +03:00 committed by GitHub
commit c2c36f42f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 104 additions and 52 deletions

View File

@ -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

View File

@ -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
@ -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,
@ -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]
--
::
@ -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))
@ -1623,6 +1628,7 @@
?~ hun
=/ gat
~> %slog.[0 'arvo: compiling next arvo']
~> %bout
%- road |.
(slap !>(..ride) (rain /sys/arvo/hoon van))
=/ lod
@ -1640,6 +1646,7 @@
::
=/ raw
~> %slog.[0 'arvo: compiling hoon']
~> %bout
(road |.((ride %noun u.hun)))
:: activate the new compiler gate, producing +ride
::
@ -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)
@ -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
::

View File

@ -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))
@ -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
::
@ -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,
@ -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
@ -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
@ -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
@ -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

View File

@ -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
::

View File

@ -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
@ -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)
:_ ~
@ -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)
@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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