From 9d7b196024be21f0cc24f291d215ce8860e8d27d Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Wed, 3 May 2023 12:59:44 -0700 Subject: [PATCH 01/28] clay: on update, remove all previous pending updates Fixes #6537, see discussion there for alternatives. --- pkg/arvo/sys/vane/clay.hoon | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 0cf03ada43..82542b0795 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -1818,7 +1818,11 @@ =? ..park !?=(%base syd) wick :: [wick] %- (slog leaf+"clay: wait-for-kelvin, {<[need=zuse/zuse have=kel]>}" ~) tare :: [tare] > - =. wic.dom (~(del by wic.dom) zuse+zuse) + =. wic.dom + %- ~(gas by *(map weft ^yoki)) + %+ skip ~(tap by wic.dom) + |= [w=weft ^yoki] + (gte num.w zuse) :: =/ old-yaki ?: =(0 let.dom) From 48ec5b26930d773d08ae3cdb72f219e09e6c829c Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 3 May 2023 18:48:30 -0400 Subject: [PATCH 02/28] clay: remove %take-foreign slog --- pkg/arvo/sys/vane/clay.hoon | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 0cf03ada43..004eceecb6 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -3304,7 +3304,6 @@ |= [inx=@ud rut=(unit rand)] ^+ +> ?> ?=(^ ref) - ~& take-foreign/inx =+ ruv=(~(get by bom.u.ref) inx) ?~ ruv ~& %bad-answer From 08ad367cd8c54cca1622d96125ad4d02ef429a6c Mon Sep 17 00:00:00 2001 From: fang Date: Thu, 4 May 2023 17:33:37 +0200 Subject: [PATCH 03/28] eyre: when a %request causes a crud, serve 500 Previously, if an incoming request caused a crash, we would just drop it on the floor. We should at least have the decency to serve the client a quick 500 and let them get on with their day. We make sure not to touch state here. The connection is guaranteed-fresh because of the task's semantics, and we're handling it in-line in one go. Notably we only give a simple "crud!" for the body, instead of the full error trace. We don't know whether the request is authenticated or not (and who knows if checking was the cause of the crash!), and the crud might leak sensitive details about the ship it occurred on. For the owner, the trace still gets printed into the terminal. --- pkg/arvo/sys/vane/eyre.hoon | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/vane/eyre.hoon b/pkg/arvo/sys/vane/eyre.hoon index 674e592171..9e2aaa6609 100644 --- a/pkg/arvo/sys/vane/eyre.hoon +++ b/pkg/arvo/sys/vane/eyre.hoon @@ -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) From 6389776fc1bb99d65e5482e77a90a4fcf8ea7e24 Mon Sep 17 00:00:00 2001 From: Sigilante <57601680+sigilante@users.noreply.github.com> Date: Thu, 4 May 2023 16:17:50 -0500 Subject: [PATCH 04/28] Update story-init.hoon --- pkg/arvo/gen/hood/story-init.hoon | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pkg/arvo/gen/hood/story-init.hoon b/pkg/arvo/gen/hood/story-init.hoon index d682864480..b7ab2b2217 100644 --- a/pkg/arvo/gen/hood/story-init.hoon +++ b/pkg/arvo/gen/hood/story-init.hoon @@ -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 {} does not exist." - helm-pass+[%d %noop ~] + helm-pass+[%d %flog %text "Error: 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)]~]] \ No newline at end of file +[%c [%info desk %& [/story %ins story+!>(tale)]~]] From 03da1cb4f97916c7fa1e0c9d1acaf4a8aeeb7db6 Mon Sep 17 00:00:00 2001 From: Sigilante <57601680+sigilante@users.noreply.github.com> Date: Thu, 4 May 2023 16:22:44 -0500 Subject: [PATCH 05/28] Update story-write.hoon --- pkg/arvo/gen/hood/story-write.hoon | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/arvo/gen/hood/story-write.hoon b/pkg/arvo/gen/hood/story-write.hoon index 5c213dad1f..2d38f373a4 100644 --- a/pkg/arvo/gen/hood/story-write.hoon +++ b/pkg/arvo/gen/hood/story-write.hoon @@ -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 {} does not exist." - helm-pass+[%d %noop ~] + helm-pass+[%d %flog %text "Error: desk {} does not exist."] =/ tak=tako:clay ?: ?=([%tako tako:clay] cas) p.cas @@ -25,10 +24,9 @@ :: =/ 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) :- %helm-pass -[%c [%info desk %& [/story %ins story+!>(tale)]~]] \ No newline at end of file +[%c [%info desk %& [/story %ins story+!>(tale)]~]] From 0762b90daa2ceaa40833936009aa1588484317b2 Mon Sep 17 00:00:00 2001 From: Sigilante <57601680+sigilante@users.noreply.github.com> Date: Thu, 4 May 2023 16:25:39 -0500 Subject: [PATCH 06/28] Update story-remove.hoon --- pkg/arvo/gen/hood/story-remove.hoon | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/arvo/gen/hood/story-remove.hoon b/pkg/arvo/gen/hood/story-remove.hoon index 8a3fe4c171..27b782ea10 100644 --- a/pkg/arvo/gen/hood/story-remove.hoon +++ b/pkg/arvo/gen/hood/story-remove.hoon @@ -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 {} does not exist." - helm-pass+[%d %noop ~] + helm-pass+[%d %flog %text "Error: desk {} does not exist."] =/ tak=tako:clay ?: ?=([%tako tako:clay] cas) p.cas @@ -25,12 +24,11 @@ :: =/ 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) (~(del by tale) tak) (~(del ju tale) tak prz) :- %helm-pass -[%c [%info desk %& [/story %ins story+!>(tale)]~]] \ No newline at end of file +[%c [%info desk %& [/story %ins story+!>(tale)]~]] From ac9c779e2d0a9830580fb703c142bb7ff8b5595f Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Mon, 8 May 2023 19:08:12 +0300 Subject: [PATCH 07/28] spider: uncomment spurious comment line --- pkg/arvo/app/spider.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index c41e198379..138b7ecac2 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -300,7 +300,7 @@ ~/ %handle-http-request |= [eyre-id=@ta =inbound-request:eyre] ^- (quip card _state) - ::?> authenticated.inbound-request + ?> authenticated.inbound-request =/ url (parse-request-line:server url.request.inbound-request) ?> ?=([%spider @t @t @t @t ~] site.url) From d65bcc248eb0387f897e9a7b0194a22b83109413 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 9 May 2023 16:40:18 +0200 Subject: [PATCH 08/28] gall: don't try to notify nuked agents about breaches --- pkg/arvo/sys/vane/gall.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 0ab76c8908..a0e522ce0b 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -423,7 +423,8 @@ ^+ mo-core =. mo-core (mo-untrack-ship ship) =. mo-core (mo-filter-queue ship) - =/ agents=(list [name=term =yoke]) ~(tap by yokes.state) + =/ agents=(list [name=term =yoke]) + (skim ~(tap by yokes.state) |=([* =yoke] =(%live -.yoke))) =. outstanding.state %- malt %+ skip ~(tap by outstanding.state) From ded78a6ab14142a0215b00a1f7b20f6d2c5c5f38 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 9 May 2023 16:40:18 +0200 Subject: [PATCH 09/28] gall: don't try to notify nuked agents about breaches --- pkg/arvo/sys/vane/gall.hoon | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 0ab76c8908..a0e522ce0b 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -423,7 +423,8 @@ ^+ mo-core =. mo-core (mo-untrack-ship ship) =. mo-core (mo-filter-queue ship) - =/ agents=(list [name=term =yoke]) ~(tap by yokes.state) + =/ agents=(list [name=term =yoke]) + (skim ~(tap by yokes.state) |=([* =yoke] =(%live -.yoke))) =. outstanding.state %- malt %+ skip ~(tap by outstanding.state) From f0e4e7f9803fedfb9cb4389ca49dda268f52a83a Mon Sep 17 00:00:00 2001 From: Pyry Kovanen Date: Mon, 8 May 2023 19:08:12 +0300 Subject: [PATCH 10/28] spider: uncomment spurious comment line --- pkg/arvo/app/spider.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index c41e198379..138b7ecac2 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -300,7 +300,7 @@ ~/ %handle-http-request |= [eyre-id=@ta =inbound-request:eyre] ^- (quip card _state) - ::?> authenticated.inbound-request + ?> authenticated.inbound-request =/ url (parse-request-line:server url.request.inbound-request) ?> ?=([%spider @t @t @t @t ~] site.url) From af4bf28ac79d7e6cf6cc2813e27dd4b197502919 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 9 May 2023 17:14:19 +0200 Subject: [PATCH 11/28] gall: always check that an agent isn't nuke before initializing `+ap` --- pkg/arvo/sys/vane/gall.hoon | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index a0e522ce0b..7948c3f0a9 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -423,8 +423,7 @@ ^+ mo-core =. mo-core (mo-untrack-ship ship) =. mo-core (mo-filter-queue ship) - =/ agents=(list [name=term =yoke]) - (skim ~(tap by yokes.state) |=([* =yoke] =(%live -.yoke))) + =/ agents=(list [name=term =yoke]) ~(tap by yokes.state) =. outstanding.state %- malt %+ skip ~(tap by outstanding.state) @@ -434,7 +433,7 @@ |- ^+ mo-core ?~ agents mo-core - =. mo-core + =? mo-core ?=(%live -.i.agents) =/ =routes [disclosing=~ attributing=ship] =/ app (ap-abed:ap name.i.agents routes) ap-abet:(ap-breach:app ship) @@ -475,12 +474,12 @@ ?> ?=([%lag ~] wire) ?> ?=([%ames %clog *] sign-arvo) :: - =/ agents=(list term) ~(tap in ~(key by yokes.state)) + =/ agents=(list [=dude =yoke]) ~(tap by yokes.state) |- ^+ mo-core ?~ agents mo-core :: - =. mo-core - =/ app (ap-abed:ap i.agents `our) + =? mo-core ?=(%live -.yoke.i.agents) + =/ app (ap-abed:ap dude.i.agents `our) ap-abet:(ap-clog:app ship.sign-arvo) :: $(agents t.agents) @@ -705,7 +704,8 @@ ++ mo-idle |= dap=dude ^+ mo-core - ?. (~(has by yokes.state) dap) + =/ yoke=(unit yoke) (~(get by yokes.state) dap) + ?: |(?=(~ yoke) ?=(%nuke -.u.yoke)) ~> %slog.0^leaf/"gall: ignoring %idle for {}, not running" mo-core ap-abet:ap-idle:(ap-abed:ap dap `our) @@ -714,14 +714,15 @@ ++ mo-nuke |= dap=dude ^+ mo-core - ?. (~(has by yokes.state) dap) + =/ yoke=(unit yoke) (~(get by yokes.state) dap) + ?: |(?=(~ yoke) ?=(%nuke -.u.yoke)) ~> %slog.0^leaf/"gall: ignoring %nuke for {}, not running" mo-core ~> %slog.0^leaf/"gall: nuking {}" =. mo-core ap-abet:ap-nuke:(ap-abed:ap dap `our) =- mo-core(yokes.state -) %+ ~(jab by yokes.state) dap - |= =yoke + |= =^yoke ?: ?=(%nuke -.yoke) yoke :- %nuke %- ~(run by sky.yoke) @@ -914,6 +915,7 @@ ^+ wire =/ nonce=@ (~(got by boar.yoke) wire dock) ?: =(0 nonce) wire + ~& %hello [(scot %ud nonce) wire] :: ++ ap-core . From 4660380dac6de0f0bb6be98fdb443e4972cb7fd6 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 9 May 2023 17:17:03 +0200 Subject: [PATCH 12/28] gall: remove sigpam --- pkg/arvo/sys/vane/gall.hoon | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 7948c3f0a9..7043c0775c 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -915,7 +915,6 @@ ^+ wire =/ nonce=@ (~(got by boar.yoke) wire dock) ?: =(0 nonce) wire - ~& %hello [(scot %ud nonce) wire] :: ++ ap-core . From 55fc624f7205c2c27c6f1cd208671ce8e55360f3 Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 9 May 2023 17:21:21 +0200 Subject: [PATCH 13/28] gall: check the union tag instead of the `dude` --- pkg/arvo/sys/vane/gall.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 7043c0775c..53818778cb 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -433,7 +433,7 @@ |- ^+ mo-core ?~ agents mo-core - =? mo-core ?=(%live -.i.agents) + =? mo-core ?=(%live -.yoke.i.agents) =/ =routes [disclosing=~ attributing=ship] =/ app (ap-abed:ap name.i.agents routes) ap-abet:(ap-breach:app ship) From 6d984e764e5931f467a636312395df910517316e Mon Sep 17 00:00:00 2001 From: ~wicrum-wicrun <99811688+wicrum-wicrun@users.noreply.github.com> Date: Tue, 9 May 2023 17:29:04 +0200 Subject: [PATCH 14/28] gall: return `[~ ~]` when scrying a nuked or nonexistant agent --- pkg/arvo/sys/vane/gall.hoon | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 53818778cb..79f7a226ab 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -757,6 +757,7 @@ |= [veb=? dap=term =routes care=term =path] ^- (unit (unit cage)) :: + ?. ?=([~ %live *] (~(get by yokes.state) dap)) [~ ~] =/ app (ap-abed:ap dap routes) (ap-peek:app veb care path) :: From fe91cdd357bea90586b98c6b46842997e801a22b Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 9 May 2023 11:45:01 -0400 Subject: [PATCH 15/28] Merge pull request #6566 from urbit/wicrum/live-before-abed gall: always check that an agent isn't nuked before initializing `+ap` --- pkg/arvo/sys/vane/gall.hoon | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index a0e522ce0b..79f7a226ab 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -423,8 +423,7 @@ ^+ mo-core =. mo-core (mo-untrack-ship ship) =. mo-core (mo-filter-queue ship) - =/ agents=(list [name=term =yoke]) - (skim ~(tap by yokes.state) |=([* =yoke] =(%live -.yoke))) + =/ agents=(list [name=term =yoke]) ~(tap by yokes.state) =. outstanding.state %- malt %+ skip ~(tap by outstanding.state) @@ -434,7 +433,7 @@ |- ^+ mo-core ?~ agents mo-core - =. mo-core + =? mo-core ?=(%live -.yoke.i.agents) =/ =routes [disclosing=~ attributing=ship] =/ app (ap-abed:ap name.i.agents routes) ap-abet:(ap-breach:app ship) @@ -475,12 +474,12 @@ ?> ?=([%lag ~] wire) ?> ?=([%ames %clog *] sign-arvo) :: - =/ agents=(list term) ~(tap in ~(key by yokes.state)) + =/ agents=(list [=dude =yoke]) ~(tap by yokes.state) |- ^+ mo-core ?~ agents mo-core :: - =. mo-core - =/ app (ap-abed:ap i.agents `our) + =? mo-core ?=(%live -.yoke.i.agents) + =/ app (ap-abed:ap dude.i.agents `our) ap-abet:(ap-clog:app ship.sign-arvo) :: $(agents t.agents) @@ -705,7 +704,8 @@ ++ mo-idle |= dap=dude ^+ mo-core - ?. (~(has by yokes.state) dap) + =/ yoke=(unit yoke) (~(get by yokes.state) dap) + ?: |(?=(~ yoke) ?=(%nuke -.u.yoke)) ~> %slog.0^leaf/"gall: ignoring %idle for {}, not running" mo-core ap-abet:ap-idle:(ap-abed:ap dap `our) @@ -714,14 +714,15 @@ ++ mo-nuke |= dap=dude ^+ mo-core - ?. (~(has by yokes.state) dap) + =/ yoke=(unit yoke) (~(get by yokes.state) dap) + ?: |(?=(~ yoke) ?=(%nuke -.u.yoke)) ~> %slog.0^leaf/"gall: ignoring %nuke for {}, not running" mo-core ~> %slog.0^leaf/"gall: nuking {}" =. mo-core ap-abet:ap-nuke:(ap-abed:ap dap `our) =- mo-core(yokes.state -) %+ ~(jab by yokes.state) dap - |= =yoke + |= =^yoke ?: ?=(%nuke -.yoke) yoke :- %nuke %- ~(run by sky.yoke) @@ -756,6 +757,7 @@ |= [veb=? dap=term =routes care=term =path] ^- (unit (unit cage)) :: + ?. ?=([~ %live *] (~(get by yokes.state) dap)) [~ ~] =/ app (ap-abed:ap dap routes) (ap-peek:app veb care path) :: From b7e8b9cbfe67eb8a3a83637e5e5adc80f313ac65 Mon Sep 17 00:00:00 2001 From: fang Date: Tue, 9 May 2023 20:59:51 +0200 Subject: [PATCH 16/28] clay: the commit must actually be known +read-at-tako was checking for the zero tako, but had the conditional inverted. Here, we correct the conditional, and fold the +may-read check into the whole. --- pkg/arvo/sys/vane/clay.hoon | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 162c8d20e0..6224ebdc3f 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -4492,14 +4492,13 @@ ++ read-at-tako :: read-at-tako:ze |= [for=(unit ship) tak=tako mun=mood] :: seek and read ^- [(unit (unit cage)) _..park] - ?. |(?=(~ for) (may-read u.for care.mun tak path.mun)) - [~ ..park] :: the commit must be known, and reachable from within this desk :: - ?. ?| =(0v0 tak) - ?& (~(has by hut.ran) tak) + ?. ?& !=(0v0 tak) + (~(has by hut.ran) tak) (~(has in (reachable-takos (aeon-to-tako:ze let.dom))) tak) - == == + |(?=(~ for) (may-read u.for care.mun tak path.mun)) + == [~ ..park] :: virtualize to catch and produce deterministic failures :: From 3219ce5cb7204e0167afbc67be0d46eb240b2314 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Wed, 10 May 2023 13:51:58 +0200 Subject: [PATCH 17/28] gall: don't throw away agent when suspending it --- pkg/arvo/sys/vane/gall.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 79f7a226ab..eb96fcab99 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -973,7 +973,7 @@ ++ ap-idle ^+ ap-core ?: ?=(%| -.agent.yoke) ap-core - => [ken=ken.yoke (ap-ingest ~ |.([ap-yawn-all *agent]))] + => [ken=ken.yoke (ap-ingest ~ |.([ap-yawn-all p.agent.yoke]))] ap-core(ken.yoke ken, agent.yoke |+on-save:ap-agent-core) :: ++ ap-nuke From 50239414eee5ada60a8510731674f19efabef2d9 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 10 May 2023 09:48:46 -0400 Subject: [PATCH 18/28] clay: allow reads at the null tako --- pkg/arvo/sys/vane/clay.hoon | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 6224ebdc3f..319cd1f224 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -4492,13 +4492,13 @@ ++ read-at-tako :: read-at-tako:ze |= [for=(unit ship) tak=tako mun=mood] :: seek and read ^- [(unit (unit cage)) _..park] - :: the commit must be known, and reachable from within this desk + :: non-zero commits must be known, and reachable from within this desk :: - ?. ?& !=(0v0 tak) - (~(has by hut.ran) tak) + ?. ?| =(0v0 tak) + ?& (~(has by hut.ran) tak) (~(has in (reachable-takos (aeon-to-tako:ze let.dom))) tak) |(?=(~ for) (may-read u.for care.mun tak path.mun)) - == + == == [~ ..park] :: virtualize to catch and produce deterministic failures :: From 42c22bf4f3cf9911c1967c58480cd1dd42e9f9e6 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Wed, 10 May 2023 17:18:31 +0200 Subject: [PATCH 19/28] ames: on-take-wake no-op if not path for keen --- pkg/arvo/sys/vane/ames.hoon | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 2aa5a1fbff..8cc470344d 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -2200,7 +2200,11 @@ =/ peer-core (abed-peer:pe her.u.res u.state) ?- -.u.res %pump abet:(on-wake:peer-core bone.u.res error) - %fine abet:fi-abet:fi-take-wake:(abed:fi:peer-core wire.u.res) + :: + %fine + ?. (~(has by keens.peer-state.peer-core) wire.u.res) + event-core + abet:fi-abet:fi-take-wake:(abed:fi:peer-core wire.u.res) == :: =. event-core (emit duct %pass /recork %b %wait `@da`(add now ~d1)) From f224d5be603b176e9de307255339aa6db586f492 Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Fri, 12 May 2023 09:20:43 +0200 Subject: [PATCH 20/28] gen: add +ames-keys generator --- pkg/arvo/gen/ames-keys.hoon | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 pkg/arvo/gen/ames-keys.hoon diff --git a/pkg/arvo/gen/ames-keys.hoon b/pkg/arvo/gen/ames-keys.hoon new file mode 100644 index 0000000000..75681252dd --- /dev/null +++ b/pkg/arvo/gen/ames-keys.hoon @@ -0,0 +1,10 @@ +:: 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) + == +=/ =peer-state:ames ?>(?=(%known -.ship-state) +.ship-state) +:- %noun +[life=life rift=rift]:peer-state From 6135349d85c7b8e0f65830ae3473436fd626313b Mon Sep 17 00:00:00 2001 From: yosoyubik Date: Fri, 12 May 2023 10:27:30 +0200 Subject: [PATCH 21/28] gen: don't crash if alien --- pkg/arvo/gen/ames-keys.hoon | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/arvo/gen/ames-keys.hoon b/pkg/arvo/gen/ames-keys.hoon index 75681252dd..ac1cf4d15d 100644 --- a/pkg/arvo/gen/ames-keys.hoon +++ b/pkg/arvo/gen/ames-keys.hoon @@ -5,6 +5,7 @@ =+ .^ =ship-state:ames %ax /(scot %p our)//(scot %da now)/peers/(scot %p ship) == -=/ =peer-state:ames ?>(?=(%known -.ship-state) +.ship-state) :- %noun -[life=life rift=rift]:peer-state +?. ?=(%known -.ship-state) + %ship-still-alien +[life=life rift=rift]:+.ship-state From 48b10dcdc7ae7b795f9155cb907f92b6a0b6c385 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 15 May 2023 16:04:53 -0700 Subject: [PATCH 22/28] clay: add fast-path for permissions check --- pkg/arvo/sys/vane/clay.hoon | 4 +++- pkg/arvo/sys/vane/gall.hoon | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 319cd1f224..bda99e0ad9 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -4496,7 +4496,9 @@ :: ?. ?| =(0v0 tak) ?& (~(has by hut.ran) tak) - (~(has in (reachable-takos (aeon-to-tako:ze let.dom))) 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] diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index eb96fcab99..4bb4171c70 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -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? From 8ef86629ec62bf7d20e1602dd42ab94d93bdd5a8 Mon Sep 17 00:00:00 2001 From: Daryl Richter Date: Tue, 16 May 2023 14:40:08 -0400 Subject: [PATCH 23/28] clarify +vats usage in +vat deprecation msg --- pkg/arvo/gen/vat.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/gen/vat.hoon b/pkg/arvo/gen/vat.hoon index 230a70adce..bae590e368 100644 --- a/pkg/arvo/gen/vat.hoon +++ b/pkg/arvo/gen/vat.hoon @@ -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) == From c84cf7359b3e8efc27791c42b5a2d37192d1a759 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 16 May 2023 15:52:21 -0400 Subject: [PATCH 24/28] clay: adds trace level 4 for mark conversion details --- pkg/arvo/sys/vane/clay.hoon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index bda99e0ad9..dce2daeb98 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -715,6 +715,7 @@ ?: (~(has in cycle.nub) cast+[a b]) ~|(cycle+cast+[a b]^cycle.nub !!) ?: =([%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 +730,7 @@ :: %+ gain-leak cast+a^b |= nob=state + %- (trace 4 |.("{} -> {}: +{(trip b)}:grow:{(trip a)}")) =. nub nob :_ nub :- %vase %+ slap (with-faces cor+old ~) @@ -743,18 +745,22 @@ ?: &(?=(%& -.rab) ?=(^ q.p.rab)) %+ gain-leak cast+a^b |= nob=state + %- (trace 4 |.("{} -> {}: +{(trip a)}:grab:{(trip b)}")) =. nub nob :_(nub vase+p.rab) :: try +jump :: =/ jum (mule |.((slap old tsgl/[limb/b limb/%jump]))) ?: ?=(%& -.jum) + %- (trace 4 |.("{} -> {}: +jump:{(trip b)}")) (compose-casts a !<(mark p.jum) b) ?: ?=(%& -.rab) + %- (trace 4 |.("{} -> {}: +grab:{(trip b)}")) (compose-casts a !<(mark p.rab) b) ?: ?=(%noun b) %+ gain-leak cast+a^b |= nob=state + %- (trace 4 |.("{} -> {} default")) =. nub nob :_(nub vase+same.bud) ~|(no-cast-from+[a b] !!) From 401776545c301abe34a14f3812080e017bc1dae7 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 16 May 2023 15:59:04 -0400 Subject: [PATCH 25/28] clay: shortcircuit identity casts --- pkg/arvo/sys/vane/clay.hoon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index dce2daeb98..49203188fc 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -714,6 +714,12 @@ =. 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)))]) From bbd43cc7d4abf01dedb1484125a75ee4f7ef51e3 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Tue, 16 May 2023 16:42:13 -0400 Subject: [PATCH 26/28] clay: clarify +compose-cast trace messages --- pkg/arvo/sys/vane/clay.hoon | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/arvo/sys/vane/clay.hoon b/pkg/arvo/sys/vane/clay.hoon index 49203188fc..10f23da69d 100644 --- a/pkg/arvo/sys/vane/clay.hoon +++ b/pkg/arvo/sys/vane/clay.hoon @@ -758,11 +758,13 @@ :: =/ jum (mule |.((slap old tsgl/[limb/b limb/%jump]))) ?: ?=(%& -.jum) - %- (trace 4 |.("{} -> {}: +jump:{(trip b)}")) - (compose-casts a !<(mark p.jum) b) + =/ via !<(mark p.jum) + %- (trace 4 |.("{} -> {}: via {} per +jump:{(trip a)}")) + (compose-casts a via b) ?: ?=(%& -.rab) - %- (trace 4 |.("{} -> {}: +grab:{(trip b)}")) - (compose-casts a !<(mark p.rab) b) + =/ via !<(mark p.rab) + %- (trace 4 |.("{} -> {}: via {} per +grab:{(trip b)}")) + (compose-casts a via b) ?: ?=(%noun b) %+ gain-leak cast+a^b |= nob=state From 8cba74630f8f776f8681d41fcec827a9a4ce1ff8 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Tue, 16 May 2023 23:01:54 -0700 Subject: [PATCH 27/28] ames: bugfixes --- pkg/arvo/sys/vane/ames.hoon | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 8cc470344d..47db0d345e 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -2886,6 +2886,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 +4453,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) From 15440d3ddae441ffddb7c05b3be2ee34fac2ac25 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Wed, 17 May 2023 16:51:12 -0400 Subject: [PATCH 28/28] ames: add %rift to %stir --- pkg/arvo/sys/vane/ames.hoon | 77 ++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/pkg/arvo/sys/vane/ames.hoon b/pkg/arvo/sys/vane/ames.hoon index 47db0d345e..dbcd1129c3 100644 --- a/pkg/arvo/sys/vane/ames.hoon +++ b/pkg/arvo/sys/vane/ames.hoon @@ -1755,41 +1755,56 @@ ++ on-stir |= arg=@t ^+ event-core - =/ want=(set [@da ^duct]) - %- ~(rep by peers.ames-state) - |= [[who=ship s=ship-state] acc=(set [@da ^duct])] - ?. ?=(%known -.s) acc - %- ~(rep by snd.+.s) - |= [[b=bone m=message-pump-state] acc=_acc] - =* tim next-wake.packet-pump-state.m - ?~ tim acc - %- ~(put in acc) - [u.tim `^duct`~[ames+(make-pump-timer-wire who b) /ames]] - =. want - (~(put in want) (add now ~d1) ~[/ames/recork /ames]) + |^ ?+ arg do-stir + %rift do-rift + == :: - =/ have - %- ~(gas in *(set [@da ^duct])) - =/ tim - ;; (list [@da ^duct]) - =< q.q %- need %- need - (rof ~ %bx [[our %$ da+now] /debug/timers]) - (skim tim |=([@da hen=^duct] ?=([[%ames ?(%pump %recork) *] *] hen))) + ++ 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 {} to {}" + event-core(ames-state ames-state(rift rift)) :: - :: set timers for flows that should have one set but don't - :: - =. event-core - %- ~(rep in (~(dif in want) have)) + ++ do-stir + =/ want=(set [@da ^duct]) + %- ~(rep by peers.ames-state) + |= [[who=ship s=ship-state] acc=(set [@da ^duct])] + ?. ?=(%known -.s) acc + %- ~(rep by snd.+.s) + |= [[b=bone m=message-pump-state] acc=_acc] + =* tim next-wake.packet-pump-state.m + ?~ tim acc + %- ~(put in acc) + [u.tim `^duct`~[ames+(make-pump-timer-wire who b) /ames]] + =. want + (~(put in want) (add now ~d1) ~[/ames/recork /ames]) + :: + =/ have + %- ~(gas in *(set [@da ^duct])) + =/ tim + ;; (list [@da ^duct]) + =< q.q %- need %- need + (rof ~ %bx [[our %$ da+now] /debug/timers]) + (skim tim |=([@da hen=^duct] ?=([[%ames ?(%pump %recork) *] *] hen))) + :: + :: set timers for flows that should have one set but don't + :: + =. event-core + %- ~(rep in (~(dif in want) have)) + |= [[wen=@da hen=^duct] this=_event-core] + ?> ?=([^ *] hen) + (emit:this ~[/ames] %pass t.i.hen %b %wait wen) + :: + :: cancel timers for flows that have one set but shouldn't + :: + %- ~(rep in (~(dif in have) want)) |= [[wen=@da hen=^duct] this=_event-core] ?> ?=([^ *] hen) - (emit:this ~[/ames] %pass t.i.hen %b %wait wen) - :: - :: cancel timers for flows that have one set but shouldn't - :: - %- ~(rep in (~(dif in have) want)) - |= [[wen=@da hen=^duct] this=_event-core] - ?> ?=([^ *] hen) - (emit:this t.hen %pass t.i.hen %b %rest wen) + (emit:this t.hen %pass t.i.hen %b %rest wen) + -- :: +on-crud: handle event failure; print to dill :: ++ on-crud