From 7fdb940b5c32df7bcdf7e4194431b9afa961aad4 Mon Sep 17 00:00:00 2001 From: Ted Blackman Date: Tue, 26 Nov 2019 23:52:43 -0500 Subject: [PATCH] ames: fix another comet bug --- bin/solid.pill | 4 ++-- pkg/arvo/sys/vane/alef.hoon | 28 +++++++++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 9a6ac47ce..f341211a9 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3dea0bc261bf9b42cb7f6d8cbe325776968511ca2bbaf0168992e8234b525db1 -size 10476754 +oid sha256:7fdeedf0449041a6ca8fa8ee0204f6e86a3b37eb80585fa81d2d1e2c9c1bc6f0 +size 10486202 diff --git a/pkg/arvo/sys/vane/alef.hoon b/pkg/arvo/sys/vane/alef.hoon index 48538e3e4..6291c62a1 100644 --- a/pkg/arvo/sys/vane/alef.hoon +++ b/pkg/arvo/sys/vane/alef.hoon @@ -1091,14 +1091,12 @@ ?> .= rcvr.open-packet our ?> .= sndr-life.open-packet 1 ?> .= rcvr-life.open-packet life.ames-state - :: no ghost comets allowed + :: only a star can sponsor a comet :: - ?> (lte 256 (^sein:title sndr.packet)) + ?> =(%king (clan:title (^sein:title sndr.packet))) :: comet public-key must hash to its @p address :: - :: TODO how does this validation work elsewhere? - :: - ?> =(`@`sndr.packet `@`(shaf %pawn public-key.open-packet)) + ?> =(sndr.packet fig:ex:(com:nu:crub:crypto public-key.open-packet)) :: everything after .signature is signed :: :: TODO: should this double-cue instead of re-jamming? @@ -1178,7 +1176,7 @@ =/ =peer-state (got-peer-state her) =/ =channel [[our her] now |2.ames-state -.peer-state] :: - abet:(on-memo:(make-peer-core peer-state channel) bone payload) + abet:(on-memo:(make-peer-core peer-state channel) bone payload %boon) :: +on-plea: handle request to send message :: ++ on-plea @@ -1203,7 +1201,7 @@ =/ rcvr [ship her-life.channel] "plea {}" :: - abet:(on-memo:(make-peer-core peer-state channel) bone plea) + abet:(on-memo:(make-peer-core peer-state channel) bone plea %plea) :: +on-take-wake: receive wakeup or error notification from behn :: ++ on-take-wake @@ -1635,11 +1633,15 @@ :: print message :: =. peer-core (emit duct %pass /qos %d %flog %text u.text) - :: if peer is ok, we're done + :: if peer has stopped responding, check if %boon's are backing up :: ?. ?=(?(%dead %unborn) -.qos.peer-state) peer-core - :: peer has stopped responding; check if our responses are backing up + check-clog + :: +check-clog: notify clients if peer has stopped responding + :: + ++ check-clog + ^+ peer-core :: :: Only look at response bones. Request bones are unregulated, :: since requests tend to be much smaller than responses. @@ -1686,11 +1688,15 @@ :: +on-memo: handle request to send message :: ++ on-memo - |= [=bone payload=*] + |= [=bone payload=* valence=?(%plea %boon)] ^+ peer-core :: =/ =message-blob (jam payload) - (run-message-pump bone %memo message-blob) + =. peer-core (run-message-pump bone %memo message-blob) + :: + ?: &(=(%boon valence) ?=(?(%dead %unborn) -.qos.peer-state)) + check-clog + peer-core :: +on-wake: handle timer expiration :: ++ on-wake