ames: replace (empty) signatures with tag byte in fine requests (wail)

This commit is contained in:
Joe Bryan 2023-04-23 01:09:53 -04:00
parent 866a1840d1
commit d2d1412c3a
2 changed files with 24 additions and 24 deletions

View File

@ -1344,9 +1344,8 @@
num=@ud
==
::
+$ wail :: signed peep
$: signature=@
peep
+$ wail :: tagged request fragment
$% [%0 peep] :: unsigned
==
::
+$ roar :: response message
@ -1638,8 +1637,8 @@
++ sift-wail
|= =hoot
^- wail
:- sig=(end 9 hoot)
+:(sift-peep (rsh 9 hoot))
?> =(0 (end 3 hoot))
[%0 +:(sift-peep (rsh 3 hoot))]
::
++ sift-purr
|= =hoot

View File

@ -3746,35 +3746,33 @@
::
++ fi
=> |%
:: +gum: glue together a list of $byts into one
::
:: TODO: move to hoon.hoon (see +cad in lib/tiny)
::
++ gum
::~/ %gum
|= biz=(list byts)
^- byts
:- (roll biz |=([[wid=@ *] acc=@] (add wid acc)))
(can 3 biz)
:: TODO: move +etch-peep/+etch-wail to %lull?
::
++ etch-peep
|= [=path num=@ud]
^- byts
?> (lth num (bex 32))
|= peep
^- @
?> (lth num ^~((bex 32)))
=+ (spit path)
%- gum
%+ can 3
:~ 4^num :: fragment number
2^wid :: path size
wid^`@`pat :: namespace path
==
::
++ etch-wail
|= [=path num=@ud]
^- hoot ^- @
|= w=wail
^- @
?- -.w
%0 (lsh 3 (etch-peep +.w)) :: tag byte
==
::
++ make-shot
|= w=wail
^- shot
=/ sic (mod life.ames-state 16)
=/ ric (mod life.peer-state 16)
=/ syn (lsh [3 64] dat:(etch-peep path num))
(etch-shot [our her] req=& sam=| sic ric ~ syn)
[[our her] req=& sam=| sic ric ~ (etch-wail w)]
::
::
++ keys
|%
@ -3851,7 +3849,10 @@
++ fi-gauge (ga metrics.keen (wyt:fi-deq wan.keen))
++ fi-wait |=(tim=@da (fi-pass-timer %b %wait tim))
++ fi-rest |=(tim=@da (fi-pass-timer %b %rest tim))
++ fi-etch-wail |=(frag=@ud (etch-wail fi-full-path frag))
::
++ fi-etch-wail
|=(frag=@ud `hoot``@`(etch-shot (make-shot %0 fi-full-path frag)))
::
++ fi-send
|=(=hoot fine(event-core (send-blob for=| her `@ux`hoot)))
::