mirror of
https://github.com/urbit/shrub.git
synced 2025-01-07 05:26:56 +03:00
Merge branch 'next/kelvin/411' into yu/stun-response
This commit is contained in:
commit
5be498b822
@ -773,7 +773,7 @@
|
|||||||
'next'^(numb next)
|
'next'^(numb next)
|
||||||
::
|
::
|
||||||
:- 'unsent-messages' :: as byte sizes
|
:- 'unsent-messages' :: as byte sizes
|
||||||
(set-array unsent-messages (cork (cury met 3) numb))
|
(set-array unsent-messages (cork jam (cork (cury met 3) numb)))
|
||||||
::
|
::
|
||||||
'unsent-fragments'^(numb (lent unsent-fragments)) :: as lent
|
'unsent-fragments'^(numb (lent unsent-fragments)) :: as lent
|
||||||
::
|
::
|
||||||
|
@ -352,7 +352,9 @@
|
|||||||
?~ dat=(rof lyc pov u.mon) ~
|
?~ dat=(rof lyc pov u.mon) ~
|
||||||
?~ u.dat [~ ~]
|
?~ u.dat [~ ~]
|
||||||
=* vax q.u.u.dat
|
=* vax q.u.u.dat
|
||||||
?. ?& ?=(^ ref)
|
?. => [ref=ref vax=p=p.vax hoon-version=hoon-version wa=wa worm=worm]
|
||||||
|
~> %memo./arvo/look :: with memoization
|
||||||
|
?& ?=(^ ref)
|
||||||
=(hoon-version -.ref)
|
=(hoon-version -.ref)
|
||||||
-:(~(nets wa *worm) +.ref p.vax)
|
-:(~(nets wa *worm) +.ref p.vax)
|
||||||
==
|
==
|
||||||
|
@ -910,6 +910,12 @@
|
|||||||
:: payload: semantic message contents
|
:: payload: semantic message contents
|
||||||
::
|
::
|
||||||
+$ plea [vane=@tas =path payload=*]
|
+$ plea [vane=@tas =path payload=*]
|
||||||
|
::
|
||||||
|
+$ message
|
||||||
|
$% [%plea plea]
|
||||||
|
[%boon payload=*]
|
||||||
|
[%naxplanation =message-num =error]
|
||||||
|
==
|
||||||
:: $spar: pair of $ship and $path
|
:: $spar: pair of $ship and $path
|
||||||
::
|
::
|
||||||
:: Instead of fully qualifying a scry path, ames infers rift and
|
:: Instead of fully qualifying a scry path, ames infers rift and
|
||||||
@ -919,7 +925,7 @@
|
|||||||
:: $deep: deferred %ames call, from self, to keep +abet cores pure
|
:: $deep: deferred %ames call, from self, to keep +abet cores pure
|
||||||
::
|
::
|
||||||
+$ deep
|
+$ deep
|
||||||
$% [%nack =ship =nack=bone =message-blob]
|
$% [%nack =ship =nack=bone =message]
|
||||||
[%sink =ship =target=bone naxplanation=[=message-num =error]]
|
[%sink =ship =target=bone naxplanation=[=message-num =error]]
|
||||||
[%drop =ship =nack=bone =message-num]
|
[%drop =ship =nack=bone =message-num]
|
||||||
[%cork =ship =bone]
|
[%cork =ship =bone]
|
||||||
@ -1170,7 +1176,7 @@
|
|||||||
$+ message-pump-state
|
$+ message-pump-state
|
||||||
$: current=_`message-num`1
|
$: current=_`message-num`1
|
||||||
next=_`message-num`1
|
next=_`message-num`1
|
||||||
unsent-messages=(qeu message-blob)
|
unsent-messages=(qeu message)
|
||||||
unsent-fragments=(list static-fragment)
|
unsent-fragments=(list static-fragment)
|
||||||
queued-message-acks=(map message-num ack)
|
queued-message-acks=(map message-num ack)
|
||||||
=packet-pump-state
|
=packet-pump-state
|
||||||
|
@ -191,7 +191,7 @@
|
|||||||
(cue (rep packet-size (flop sorted)))
|
(cue (rep packet-size (flop sorted)))
|
||||||
:: +jim: caching +jam
|
:: +jim: caching +jam
|
||||||
::
|
::
|
||||||
++ jim |=(n=* ~+((jam n)))
|
++ jim |=(n=* ~>(%memo./ames/jam (jam n)))
|
||||||
++ spit
|
++ spit
|
||||||
|= =path
|
|= =path
|
||||||
^- [pat=@t wid=@ud]
|
^- [pat=@t wid=@ud]
|
||||||
@ -1115,6 +1115,55 @@
|
|||||||
--
|
--
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
|
|
||||||
|
+$ ames-state-17
|
||||||
|
$+ ames-state-17
|
||||||
|
$: peers=(map ship ship-state-17)
|
||||||
|
=unix=duct
|
||||||
|
=life
|
||||||
|
=rift
|
||||||
|
crypto-core=acru:ames
|
||||||
|
=bug
|
||||||
|
snub=[form=?(%allow %deny) ships=(set ship)]
|
||||||
|
cong=[msg=_5 mem=_100.000]
|
||||||
|
::
|
||||||
|
$= dead
|
||||||
|
$: flow=[%flow (unit dead-timer)]
|
||||||
|
cork=[%cork (unit dead-timer)]
|
||||||
|
== ==
|
||||||
|
+$ ship-state-17
|
||||||
|
$+ ship-state-17
|
||||||
|
$% [%alien alien-agenda]
|
||||||
|
[%known peer-state-17]
|
||||||
|
==
|
||||||
|
+$ peer-state-17
|
||||||
|
$+ peer-state-17
|
||||||
|
$: $: =symmetric-key
|
||||||
|
=life
|
||||||
|
=rift
|
||||||
|
=public-key
|
||||||
|
sponsor=ship
|
||||||
|
==
|
||||||
|
route=(unit [direct=? =lane])
|
||||||
|
=qos
|
||||||
|
=ossuary
|
||||||
|
snd=(map bone message-pump-state-17)
|
||||||
|
rcv=(map bone message-sink-state)
|
||||||
|
nax=(set [=bone =message-num])
|
||||||
|
heeds=(set duct)
|
||||||
|
closing=(set bone)
|
||||||
|
corked=(set bone)
|
||||||
|
keens=(map path keen-state)
|
||||||
|
==
|
||||||
|
+$ message-pump-state-17
|
||||||
|
$+ message-pump-state-17
|
||||||
|
$: current=_`message-num`1
|
||||||
|
next=_`message-num`1
|
||||||
|
unsent-messages=(qeu message-blob)
|
||||||
|
unsent-fragments=(list static-fragment)
|
||||||
|
queued-message-acks=(map message-num ack)
|
||||||
|
=packet-pump-state
|
||||||
|
==
|
||||||
+$ ames-state-14 ames-state-16
|
+$ ames-state-14 ames-state-16
|
||||||
+$ ames-state-15 ames-state-16
|
+$ ames-state-15 ames-state-16
|
||||||
+$ ames-state-16
|
+$ ames-state-16
|
||||||
@ -1200,7 +1249,26 @@
|
|||||||
$+ task-11-and-16
|
$+ task-11-and-16
|
||||||
$% [%kroc dry=?]
|
$% [%kroc dry=?]
|
||||||
[%snub ships=(list ship)]
|
[%snub ships=(list ship)]
|
||||||
$<(?(%snub %kroc) task)
|
$<(?(%snub %kroc) task-17)
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ task-17
|
||||||
|
$+ task-17
|
||||||
|
$% $<(%deep task)
|
||||||
|
$: %deep
|
||||||
|
$% [%nack =ship =nack=bone =message-blob]
|
||||||
|
[%sink =ship =target=bone naxplanation=[=message-num =error]]
|
||||||
|
[%drop =ship =nack=bone =message-num]
|
||||||
|
[%cork =ship =bone]
|
||||||
|
[%kill =ship =bone]
|
||||||
|
==
|
||||||
|
==
|
||||||
|
==
|
||||||
|
::
|
||||||
|
+$ queued-event-17
|
||||||
|
$+ queued-event-17
|
||||||
|
$% [%call =duct wrapped-task=(hobo task-17)]
|
||||||
|
[%take =wire =duct =sign]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ queued-event-16
|
+$ queued-event-16
|
||||||
@ -1212,7 +1280,7 @@
|
|||||||
+$ task-16
|
+$ task-16
|
||||||
$+ task-16
|
$+ task-16
|
||||||
$% [%kroc dry=?]
|
$% [%kroc dry=?]
|
||||||
$<(%kroc task)
|
$<(%kroc task-17)
|
||||||
==
|
==
|
||||||
:: $bug: debug printing configuration
|
:: $bug: debug printing configuration
|
||||||
::
|
::
|
||||||
@ -1305,7 +1373,7 @@
|
|||||||
:: %wake: handle timer firing
|
:: %wake: handle timer firing
|
||||||
::
|
::
|
||||||
+$ message-pump-task
|
+$ message-pump-task
|
||||||
$% [%memo =message-blob]
|
$% [%memo =message]
|
||||||
[%hear =message-num =ack-meat]
|
[%hear =message-num =ack-meat]
|
||||||
[%near =naxplanation]
|
[%near =naxplanation]
|
||||||
[%prod ~]
|
[%prod ~]
|
||||||
@ -1361,7 +1429,8 @@
|
|||||||
[%14 ames-state-14]
|
[%14 ames-state-14]
|
||||||
[%15 ames-state-15]
|
[%15 ames-state-15]
|
||||||
[%16 ames-state-16]
|
[%16 ames-state-16]
|
||||||
[%17 ^ames-state]
|
[%17 ames-state-17]
|
||||||
|
[%18 ^ames-state]
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|= [now=@da eny=@ rof=roof]
|
|= [now=@da eny=@ rof=roof]
|
||||||
@ -1484,7 +1553,7 @@
|
|||||||
:: lifecycle arms; mostly pass-throughs to the contained adult ames
|
:: lifecycle arms; mostly pass-throughs to the contained adult ames
|
||||||
::
|
::
|
||||||
++ scry scry:adult-core
|
++ scry scry:adult-core
|
||||||
++ stay [%17 %larva queued-events ames-state.adult-gate]
|
++ stay [%18 %larva queued-events ames-state.adult-gate]
|
||||||
++ load
|
++ load
|
||||||
|= $= old
|
|= $= old
|
||||||
$% $: %4
|
$% $: %4
|
||||||
@ -1579,6 +1648,13 @@
|
|||||||
[%adult state=ames-state-16]
|
[%adult state=ames-state-16]
|
||||||
== ==
|
== ==
|
||||||
$: %17
|
$: %17
|
||||||
|
$% $: %larva
|
||||||
|
events=(qeu queued-event-17)
|
||||||
|
state=ames-state-17
|
||||||
|
==
|
||||||
|
[%adult state=ames-state-17]
|
||||||
|
== ==
|
||||||
|
$: %18
|
||||||
$% $: %larva
|
$% $: %larva
|
||||||
events=(qeu queued-event)
|
events=(qeu queued-event)
|
||||||
state=_ames-state.adult-gate
|
state=_ames-state.adult-gate
|
||||||
@ -1656,7 +1732,7 @@
|
|||||||
[%10 %larva *]
|
[%10 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. cached-state `[%10 state.old]
|
=. cached-state `[%10 state.old]
|
||||||
=. queued-events (event-11-to-17 events.old)
|
=. queued-events (event-17-to-18 (event-11-to-17 events.old))
|
||||||
larval-gate
|
larval-gate
|
||||||
::
|
::
|
||||||
[%11 %adult *]
|
[%11 %adult *]
|
||||||
@ -1667,7 +1743,7 @@
|
|||||||
[%11 %larva *]
|
[%11 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. cached-state `[%11 state.old]
|
=. cached-state `[%11 state.old]
|
||||||
=. queued-events (event-11-to-17 events.old)
|
=. queued-events (event-17-to-18 (event-11-to-17 events.old))
|
||||||
larval-gate
|
larval-gate
|
||||||
::
|
::
|
||||||
[%12 %adult *]
|
[%12 %adult *]
|
||||||
@ -1678,7 +1754,7 @@
|
|||||||
[%12 %larva *]
|
[%12 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. cached-state `[%12 state.old]
|
=. cached-state `[%12 state.old]
|
||||||
=. queued-events (event-16-to-17 events.old)
|
=. queued-events (event-17-to-18 (event-16-to-17 events.old))
|
||||||
larval-gate
|
larval-gate
|
||||||
::
|
::
|
||||||
[%13 %adult *]
|
[%13 %adult *]
|
||||||
@ -1689,7 +1765,7 @@
|
|||||||
[%13 %larva *]
|
[%13 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. cached-state `[%13 state.old]
|
=. cached-state `[%13 state.old]
|
||||||
=. queued-events (event-16-to-17 events.old)
|
=. queued-events (event-17-to-18 (event-16-to-17 events.old))
|
||||||
larval-gate
|
larval-gate
|
||||||
::
|
::
|
||||||
[%14 %adult *]
|
[%14 %adult *]
|
||||||
@ -1700,7 +1776,7 @@
|
|||||||
[%14 %larva *]
|
[%14 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. cached-state `[%14 state.old]
|
=. cached-state `[%14 state.old]
|
||||||
=. queued-events (event-16-to-17 events.old)
|
=. queued-events (event-17-to-18 (event-16-to-17 events.old))
|
||||||
larval-gate
|
larval-gate
|
||||||
::
|
::
|
||||||
[%15 %adult *]
|
[%15 %adult *]
|
||||||
@ -1711,7 +1787,7 @@
|
|||||||
[%15 %larva *]
|
[%15 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. cached-state `[%15 state.old]
|
=. cached-state `[%15 state.old]
|
||||||
=. queued-events (event-16-to-17 events.old)
|
=. queued-events (event-17-to-18 (event-16-to-17 events.old))
|
||||||
larval-gate
|
larval-gate
|
||||||
::
|
::
|
||||||
[%16 %adult *]
|
[%16 %adult *]
|
||||||
@ -1722,15 +1798,27 @@
|
|||||||
[%16 %larva *]
|
[%16 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. cached-state `[%16 state.old]
|
=. cached-state `[%16 state.old]
|
||||||
=. queued-events (event-16-to-17 events.old)
|
=. queued-events (event-17-to-18 (event-16-to-17 events.old))
|
||||||
larval-gate
|
larval-gate
|
||||||
::
|
::
|
||||||
[%17 %adult *] (load:adult-core %17 state.old)
|
[%17 %adult *]
|
||||||
|
=. cached-state `[%17 state.old]
|
||||||
|
~> %slog.0^leaf/"ames: larva reload"
|
||||||
|
larval-gate
|
||||||
::
|
::
|
||||||
[%17 %larva *]
|
[%17 %larva *]
|
||||||
~> %slog.1^leaf/"ames: larva: load"
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
|
=. cached-state `[%17 state.old]
|
||||||
|
=. queued-events (event-17-to-18 events.old)
|
||||||
|
larval-gate
|
||||||
|
|
||||||
|
::
|
||||||
|
[%18 %adult *] (load:adult-core %18 state.old)
|
||||||
|
::
|
||||||
|
[%18 %larva *]
|
||||||
|
~> %slog.1^leaf/"ames: larva: load"
|
||||||
=. queued-events events.old
|
=. queued-events events.old
|
||||||
=. adult-gate (load:adult-core %17 state.old)
|
=. adult-gate (load:adult-core %18 state.old)
|
||||||
larval-gate
|
larval-gate
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
@ -1750,10 +1838,10 @@
|
|||||||
::
|
::
|
||||||
++ event-11-to-17
|
++ event-11-to-17
|
||||||
|= events=(qeu queued-event-11-and-16)
|
|= events=(qeu queued-event-11-and-16)
|
||||||
^- (qeu queued-event)
|
^- (qeu queued-event-17)
|
||||||
%- ~(rep in events)
|
%- ~(rep in events)
|
||||||
|= [e=queued-event-11-and-16 q=(qeu queued-event)]
|
|= [e=queued-event-11-and-16 q=(qeu queued-event-17)]
|
||||||
%- ~(put to q) ^- queued-event
|
%- ~(put to q) ^- queued-event-17
|
||||||
?. ?=(%call -.e) e
|
?. ?=(%call -.e) e
|
||||||
=/ task=task-11-and-16 ((harden task-11-and-16) wrapped-task.e)
|
=/ task=task-11-and-16 ((harden task-11-and-16) wrapped-task.e)
|
||||||
%= e
|
%= e
|
||||||
@ -1766,15 +1854,33 @@
|
|||||||
::
|
::
|
||||||
++ event-16-to-17
|
++ event-16-to-17
|
||||||
|= events=(qeu queued-event-16)
|
|= events=(qeu queued-event-16)
|
||||||
^- (qeu queued-event)
|
^- (qeu queued-event-17)
|
||||||
%- ~(rep in events)
|
%- ~(rep in events)
|
||||||
|= [e=queued-event-16 q=(qeu queued-event)]
|
|= [e=queued-event-16 q=(qeu queued-event-17)]
|
||||||
%- ~(put to q) ^- queued-event
|
%- ~(put to q) ^- queued-event-17
|
||||||
?. ?=(%call -.e) e
|
?. ?=(%call -.e) e
|
||||||
=/ task=task-16 ((harden task-16) wrapped-task.e)
|
=/ task=task-16 ((harden task-16) wrapped-task.e)
|
||||||
%= e
|
%= e
|
||||||
wrapped-task ?.(?=(%kroc -.task) task [%kroc ~])
|
wrapped-task ?.(?=(%kroc -.task) task [%kroc ~])
|
||||||
==
|
==
|
||||||
|
++ event-17-to-18
|
||||||
|
|= events=(qeu queued-event-17)
|
||||||
|
^- (qeu queued-event)
|
||||||
|
%- ~(rep in events)
|
||||||
|
|= [e=queued-event-17 q=(qeu queued-event)]
|
||||||
|
%- ~(put to q) ^- queued-event
|
||||||
|
?. ?=(%call -.e) e
|
||||||
|
=/ task=task-17 ((harden task-17) wrapped-task.e)
|
||||||
|
%= e
|
||||||
|
wrapped-task
|
||||||
|
?. ?=([%deep %nack *] task) task
|
||||||
|
=/ msg =>([cue=cue arg=message-blob.task] ~+((cue arg)))
|
||||||
|
=/ hed
|
||||||
|
?: =(1 (end 0 nack-bone.task)) %plea
|
||||||
|
?: =(0 (end 0 (rsh 0 nack-bone.task))) %boon
|
||||||
|
%naxplanation
|
||||||
|
[%deep %nack ship.task nack-bone.task ;;(message [hed msg])]
|
||||||
|
==
|
||||||
--
|
--
|
||||||
:: +molt: re-evolve to adult-ames
|
:: +molt: re-evolve to adult-ames
|
||||||
::
|
::
|
||||||
@ -1821,7 +1927,9 @@
|
|||||||
(rof ~ /ames %bx [[our %$ da+now] /debug/timers])
|
(rof ~ /ames %bx [[our %$ da+now] /debug/timers])
|
||||||
|=([@da =duct] ?=([[%ames %recork *] *] duct))
|
|=([@da =duct] ?=([[%ames %recork *] *] duct))
|
||||||
::
|
::
|
||||||
?> ?=(%17 -.u.cached-state)
|
=? u.cached-state ?=(%17 -.u.cached-state)
|
||||||
|
18+(state-17-to-18:load:adult-core +.u.cached-state)
|
||||||
|
?> ?=(%18 -.u.cached-state)
|
||||||
=. ames-state.adult-gate +.u.cached-state
|
=. ames-state.adult-gate +.u.cached-state
|
||||||
[moz larval-core(cached-state ~)]
|
[moz larval-core(cached-state ~)]
|
||||||
--
|
--
|
||||||
@ -1961,12 +2069,11 @@
|
|||||||
::
|
::
|
||||||
=/ failed=message-num
|
=/ failed=message-num
|
||||||
last-acked:(~(got by rcv.peer-state.peer-core) bone)
|
last-acked:(~(got by rcv.peer-state.peer-core) bone)
|
||||||
=/ =naxplanation [failed error]
|
=/ =message [%naxplanation failed error]
|
||||||
=/ =message-blob (jam naxplanation)
|
|
||||||
:: send nack-trace message on associated .nack-bone
|
:: send nack-trace message on associated .nack-bone
|
||||||
::
|
::
|
||||||
=/ nack-bone=^bone (mix 0b10 bone)
|
=/ nack-bone=^bone (mix 0b10 bone)
|
||||||
abet:(call:(abed:mu:peer-core nack-bone) %memo message-blob)
|
abet:(call:(abed:mu:peer-core nack-bone) %memo message)
|
||||||
--
|
--
|
||||||
:: +on-sift: handle request to filter debug output by ship
|
:: +on-sift: handle request to filter debug output by ship
|
||||||
::
|
::
|
||||||
@ -2406,7 +2513,7 @@
|
|||||||
%- %^ ev-trace odd.veb her
|
%- %^ ev-trace odd.veb her
|
||||||
|.("parsing old wire: {(spud wire)}")
|
|.("parsing old wire: {(spud wire)}")
|
||||||
peer-core
|
peer-core
|
||||||
abet:(on-memo:peer-core bone payload %boon)
|
abet:(on-memo:peer-core bone [%boon payload])
|
||||||
:: +on-plea: handle request to send message
|
:: +on-plea: handle request to send message
|
||||||
::
|
::
|
||||||
++ on-plea
|
++ on-plea
|
||||||
@ -2428,7 +2535,7 @@
|
|||||||
=/ sndr [our our-life.channel.peer-core]
|
=/ sndr [our our-life.channel.peer-core]
|
||||||
=/ rcvr [ship her-life.channel.peer-core]
|
=/ rcvr [ship her-life.channel.peer-core]
|
||||||
"plea {<sndr rcvr bone=bone vane.plea path.plea>}"
|
"plea {<sndr rcvr bone=bone vane.plea path.plea>}"
|
||||||
abet:(on-memo:peer-core bone plea %plea)
|
abet:(on-memo:peer-core bone [%plea plea])
|
||||||
:: +on-tame: handle request to delete a route
|
:: +on-tame: handle request to delete a route
|
||||||
::
|
::
|
||||||
++ on-tame
|
++ on-tame
|
||||||
@ -2471,7 +2578,7 @@
|
|||||||
=/ sndr [our our-life.channel.peer-core]
|
=/ sndr [our our-life.channel.peer-core]
|
||||||
=/ rcvr [ship her-life.channel.peer-core]
|
=/ rcvr [ship her-life.channel.peer-core]
|
||||||
"cork plea {<sndr rcvr bone=bone vane.plea path.plea>}"
|
"cork plea {<sndr rcvr bone=bone vane.plea path.plea>}"
|
||||||
abet:(on-memo:(on-cork-flow:peer-core bone) bone plea %plea)
|
abet:(on-memo:(on-cork-flow:peer-core bone) bone [%plea plea])
|
||||||
:: +on-kroc: cork all stale flows from failed subscriptions
|
:: +on-kroc: cork all stale flows from failed subscriptions
|
||||||
::
|
::
|
||||||
++ on-kroc
|
++ on-kroc
|
||||||
@ -2493,7 +2600,7 @@
|
|||||||
?> ?=([~ %known *] ship-state)
|
?> ?=([~ %known *] ship-state)
|
||||||
=+ peer-core=(abed-peer:pe ship.deep +.u.ship-state)
|
=+ peer-core=(abed-peer:pe ship.deep +.u.ship-state)
|
||||||
|^ ?- -.deep
|
|^ ?- -.deep
|
||||||
%nack abet:(send-nack-trace [nack-bone message-blob]:deep)
|
%nack abet:(send-nack-trace [nack-bone message]:deep)
|
||||||
%sink abet:(sink-naxplanation [target-bone naxplanation]:deep)
|
%sink abet:(sink-naxplanation [target-bone naxplanation]:deep)
|
||||||
%drop abet:(clear-nack [nack-bone message-num]:deep)
|
%drop abet:(clear-nack [nack-bone message-num]:deep)
|
||||||
%cork =~((cork-bone bone.deep) (emit duct %give %done ~))
|
%cork =~((cork-bone bone.deep) (emit duct %give %done ~))
|
||||||
@ -2501,8 +2608,8 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ send-nack-trace
|
++ send-nack-trace
|
||||||
|= [=nack=bone =message-blob]
|
|= [=nack=bone =message]
|
||||||
abet:(call:(abed:mu:peer-core nack-bone) %memo message-blob)
|
abet:(call:(abed:mu:peer-core nack-bone) %memo message)
|
||||||
::
|
::
|
||||||
++ sink-naxplanation
|
++ sink-naxplanation
|
||||||
|= [=target=bone =naxplanation]
|
|= [=target=bone =naxplanation]
|
||||||
@ -3311,10 +3418,10 @@
|
|||||||
:: +on-memo: handle request to send message
|
:: +on-memo: handle request to send message
|
||||||
::
|
::
|
||||||
++ on-memo
|
++ on-memo
|
||||||
|= [=bone payload=* valence=?(%plea %boon)]
|
|= [=bone =message]
|
||||||
^+ peer-core
|
^+ peer-core
|
||||||
?: ?& (~(has in closing.peer-state) bone)
|
?: ?& (~(has in closing.peer-state) bone)
|
||||||
!=(payload [%$ /flow %cork ~])
|
!=(message [%plea %$ /flow %cork ~])
|
||||||
==
|
==
|
||||||
~> %slog.0^leaf/"ames: ignoring message on closing bone {<bone>}"
|
~> %slog.0^leaf/"ames: ignoring message on closing bone {<bone>}"
|
||||||
peer-core
|
peer-core
|
||||||
@ -3322,10 +3429,9 @@
|
|||||||
~> %slog.0^leaf/"ames: ignoring message on corked bone {<bone>}"
|
~> %slog.0^leaf/"ames: ignoring message on corked bone {<bone>}"
|
||||||
peer-core
|
peer-core
|
||||||
::
|
::
|
||||||
=/ =message-blob (dedup-message (jim payload))
|
=. peer-core abet:(call:(abed:mu bone) %memo message)
|
||||||
=. peer-core abet:(call:(abed:mu bone) %memo message-blob)
|
|
||||||
::
|
::
|
||||||
?: ?& =(%boon valence)
|
?: ?& ?=(%boon -.message)
|
||||||
(gte now (add ~s30 last-contact.qos.peer-state))
|
(gte now (add ~s30 last-contact.qos.peer-state))
|
||||||
==
|
==
|
||||||
check-clog
|
check-clog
|
||||||
@ -3457,38 +3563,6 @@
|
|||||||
recork-one
|
recork-one
|
||||||
::
|
::
|
||||||
+| %implementation
|
+| %implementation
|
||||||
:: +dedup-message: replace with any existing copy of this message
|
|
||||||
::
|
|
||||||
++ dedup-message
|
|
||||||
|= =message-blob
|
|
||||||
^+ message-blob
|
|
||||||
?: (lte (met 13 message-blob) 1)
|
|
||||||
message-blob
|
|
||||||
=/ peers-l=(list [=ship =ship-state]) ~(tap by peers.ames-state)
|
|
||||||
|- ^+ message-blob
|
|
||||||
=* peer-loop $
|
|
||||||
?~ peers-l
|
|
||||||
message-blob
|
|
||||||
?. ?=(%known -.ship-state.i.peers-l)
|
|
||||||
peer-loop(peers-l t.peers-l)
|
|
||||||
=/ snd-l=(list [=bone =message-pump-state])
|
|
||||||
~(tap by snd.ship-state.i.peers-l)
|
|
||||||
|- ^+ message-blob
|
|
||||||
=* bone-loop $
|
|
||||||
?~ snd-l peer-loop(peers-l t.peers-l)
|
|
||||||
=* unsent-fragments unsent-fragments.message-pump-state.i.snd-l
|
|
||||||
=/ blob-l=(list ^message-blob)
|
|
||||||
~(tap to unsent-messages.message-pump-state.i.snd-l)
|
|
||||||
|- ^+ message-blob
|
|
||||||
=* blob-loop $
|
|
||||||
?^ blob-l
|
|
||||||
?: =(i.blob-l message-blob)
|
|
||||||
i.blob-l
|
|
||||||
blob-loop(blob-l t.blob-l)
|
|
||||||
?~ unsent-fragments bone-loop(snd-l t.snd-l)
|
|
||||||
?: =(message-blob fragment.i.unsent-fragments)
|
|
||||||
`@`fragment.i.unsent-fragments
|
|
||||||
bone-loop(snd-l t.snd-l)
|
|
||||||
:: +check-clog: notify clients if peer has stopped responding
|
:: +check-clog: notify clients if peer has stopped responding
|
||||||
::
|
::
|
||||||
++ check-clog
|
++ check-clog
|
||||||
@ -3531,7 +3605,7 @@
|
|||||||
=. mem
|
=. mem
|
||||||
%+ add
|
%+ add
|
||||||
%- ~(rep in unsent-messages.i.pumps)
|
%- ~(rep in unsent-messages.i.pumps)
|
||||||
|=([a=@ b=_mem] (add b (met 3 a)))
|
|=([m=message b=_mem] (add b (met 3 (jim m))))
|
||||||
?~ unsent-fragments.i.pumps 0
|
?~ unsent-fragments.i.pumps 0
|
||||||
(met 3 fragment.i.unsent-fragments.i.pumps)
|
(met 3 fragment.i.unsent-fragments.i.pumps)
|
||||||
?: (gte mem mem.cong.ames-state)
|
?: (gte mem mem.cong.ames-state)
|
||||||
@ -3584,8 +3658,9 @@
|
|||||||
::
|
::
|
||||||
:: TODO use +trace
|
:: TODO use +trace
|
||||||
~> %slog.0^leaf/"ames: recork {<her i.boz>}"
|
~> %slog.0^leaf/"ames: recork {<her i.boz>}"
|
||||||
=/ =plea [%$ /flow [%cork ~]]
|
=/ =plea [%$ /flow [%cork ~]]
|
||||||
(on-memo i.boz plea %plea)
|
=/ =message [%plea plea]
|
||||||
|
(on-memo i.boz message)
|
||||||
:: +handle-cork: handle flow kill after server ames has taken %done
|
:: +handle-cork: handle flow kill after server ames has taken %done
|
||||||
::
|
::
|
||||||
++ handle-cork
|
++ handle-cork
|
||||||
@ -3683,7 +3758,7 @@
|
|||||||
^+ pump
|
^+ pump
|
||||||
::
|
::
|
||||||
?- -.task
|
?- -.task
|
||||||
%memo (on-memo message-blob.task)
|
%memo (on-memo message.task)
|
||||||
%prod abet:(call:packet-pump %prod ~)
|
%prod abet:(call:packet-pump %prod ~)
|
||||||
%wake abet:(call:packet-pump %wake current.state)
|
%wake abet:(call:packet-pump %wake current.state)
|
||||||
%near %- on-done
|
%near %- on-done
|
||||||
@ -3718,8 +3793,8 @@
|
|||||||
:: +on-memo: handle request to send a message
|
:: +on-memo: handle request to send a message
|
||||||
::
|
::
|
||||||
++ on-memo
|
++ on-memo
|
||||||
|= blob=message-blob
|
|= =message
|
||||||
pump(unsent-messages.state (~(put to unsent-messages.state) blob))
|
pump(unsent-messages.state (~(put to unsent-messages.state) message))
|
||||||
:: +on-hear: handle packet acknowledgment
|
:: +on-hear: handle packet acknowledgment
|
||||||
::
|
::
|
||||||
++ on-hear
|
++ on-hear
|
||||||
@ -3844,11 +3919,11 @@
|
|||||||
?~(unsent feed-packets pump)
|
?~(unsent feed-packets pump)
|
||||||
:: .unsent-messages is nonempty; pop a message off and feed it
|
:: .unsent-messages is nonempty; pop a message off and feed it
|
||||||
::
|
::
|
||||||
=^ =message-blob unsent-messages.state
|
=^ =message unsent-messages.state
|
||||||
~(get to unsent-messages.state)
|
~(get to unsent-messages.state)
|
||||||
:: break .message into .chunks and set as .unsent-fragments
|
:: break .message into .chunks and set as .unsent-fragments
|
||||||
::
|
::
|
||||||
=. unsent-fragments.state (split-message next.state message-blob)
|
=. unsent-fragments.state (split-message next.state (jim +.message))
|
||||||
:: try to feed packets from the next message
|
:: try to feed packets from the next message
|
||||||
::
|
::
|
||||||
=. next.state +(next.state)
|
=. next.state +(next.state)
|
||||||
@ -4497,13 +4572,13 @@
|
|||||||
|.("sink plea {<dat>}")
|
|.("sink plea {<dat>}")
|
||||||
?. ok
|
?. ok
|
||||||
=/ nack-bone=^bone (mix 0b10 bone)
|
=/ nack-bone=^bone (mix 0b10 bone)
|
||||||
=/ =message-blob (jam [message-num *error])
|
=/ =^message [%naxplanation message-num *error]
|
||||||
=/ =wire (make-bone-wire her her-rift.channel nack-bone)
|
=/ =wire (make-bone-wire her her-rift.channel nack-bone)
|
||||||
:: send nack-trace with blank .error for security
|
:: send nack-trace with blank .error for security
|
||||||
::
|
::
|
||||||
=. peer-core
|
=. peer-core
|
||||||
%+ pe-emit duct
|
%+ pe-emit duct
|
||||||
[%pass wire %a %deep %nack her nack-bone message-blob]
|
[%pass wire %a %deep %nack her nack-bone message]
|
||||||
::
|
::
|
||||||
(done ok=%.n)
|
(done ok=%.n)
|
||||||
::
|
::
|
||||||
@ -5146,15 +5221,15 @@
|
|||||||
[moves ames-gate]
|
[moves ames-gate]
|
||||||
:: +stay: extract state before reload
|
:: +stay: extract state before reload
|
||||||
::
|
::
|
||||||
++ stay [%17 %adult ames-state]
|
++ stay [%18 %adult ames-state]
|
||||||
:: +load: load in old state after reload
|
:: +load: load in old state after reload
|
||||||
::
|
::
|
||||||
++ load
|
++ load
|
||||||
=< |= $= old-state
|
=< |= $= old-state
|
||||||
$% [%17 ^ames-state]
|
$% [%18 ^ames-state]
|
||||||
==
|
==
|
||||||
^+ ames-gate
|
^+ ames-gate
|
||||||
?> ?=(%17 -.old-state)
|
?> ?=(%18 -.old-state)
|
||||||
ames-gate(ames-state +.old-state)
|
ames-gate(ames-state +.old-state)
|
||||||
:: all state transitions are called from larval ames
|
:: all state transitions are called from larval ames
|
||||||
::
|
::
|
||||||
@ -5327,7 +5402,7 @@
|
|||||||
::
|
::
|
||||||
++ state-16-to-17
|
++ state-16-to-17
|
||||||
|= old=ames-state-16
|
|= old=ames-state-16
|
||||||
^- ^ames-state
|
^- ames-state-17
|
||||||
%= old
|
%= old
|
||||||
cong
|
cong
|
||||||
:+ cong.old
|
:+ cong.old
|
||||||
@ -5337,7 +5412,7 @@
|
|||||||
peers
|
peers
|
||||||
%- ~(run by peers.old)
|
%- ~(run by peers.old)
|
||||||
|= ship-state=ship-state-16
|
|= ship-state=ship-state-16
|
||||||
^- ^ship-state
|
^- ship-state-17
|
||||||
?. ?=(%known -.ship-state)
|
?. ?=(%known -.ship-state)
|
||||||
ship-state
|
ship-state
|
||||||
|^
|
|^
|
||||||
@ -5349,7 +5424,7 @@
|
|||||||
::
|
::
|
||||||
++ message-pump-16-to-17
|
++ message-pump-16-to-17
|
||||||
|= pump=message-pump-state-16
|
|= pump=message-pump-state-16
|
||||||
^- message-pump-state
|
^- message-pump-state-17
|
||||||
%= pump
|
%= pump
|
||||||
metrics.packet-pump-state
|
metrics.packet-pump-state
|
||||||
[rto rtt rttvar ssthresh cwnd counter]:metrics.packet-pump-state.pump
|
[rto rtt rttvar ssthresh cwnd counter]:metrics.packet-pump-state.pump
|
||||||
@ -5385,6 +5460,35 @@
|
|||||||
==
|
==
|
||||||
--
|
--
|
||||||
==
|
==
|
||||||
|
++ state-17-to-18
|
||||||
|
|= old=ames-state-17
|
||||||
|
^- ^ames-state
|
||||||
|
%= old
|
||||||
|
peers
|
||||||
|
%- ~(run by peers.old)
|
||||||
|
|= s=ship-state-17
|
||||||
|
?: ?=(%alien -.s) s
|
||||||
|
%= s
|
||||||
|
snd.+
|
||||||
|
%- malt
|
||||||
|
%+ turn
|
||||||
|
~(tap by snd.+.s)
|
||||||
|
|= [=bone m=message-pump-state-17]
|
||||||
|
:- bone
|
||||||
|
%= m
|
||||||
|
unsent-messages
|
||||||
|
%- ~(gas to *(qeu message))
|
||||||
|
%+ turn
|
||||||
|
~(tap to unsent-messages.m)
|
||||||
|
|= b=message-blob
|
||||||
|
^- message
|
||||||
|
=/ hed
|
||||||
|
?: =(1 (end 0 bone)) %plea
|
||||||
|
?: =(0 (end 0 (rsh 0 bone))) %boon
|
||||||
|
%naxplanation
|
||||||
|
=/ msg =>([cue=cue arg=b] ~+((cue arg)))
|
||||||
|
;;(message [hed msg])
|
||||||
|
== == ==
|
||||||
--
|
--
|
||||||
:: +scry: dereference namespace
|
:: +scry: dereference namespace
|
||||||
::
|
::
|
||||||
|
@ -80,10 +80,11 @@
|
|||||||
=/ deks
|
=/ deks
|
||||||
?~ desks
|
?~ desks
|
||||||
%+ sort
|
%+ sort
|
||||||
(sort ~(tap in -.prep) |=([[a=@ *] b=@ *] !(aor a b)))
|
(sort ~(tap by -.prep) |=([[a=@ *] b=@ *] !(aor a b)))
|
||||||
|=([[a=@ *] [b=@ *]] ?|(=(a %kids) =(b %base)))
|
|=([[a=@ *] [b=@ *]] ?|(=(a %kids) =(b %base)))
|
||||||
%+ skip ~(tap in -.prep)
|
%+ skip ~(tap by -.prep)
|
||||||
|=([syd=@tas *] =(~ (find ~[syd] desks)))
|
|=([syd=@tas *] =(~ (find ~[syd] desks)))
|
||||||
|
=. deks (skim deks |=([=desk *] ((sane %tas) desk)))
|
||||||
?: =(filt %blocking)
|
?: =(filt %blocking)
|
||||||
=/ base-wic
|
=/ base-wic
|
||||||
%+ sort ~(tap by wic:(~(got by -.prep) %base))
|
%+ sort ~(tap by wic:(~(got by -.prep) %base))
|
||||||
@ -147,6 +148,8 @@
|
|||||||
^- tank
|
^- tank
|
||||||
=/ ego (scot %p our)
|
=/ ego (scot %p our)
|
||||||
=/ wen (scot %da now)
|
=/ wen (scot %da now)
|
||||||
|
?. ((sane %tas) syd)
|
||||||
|
leaf+"insane desk: {<syd>}"
|
||||||
=+ .^(=cass %cw /[ego]/[syd]/[wen])
|
=+ .^(=cass %cw /[ego]/[syd]/[wen])
|
||||||
?: =(ud.cass 0)
|
?: =(ud.cass 0)
|
||||||
leaf+"desk does not yet exist: {<syd>}"
|
leaf+"desk does not yet exist: {<syd>}"
|
||||||
|
Loading…
Reference in New Issue
Block a user