From 5dfc8e3c5d4a482eb209ed6c199cde3d94ab19a0 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 24 Apr 2023 16:01:00 -0400 Subject: [PATCH] arvo: restructures |mass, switches to %x //whey --- pkg/arvo/sys/arvo.hoon | 4 +-- pkg/arvo/sys/vane/ames.hoon | 18 ++++++------- pkg/arvo/sys/vane/behn.hoon | 14 +++++----- pkg/arvo/sys/vane/clay.hoon | 4 ++- pkg/arvo/sys/vane/dill.hoon | 11 +++----- pkg/arvo/sys/vane/eyre.hoon | 20 +++++++-------- pkg/arvo/sys/vane/gall.hoon | 51 ++++++++++++++++++++----------------- pkg/arvo/sys/vane/iris.hoon | 2 +- pkg/arvo/sys/vane/jael.hoon | 6 +++-- 9 files changed, 68 insertions(+), 62 deletions(-) diff --git a/pkg/arvo/sys/arvo.hoon b/pkg/arvo/sys/arvo.hoon index 5574799c9..3bd797054 100644 --- a/pkg/arvo/sys/arvo.hoon +++ b/pkg/arvo/sys/arvo.hoon @@ -1369,11 +1369,11 @@ :: %+ turn (sort ~(tap by van.mod) |=([[a=@tas *] [b=@tas *]] (aor a b))) - =/ bem=beam [[our %base da+now] /whey] ::TODO %base? + =/ bem=beam [[our %$ da+now] //whey] |= [nam=term =vane] =; mas=(list mass) nam^|+(welp mas [dot+&+q.vase typ+&+p.vase sac+&+worm ~]:vane) - ?~ met=(peek [~ ~] nam bem) ~ + ?~ met=(peek [~ ~] [nam %x] bem) ~ ?~ u.met ~ ~| mass+nam ;;((list mass) q.q.u.u.met) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 56513fabe..1a2701f3b 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -4412,15 +4412,6 @@ =* lot=coin $/r.bem =* tyl s.bem :: - ::TODO don't special-case whey scry - :: - ?: &(=(%$ ren) =(tyl /whey)) - =/ maz=(list mass) - =+ [known alien]=(skid ~(val by peers.ames-state) |=(^ =(%known +<-))) - :~ peers-known+&+known - peers-alien+&+alien - == - ``mass+!>(maz) :: only respond for the local identity, %$ desk, current timestamp :: ?. ?& =(&+our why) @@ -4430,6 +4421,7 @@ ?. for.veb.bug.ames-state ~ ~> %slog.0^leaf/"ames: scry-fail {}" ~ + :: /ax//whey (list mass) :: /ax/protocol/version @ :: /ax/peers (map ship ?(%alien %known)) :: /ax/peers/[ship] ship-state @@ -4444,6 +4436,14 @@ ?. ?=(%x ren) ~ => .(tyl `(pole knot)`tyl) ?+ tyl ~ + [%$ %whey ~] + =/ maz=(list mass) + =+ [known alien]=(skid ~(val by peers.ames-state) |=(^ =(%known +<-))) + :~ peers-known+&+known + peers-alien+&+alien + == + ``mass+!>(maz) + :: [%protocol %version ~] ``noun+!>(protocol-version) :: diff --git a/pkg/arvo/sys/vane/behn.hoon b/pkg/arvo/sys/vane/behn.hoon index d5eb8f5df..12f7d38aa 100644 --- a/pkg/arvo/sys/vane/behn.hoon +++ b/pkg/arvo/sys/vane/behn.hoon @@ -243,13 +243,6 @@ =* lot=coin $/r.bem =* tyl s.bem :: - ::TODO don't special-case whey scry - :: - ?: &(=(ren %$) =(tyl /whey)) - =/ maz=(list mass) - :~ timers+&+timers.state - == - ``mass+!>(maz) :: only respond for the local identity, %$ desk, current timestamp :: ?. ?& =(&+our why) @@ -257,6 +250,7 @@ =(%$ syd) == ~ + :: /bx//whey (list mass) memory usage labels :: /bx/debug/timers (list [@da duct]) all timers and their ducts :: /bx/timers (list @da) all timer timestamps :: /bx/timers/next (unit @da) the very next timer to fire @@ -264,6 +258,12 @@ :: ?. ?=(%x ren) ~ ?+ tyl [~ ~] + [%$ %whey ~] + =/ maz=(list mass) + :~ timers+&+timers.state + == + ``mass+!>(maz) + :: [%debug %timers ~] :^ ~ ~ %noun !> ^- (list [@da duct]) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index d6788b33e..2a8040c4b 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -5861,8 +5861,10 @@ :: ?. ?=(%& -.why) ~ =* his p.why - ?: &(=(ren %$) =(tyl /whey)) + :: + ?: &(?=(%x ren) =(tyl //whey)) ``mass+!>(whey) + :: :: ~& scry+[ren `path`[(scot %p his) syd ~(rent co lot) tyl]] :: =- ~& %scry-done - =+ luk=?.(?=(%$ -.lot) ~ ((soft case) p.lot)) diff --git a/pkg/arvo/sys/vane/dill.hoon b/pkg/arvo/sys/vane/dill.hoon index 20673cb53..f35f76e0f 100644 --- a/pkg/arvo/sys/vane/dill.hoon +++ b/pkg/arvo/sys/vane/dill.hoon @@ -489,14 +489,7 @@ :: ?. ?=(%& -.why) ~ =* his p.why - ::TODO don't special-case whey scry :: - ?: &(=(ren %$) =(tyl /whey)) - =/ maz=(list mass) - :~ hey+&+hey.all - dug+&+dug.all - == - ``mass+!>(maz) :: only respond for the local identity, %$ desk, current timestamp :: ?. ?& =(&+our why) @@ -504,10 +497,14 @@ =(%$ syd) == ~ + :: /%x//whey (list mass) memory usage labels :: /dy/sessions (set @tas) all existing sessions :: /du/sessions/[ses] ? does session ses exist? :: ?+ [ren tyl] ~ + [%x %$ %whey ~] =- ``mass+!>(`(list mass)`-) + [hey+&+hey.all dug+&+dug.all ~] + :: [%y %sessions ~] ``noun+!>(~(key by dug.all)) [%u %sessions @ ~] ``noun+!>((~(has by dug.all) (snag 1 tyl))) == diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 420a9a1a6..74631a5fc 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -2888,15 +2888,7 @@ ?. ?=(%& -.why) ~ =* who p.why - ?: =(tyl /whey) - =/ maz=(list mass) - :~ bindings+&+bindings.server-state.ax - auth+&+authentication-state.server-state.ax - connections+&+connections.server-state.ax - channels+&+channel-state.server-state.ax - axle+&+ax - == - ``mass+!>(maz) + :: ?. ?=(%$ -.lot) [~ ~] ?. =(our who) @@ -2904,9 +2896,17 @@ [~ ~] ~& [%r %scry-foreign-host who] ~ - ?: &(?=(%x ren) ?=(~ syd)) + ?: &(?=(%x ren) ?=(%$ syd)) =, server-state.ax ?+ tyl [~ ~] + [%$ %whey ~] =- ``mass+!>(`(list mass)`-) + :~ bindings+&+bindings.server-state.ax + auth+&+authentication-state.server-state.ax + connections+&+connections.server-state.ax + channels+&+channel-state.server-state.ax + axle+&+ax + == + :: [%cors ~] ``noun+!>(cors-registry) [%cors %requests ~] ``noun+!>(requests.cors-registry) [%cors %approved ~] ``noun+!>(approved.cors-registry) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index a2b1b5ede..d628d2075 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -2067,29 +2067,6 @@ (mo-peek:mo & dap routes care path) :: => .(path t.path) - ?: &(=(care %$) =(path /whey)) - =/ blocked - =/ queued (~(run by blocked.state) |=((qeu blocked-move) [%.y +<])) - (sort ~(tap by queued) aor) - :: - =/ running - %+ turn (sort ~(tap by yokes.state) aor) - |= [dap=term =yoke] - ^- mass - =/ met=(list mass) - =/ dat (mo-peek:mo | dap [~ ship] %x /whey/mass) - ?: ?=(?(~ [~ ~]) dat) ~ - (fall ((soft (list mass)) q.q.u.u.dat) ~) - ?~ met - dap^&+yoke - dap^|+(welp met dot+&+yoke ~) - :: - =/ maz=(list mass) - :~ [%foreign %.y contacts.state] - [%blocked %.n blocked] - [%active %.n running] - == - ``mass+!>(maz) :: ?: ?& =(%u care) =(~ path) @@ -2164,6 +2141,34 @@ :: ?: ?=(%x care) ?. =(p.bem our) ~ + :: + ?: ?=(%$ q.bem) :: app %$ reserved + ?+ path ~ + [%whey ~] + =/ blocked + =/ queued (~(run by blocked.state) |=((qeu blocked-move) [%.y +<])) + (sort ~(tap by queued) aor) + :: + =/ running + %+ turn (sort ~(tap by yokes.state) aor) + |= [dap=term =yoke] + ^- mass + =/ met=(list mass) + =/ dat (mo-peek:mo | dap [~ ship] %x /whey/mass) + ?: ?=(?(~ [~ ~]) dat) ~ + (fall ((soft (list mass)) q.q.u.u.dat) ~) + ?~ met + dap^&+yoke + dap^|+(welp met dot+&+yoke ~) + :: + =/ maz=(list mass) + :~ [%foreign %.y contacts.state] + [%blocked %.n blocked] + [%active %.n running] + == + ``mass+!>(maz) + == + :: ?~ yok=(~(get by yokes.state) q.bem) ~ ?: ?=(%nuke -.u.yok) ~ =/ ski (~(get by sky.u.yok) path) diff --git a/pkg/arvo/sys/vane/iris.hoon b/pkg/arvo/sys/vane/iris.hoon index 01e80eb56..d4862e0ae 100644 --- a/pkg/arvo/sys/vane/iris.hoon +++ b/pkg/arvo/sys/vane/iris.hoon @@ -395,7 +395,7 @@ :: ?. ?=(%& -.why) ~ =* his p.why - ?: &(=(ren %$) =(tyl /whey)) + ?: &(?=(%x ren) =(tyl //whey)) =/ maz=(list mass) :~ nex+&+next-id.state.ax outbound+&+outbound-duct.state.ax diff --git a/pkg/arvo/sys/vane/jael.hoon b/pkg/arvo/sys/vane/jael.hoon index 2f1335564..3f2047635 100644 --- a/pkg/arvo/sys/vane/jael.hoon +++ b/pkg/arvo/sys/vane/jael.hoon @@ -1066,13 +1066,15 @@ :: XX review for security, stability, cases other than now :: ?. =(lot [%$ %da now]) ~ - ?. =(%$ ren) [~ ~] - ?: =(tyl /whey) + :: + ?: &(?=(%x ren) =(tyl //whey)) =/ maz=(list mass) :~ pki+&+pki.lex etn+&+etn.lex == ``mass+!>(maz) + :: + ?. =(%$ ren) [~ ~] ?+ syd ~ ::