Make Urbit-side sponsorship state match chain state more closely

We always have a sponsor, plus a flag that says whether they're
actively sponsoring us. If they aren't they recently kicked us.
Because we can't do anything without a sponsor, we still try with them.
This commit is contained in:
Fang 2018-12-21 15:59:12 +01:00
parent 62bec00693
commit 4f51cfc6bb
3 changed files with 20 additions and 20 deletions

View File

@ -69,7 +69,7 @@
++ note-jael ::
$% $: %dawn :: boot from keys
=seed:able:jael :: identity params
spon=(unit ship) :: sponsor
spon=ship :: sponsor
czar=(map ship [=life =pass]) :: galaxy table
turf=(list turf) :: domains
bloq=@ud :: block number

View File

@ -637,11 +637,8 @@
=/ pot (~(get by pos.eth.sub) who)
?: ?& ?=(^ pot)
?=(^ net.u.pot)
?=(^ sponsor.u.net.u.pot)
==
u.sponsor.u.net.u.pot
:: XX fall back to most recent sponsor instead?
::
who.sponsor.u.net.u.pot
(^sein:title who)
:: :: ++saxo:of
++ saxo :: sponsorship chain
@ -670,7 +667,7 @@
:: boot from keys
:: $: $dawn
:: =seed
:: spon=(unit ship)
:: spon=ship
:: czar=(map ship [=life =pass])
:: turf=(list turf)}
:: bloq=@ud

View File

@ -148,7 +148,7 @@
$: =life
=pass
continuity-number=@ud
sponsor=(unit @p) ::TODO doesn't 100% reflect chain state
sponsor=[has=? who=@p]
escape=(unit @p)
==
::
@ -175,7 +175,7 @@
[%spawned who=@p] :: Spawned
[%keys =life =pass] :: ChangedKeys
[%continuity new=@ud] :: BrokeContinuity
[%sponsor new=(unit @p)] :: EscapeAcc/LostSpons
[%sponsor new=[has=? who=@p]] :: EscapeAcc/LostSpons
[%escape new=(unit @p)] :: EscapeReq/Can
[%management-proxy new=address] :: ChangedManagementPro
[%voting-proxy new=address] :: ChangedVotingProxy
@ -1848,7 +1848,7 @@
[%hail p=ship q=remote] :: remote update
$: %dawn :: boot from keys
=seed:able:jael :: identity params
spon=(unit ship) :: sponsor
spon=ship :: sponsor
czar=(map ship [=life =pass]) :: galaxy table
turf=(list turf) :: domains
bloq=@ud :: block number
@ -7290,8 +7290,7 @@
::
continuity-number
::
?. has-sponsor ~
``@p`sponsor
[has-sponsor `@p`sponsor]
::
?. escape-requested ~
``@p`escape-to
@ -7339,12 +7338,12 @@
?: =(event.log escape-accepted)
=+ ^- [who=@ wer=@]
(decode-topics topics.log ~[%uint %uint])
`[who %sponsor `wer]
`[who %sponsor & wer]
::
?: =(event.log lost-sponsor)
=+ ^- [who=@ pos=@]
(decode-topics topics.log ~[%uint %uint])
`[who %sponsor ~]
`[who %sponsor | pos]
::
?: =(event.log changed-keys)
=/ who=@ (decode-topics topics.log ~[%uint])
@ -7395,7 +7394,7 @@
::
%activated
%_ pot
net `[0 0 0 `(^sein:title who.dif) ~]
net `[0 0 0 &^(^sein:title who.dif) ~]
kid ?. ?=(?(%czar %king) (clan:title who.dif)) ~
`[0x0 ~]
==
@ -7416,8 +7415,10 @@
pot(life.u.net life.dif, pass.u.net pass.dif)
::
%sponsor
?~ new.dif pot(sponsor.u.net ~)
pot(sponsor.u.net new.dif, escape.u.net ~)
%= pot
sponsor.u.net new.dif
escape.u.net ?:(has.new.dif ~ escape.u.net.pot)
==
::
%continuity pot(continuity-number.u.net new.dif)
%escape pot(escape.u.net new.dif)
@ -8429,7 +8430,7 @@
::
++ veri
|= [=seed:able:jael =point:azimuth =live]
^- (each sponsor=(unit ship) error=term)
^- (each sponsor=ship error=term)
=/ rac (clan:title who.seed)
=/ cub (nol:nu:crub:crypto key.seed)
?- rac
@ -8446,7 +8447,7 @@
::
?. ?=(%1 lyf.seed)
[%| %invalid-life]
[%& ~]
[%& ~marzod] ::TODO how to do comet sponsorship?
::
%earl
:: a moon must be signed by the parent
@ -8471,7 +8472,7 @@
::
?^ live
[%| %already-booted]
[%& ~]
[%& (^sein:title who.seed)]
::
*
:: on-chain ships must be launched
@ -8496,7 +8497,9 @@
[%| %already-booted]
:: produce the sponsor for vere
::
[%& sponsor.u.net.point]
~? !has.sponsor.u.net.point
[%no-sponsorship-guarantees-from who.sponsor.u.net.point]
[%& who.sponsor.u.net.point]
==
--
-- ::