mirror of
https://github.com/urbit/shrub.git
synced 2024-12-30 15:44:03 +03:00
Merge pull request #6610 from urbit/release/urbit-os-v2.140
Release urbit-os-v2.140
This commit is contained in:
commit
77cfbe76c5
11
pkg/arvo/gen/ames-keys.hoon
Normal file
11
pkg/arvo/gen/ames-keys.hoon
Normal file
@ -0,0 +1,11 @@
|
||||
:: Print keys for a ship, as stored in %ames
|
||||
::
|
||||
:- %say
|
||||
|= [[now=time @ our=ship ^] [=ship ~] ~]
|
||||
=+ .^ =ship-state:ames
|
||||
%ax /(scot %p our)//(scot %da now)/peers/(scot %p ship)
|
||||
==
|
||||
:- %noun
|
||||
?. ?=(%known -.ship-state)
|
||||
%ship-still-alien
|
||||
[life=life rift=rift]:+.ship-state
|
@ -10,14 +10,11 @@
|
||||
=/ our p.bec
|
||||
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
|
||||
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
|
||||
~& >> "Error: desk {<desk>} does not exist."
|
||||
helm-pass+[%d %noop ~]
|
||||
helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
|
||||
=/ existing-story .^(? %cu /(scot %p our)/[desk]/(scot %da now)/story)
|
||||
?: ?&(existing-story !overwrite)
|
||||
~& >> "Error: /{(trip (slav %tas desk))}/story already exists."
|
||||
~& >> "To forcibly overwrite, use `=overwrite %.y`"
|
||||
:: XX could use a better way to noop
|
||||
helm-pass+[%d %noop ~]
|
||||
:- %helm-pass
|
||||
[%d %flog %text "Error: /{(trip (slav %tas desk))}/story already exists. To forcibly overwrite, use `=overwrite %.y`"]
|
||||
=| tale=story
|
||||
:- %helm-pass
|
||||
[%c [%info desk %& [/story %ins story+!>(tale)]~]]
|
@ -13,8 +13,7 @@
|
||||
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
|
||||
=? cas =(*case cas) r.bec :: use case from beak if cas not provided
|
||||
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
|
||||
~& >> "Error: desk {<desk>} does not exist."
|
||||
helm-pass+[%d %noop ~]
|
||||
helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
|
||||
=/ tak=tako:clay
|
||||
?: ?=([%tako tako:clay] cas)
|
||||
p.cas
|
||||
@ -25,8 +24,7 @@
|
||||
::
|
||||
=/ pax /(scot %p our)/[desk]/(scot %da now)/story
|
||||
?: !.^(? %cu pax)
|
||||
~& >> "Error: No story file found. Please use |story-init to create one."
|
||||
helm-pass+[%d %noop ~]
|
||||
helm-pass+[%d %flog %text "Error: No story file found. Please use |story-init to create one."]
|
||||
=/ tale=story .^(story %cx pax)
|
||||
=. tale
|
||||
?: =(*prose prz)
|
||||
|
@ -13,8 +13,7 @@
|
||||
=? desk =(*^desk desk) q.bec :: use current desk if user didn't provide
|
||||
=? cas =(*case cas) r.bec :: use case from beak if cas not provided
|
||||
?: !(~(has in .^((set ^desk) %cd /(scot %p our)/$/(scot %da now))) desk)
|
||||
~& >> "Error: desk {<desk>} does not exist."
|
||||
helm-pass+[%d %noop ~]
|
||||
helm-pass+[%d %flog %text "Error: desk {<desk>} does not exist."]
|
||||
=/ tak=tako:clay
|
||||
?: ?=([%tako tako:clay] cas)
|
||||
p.cas
|
||||
@ -25,8 +24,7 @@
|
||||
::
|
||||
=/ pax /(scot %p our)/[desk]/(scot %da now)/story
|
||||
?: !.^(? %cu pax)
|
||||
~& >> "Error: No story file found. Please use |story-init to create one."
|
||||
helm-pass+[%d %noop ~]
|
||||
helm-pass+[%d %flog %text "Error: No story file found. Please use |story-init to create one."]
|
||||
=/ tale=story .^(story %cx /(scot %p our)/[desk]/(scot %da now)/story)
|
||||
=/ =prose [title ?~(body '' p.body)]
|
||||
=. tale (~(put ju tale) tak prose)
|
||||
|
@ -2,6 +2,6 @@
|
||||
:- %say
|
||||
|= [[now=@da eny=@uvJ bec=beak] [syd=desk ~] verb=_&]
|
||||
:* %tang
|
||||
leaf+"Notice: +vat is deprecated as +vats now takes lists of one or more desks"
|
||||
leaf+"Notice: +vat is deprecated. use +vats which now takes one or more desks as arguments. e.g. '+vats %base %garden'"
|
||||
(report-vat (report-prep p.bec now) p.bec now syd verb)
|
||||
==
|
||||
|
@ -1755,6 +1755,20 @@
|
||||
++ on-stir
|
||||
|= arg=@t
|
||||
^+ event-core
|
||||
|^ ?+ arg do-stir
|
||||
%rift do-rift
|
||||
==
|
||||
::
|
||||
++ do-rift
|
||||
=/ =rift
|
||||
=- ~|(%no-rift (,@ q.q:(need (need -))))
|
||||
(rof ~ %j `beam`[[our %rift %da now] /(scot %p our)])
|
||||
?: =(rift rift.ames-state)
|
||||
event-core
|
||||
~& "ames: fixing rift from {<rift.ames-state>} to {<rift>}"
|
||||
event-core(ames-state ames-state(rift rift))
|
||||
::
|
||||
++ do-stir
|
||||
=/ want=(set [@da ^duct])
|
||||
%- ~(rep by peers.ames-state)
|
||||
|= [[who=ship s=ship-state] acc=(set [@da ^duct])]
|
||||
@ -1790,6 +1804,7 @@
|
||||
|= [[wen=@da hen=^duct] this=_event-core]
|
||||
?> ?=([^ *] hen)
|
||||
(emit:this t.hen %pass t.i.hen %b %rest wen)
|
||||
--
|
||||
:: +on-crud: handle event failure; print to dill
|
||||
::
|
||||
++ on-crud
|
||||
@ -2886,6 +2901,10 @@
|
||||
:: 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
|
||||
@ -4449,7 +4468,7 @@
|
||||
:: if this was a re-send, don't adjust rtt or downstream state
|
||||
::
|
||||
?: (gth tries.packet-state 1)
|
||||
metrics
|
||||
metrics(rto (clamp-rto (add rtt (mul 4 rttvar))))
|
||||
:: rtt-datum: new rtt measurement based on packet roundtrip
|
||||
::
|
||||
=/ rtt-datum=@dr (sub-safe now last-sent.packet-state)
|
||||
|
@ -714,7 +714,14 @@
|
||||
=. stack.nub [~ stack.nub]
|
||||
?: (~(has in cycle.nub) cast+[a b])
|
||||
~|(cycle+cast+[a b]^cycle.nub !!)
|
||||
?: =(a b)
|
||||
%+ gain-leak cast+a^b
|
||||
|= nob=state
|
||||
%- (trace 4 |.("identity shortcircuit"))
|
||||
=. nub nob
|
||||
:_(nub vase+same.bud)
|
||||
?: =([%mime %hoon] [a b])
|
||||
%- (trace 4 |.("%mime -> %hoon shortcircuit"))
|
||||
:_(nub [%vase =>(..zuse !>(|=(m=mime q.q.m)))])
|
||||
:: try +grow; is there a +grow core with a .b arm?
|
||||
::
|
||||
@ -729,6 +736,7 @@
|
||||
::
|
||||
%+ gain-leak cast+a^b
|
||||
|= nob=state
|
||||
%- (trace 4 |.("{<a>} -> {<b>}: +{(trip b)}:grow:{(trip a)}"))
|
||||
=. nub nob
|
||||
:_ nub :- %vase
|
||||
%+ slap (with-faces cor+old ~)
|
||||
@ -743,18 +751,24 @@
|
||||
?: &(?=(%& -.rab) ?=(^ q.p.rab))
|
||||
%+ gain-leak cast+a^b
|
||||
|= nob=state
|
||||
%- (trace 4 |.("{<a>} -> {<b>}: +{(trip a)}:grab:{(trip b)}"))
|
||||
=. nub nob
|
||||
:_(nub vase+p.rab)
|
||||
:: try +jump
|
||||
::
|
||||
=/ jum (mule |.((slap old tsgl/[limb/b limb/%jump])))
|
||||
?: ?=(%& -.jum)
|
||||
(compose-casts a !<(mark p.jum) b)
|
||||
=/ via !<(mark p.jum)
|
||||
%- (trace 4 |.("{<a>} -> {<b>}: via {<via>} per +jump:{(trip a)}"))
|
||||
(compose-casts a via b)
|
||||
?: ?=(%& -.rab)
|
||||
(compose-casts a !<(mark p.rab) b)
|
||||
=/ via !<(mark p.rab)
|
||||
%- (trace 4 |.("{<a>} -> {<b>}: via {<via>} per +grab:{(trip b)}"))
|
||||
(compose-casts a via b)
|
||||
?: ?=(%noun b)
|
||||
%+ gain-leak cast+a^b
|
||||
|= nob=state
|
||||
%- (trace 4 |.("{<a>} -> {<b>} default"))
|
||||
=. nub nob
|
||||
:_(nub vase+same.bud)
|
||||
~|(no-cast-from+[a b] !!)
|
||||
@ -4496,7 +4510,9 @@
|
||||
::
|
||||
?. ?| =(0v0 tak)
|
||||
?& (~(has by hut.ran) tak)
|
||||
?| (~(any by hit.dom) |=(=tako =(tak tako))) :: fast-path
|
||||
(~(has in (reachable-takos (aeon-to-tako:ze let.dom))) tak)
|
||||
==
|
||||
|(?=(~ for) (may-read u.for care.mun tak path.mun))
|
||||
== ==
|
||||
[~ ..park]
|
||||
|
@ -2358,12 +2358,24 @@
|
||||
::
|
||||
=/ task=task ((harden task) wrapped-task)
|
||||
::
|
||||
:: XX handle error notifications
|
||||
:: XX handle more error notifications
|
||||
::
|
||||
?^ dud
|
||||
=/ moves=(list move)
|
||||
[[duct %slip %d %flog %crud [-.task tang.u.dud]] ~]
|
||||
[moves http-server-gate]
|
||||
:_ http-server-gate
|
||||
:: always print the error trace
|
||||
::
|
||||
:- [duct %slip %d %flog %crud [-.task tang.u.dud]]
|
||||
^- (list move)
|
||||
:: if a request caused the crash, respond with a 500
|
||||
::
|
||||
?. ?=(?(%request %request-local) -.task) ~
|
||||
^~
|
||||
=/ data (as-octs:mimes:html 'crud!')
|
||||
=/ head
|
||||
:~ ['content-type' 'text/html']
|
||||
['content-length' (crip (a-co:co p.data))]
|
||||
==
|
||||
[duct %give %response %start 500^head `data &]~
|
||||
:: %init: tells us what our ship name is
|
||||
::
|
||||
?: ?=(%init -.task)
|
||||
|
@ -769,6 +769,10 @@
|
||||
(mo-apply-sure dap routes deal)
|
||||
::
|
||||
%raw-poke
|
||||
:: don't validate %noun pokes, for performance
|
||||
::
|
||||
?: =(%noun mark.deal)
|
||||
(mo-apply-sure dap routes [%poke %noun %noun noun.deal])
|
||||
=/ =case da+now
|
||||
=/ yok (~(got by yokes.state) dap)
|
||||
=/ =desk q.beak:?>(?=(%live -.yok) yok) ::TODO acceptable assertion?
|
||||
|
Loading…
Reference in New Issue
Block a user