From 1c7c61c9bb9a23c705b1274c2e94007cb5226fa4 Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 22 May 2018 16:04:58 +0200 Subject: [PATCH] Support continuity number from Ships contract. --- sys/vane/jael.hoon | 3 +++ sys/zuse.hoon | 34 +++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/sys/vane/jael.hoon b/sys/vane/jael.hoon index 8c199700a0..913b14977e 100644 --- a/sys/vane/jael.hoon +++ b/sys/vane/jael.hoon @@ -2315,6 +2315,9 @@ ~? !=(key-revision.huv key-revision.hul) :- %key-revision-differs [key-revision.huv key-revision.hul] + ~? !=(continuity-number.huv continuity-number.hul) + :- %continuity-number-differs + [continuity-number.huv continuity-number.hul] ~? !=(spawn-count.huv spawn-count.hul) :- %spawn-count-differs [spawn-count.huv spawn-count.hul] diff --git a/sys/zuse.hoon b/sys/zuse.hoon index f25d6c1c76..801cb3b854 100644 --- a/sys/zuse.hoon +++ b/sys/zuse.hoon @@ -192,6 +192,7 @@ encryption-key=@ authentication-key=@ key-revision=@ud + continuity-number=@ud spawn-count=@ud spawned=(set @p) sponsor=@p @@ -220,6 +221,7 @@ [%bytes-n 32] :: encryptionKey [%bytes-n 32] :: authenticationKey %uint :: keyRevisionNumber + %uint :: continuityNumber %uint :: spawnCount %uint :: sponsor %bool :: escapeRequested @@ -237,6 +239,7 @@ encryption-key=octs authentication-key=octs key-revision=@ud + continuity-number=@ud spawn-count=@ud sponsor=@ud escape-requested=? @@ -272,6 +275,7 @@ [%owner new=address] [%spawned who=@p] [%keys enc=@ aut=@ rev=@ud] + [%continuity new=@ud] [%sponsor new=@p] [%escape new=(unit @p)] [%spawn-proxy new=address] @@ -5736,6 +5740,8 @@ `@`q.authentication-key :: key-revision + :: + continuity-number :: spawn-count :: @@ -5796,6 +5802,11 @@ ?> &(=(p.enc 32) =(p.aut 32)) :: sanity [who %keys q.enc q.aut rev]~ :: + ?: =(event.log broke-continuity) + =+ ^- [who=@ num=@] + (decode-results data.log ~[%uint %uint]) + [who %continuity num]~ + :: ?: =(event.log changed-spawn-proxy) =+ ^- [who=@ sox=address] (decode-results data.log ~[%uint %address]) @@ -5815,17 +5826,18 @@ |= [hul=hull dif=diff-hull] ^- hull ?- -.dif - %full new.dif - %owner hul(owner new.dif) - %spawned =+ (~(put in spawned.hul) who.dif) - hul(spawn-count +(spawn-count.hul), spawned -) - %keys %_ hul - encryption-key enc.dif - authentication-key aut.dif - key-revision rev.dif - == - %sponsor hul(sponsor new.dif, escape ~) - %escape hul(escape new.dif) + %full new.dif + %owner hul(owner new.dif) + %spawned =+ (~(put in spawned.hul) who.dif) + hul(spawn-count +(spawn-count.hul), spawned -) + %keys %_ hul + encryption-key enc.dif + authentication-key aut.dif + key-revision rev.dif + == + %continuity hul(continuity-number new.dif) + %sponsor hul(sponsor new.dif, escape ~) + %escape hul(escape new.dif) %spawn-proxy hul(spawn-proxy new.dif) %transfer-proxy hul(transfer-proxy new.dif) ==