Merge branch 'philip/roller' into naive/preboot

This commit is contained in:
fang 2021-11-09 11:41:32 +01:00
commit 4314596280
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
14 changed files with 61 additions and 47 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e6e3c7c0274352d2cfba2a9f2b3382cdeab0e0fb97455b42293a214561d177ee
size 1101949
oid sha256:f59ec4eaf907227a1fd64e1d54810b769b5d39f6811c6bb254b2e89de528ca04
size 1209494

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1f75add9e2b4522ee18a3ef64beb52a3f3b49345e8ac31e4954449c4f4d3b2ef
size 21338783
oid sha256:a3e9d1c5a0d87ed487af2d6d55fbcadbedcc7b12e4812b9c52846f87c6e42699
size 24033452

View File

@ -6,10 +6,16 @@
default-agent,
verb,
dbug
:: Generally don't update the snapshot until we have clay tombstoning.
:: To update, run:
:: =e -build-file %/lib/ethereum/hoon
:: =l .^((list event-log:rpc:e) %gx /=azimuth=/logs/noun)
:: */app/azimuth/logs/eth-logs &eth-logs l
::
/* snap %eth-logs /app/azimuth/logs/eth-logs
::
=/ last-snap :: maybe just use the last one?
%+ roll `(list event-log:rpc:ethereum)`~ ::snap
%+ roll `(list event-log:rpc:ethereum)`snap ::~
|= [log=event-log:rpc:ethereum last=@ud]
?~ mined.log
last
@ -24,7 +30,7 @@
+$ app-state
$: %0
url=@ta
net=network
=net
whos=(set ship)
nas=^state:naive
own=owners
@ -37,11 +43,10 @@
[%listen whos=(list ship) =source:jael]
:: %watch: configure node url and network
::
[%watch url=@ta net=network]
[%watch url=@ta =net]
==
::
+$ tagged-diff [=id:block diff:naive]
+$ network ?(%mainnet %ropsten %local)
+$ card card:agent:gall
:: TODO: add to state?
::
@ -117,9 +122,12 @@
net.state net.poke
url.state url.poke
own.state ~
logs.state ~
logs.state ?:(?=(%default net.poke) snap ~)
==
[start:do this]
%- %- slog :_ ~
leaf+"azimuth: loading snapshot with {<(lent logs.state)>} events"
=^ snap-cards state (run-logs:do logs.state)
[(weld (jael-update:do (to-udiffs:do snap-cards)) start:do) this]
==
::
++ on-watch
@ -138,7 +146,13 @@
~
(~(put in whos.state) u.who)
^- (quip card _this)
[start:do this]
:: Slow to recalculate all the diffs, but this is necessary to make
:: sure Jael gets the updates from the snapshot
::
%- %- slog :_ ~
leaf+"azimuth: loading snapshot with {<(lent logs.state)>} events"
=/ res (%*(run-logs do nas.state *^state:naive) logs.state)
[(weld (jael-update:do (to-udiffs:do -.res)) start:do) this]
::
++ on-leave on-leave:def
++ on-peek
@ -291,7 +305,7 @@
++ jael-update
|= =udiffs:point
^- (list card)
?: & ~ :: XX
:: ?: & ~ :: XX
:- [%give %fact ~[/] %azimuth-udiffs !>(udiffs)]
|- ^- (list card)
?~ udiffs
@ -314,14 +328,15 @@
[%give %fact ~[/event] %naive-diffs !>(+.tag)]
::
++ get-network
|= =network
|= =net
^- [azimuth=@ux naive=@ux chain-id=@ launch=@]
=< [azimuth naive chain-id launch]
=, azimuth
?- network
?- net
%mainnet mainnet-contracts
%ropsten ropsten-contracts
%local local-contracts
%default contracts
==
::
++ start

Binary file not shown.

View File

@ -1,4 +1,4 @@
:: Change node url and network for azimuth
:- %say
|= [* [url=@ta net=?(%mainnet %ropsten %local) ~] ~]
|= [* [url=@ta net=?(%mainnet %ropsten %local %default) ~] ~]
[%azimuth-poke %watch url net]

View File

@ -78,7 +78,7 @@
:: # constants
::
:: contract addresses
++ contracts ropsten-contracts
++ contracts mainnet-contracts
++ mainnet-contracts
|%
:: azimuth: data contract
@ -99,7 +99,7 @@
0xf790.8ab1.f1e3.52f8.3c5e.bc75.051c.0565.aeae.a5fb
::
++ naive
0x45bc.b745.a1af.e67a.c877.e107.5478.2329.4ba9.0899
0xeb70.029c.fb3c.53c7.78ea.f68c.d28d.e725.390a.1fe9
::
:: launch: block number of azimuth deploy
::

View File

@ -90,7 +90,7 @@
|_ id=@t
:: https://www.jsonrpc.org/specification#error_object
::
++ parse [%error id '-32700' 'Failed to parsed']
++ parse [%error id '-32700' 'Failed to parse']
++ request [%error id '-32600' 'Invalid Request']
++ method [%error id '-32601' 'Method not found']
++ params [%error id '-32602' 'Invalid params']

View File

@ -114,17 +114,17 @@
=, dejs-soft:format
=- (ar (ot id+so result+(ot network+- ~) ~))
%- ot
:~ :- 'rift' ni
:- 'keys' (ot 'life'^ni ~)
:~ :- 'rift' (su dim:ag)
:- 'keys' (ot 'life'^(su dim:ag) ~)
:- 'keys' %+ cu pass-from-eth:azimuth
%- ot
:~ 'crypt'^(cu (lead 32) ni)
'auth'^(cu (lead 32) ni)
'suite'^ni
:~ 'crypt'^(cu (lead 32) (su ;~(pfix (jest '0x') hex)))
'auth'^(cu (lead 32) (su ;~(pfix (jest '0x') hex)))
'suite'^(su dim:ag)
==
==
?~ res
~&([%czar-take-dawn %invalid-json] ~)
~&([%czar-take-dawn %incomplete-json] ~)
:- ~
%+ roll u.res
|= $: [id=@t deet=[=rift =life =pass]]
@ -179,19 +179,19 @@
:- 'network'
%- ot
::TODO dedupe with +czar
:~ 'rift'^ni
'keys'^(ot 'life'^ni ~)
:~ 'rift'^(su dim:ag)
'keys'^(ot 'life'^(su dim:ag) ~)
::
:- 'keys'
%+ cu pass-from-eth:azimuth
%- ot
:~ 'crypt'^(cu (lead 32) ni)
'auth'^(cu (lead 32) ni)
'suite'^ni
:~ 'crypt'^(cu (lead 32) (su ;~(pfix (jest '0x') hex)))
'auth'^(cu (lead 32) (su ;~(pfix (jest '0x') hex)))
'suite'^(su dim:ag)
==
::
::TODO inconsistent @p string
'sponsor'^(ot 'has'^bo 'who'^(su fed:ag) ~)
'sponsor'^(ot 'has'^bo 'who'^ni ~)
::
::TODO escape
::TODO what if escape or sponsor not present? possible?
@ -208,7 +208,7 @@
=/ res=(unit (list @t))
((ot result+(ar so) ~) u.jon)
?~ res
~&([%turf-take-dawn %invalid-response rep] ~)
~&([%turf-take-dawn %invalid-response] ~)
:: remove duplicates, parse into turfs
::
=- `doz

View File

@ -5,7 +5,7 @@
|%
+$ owner [=proxy:naive =address:naive]
+$ owners (jug owner ship)
+$ net ?(%mainnet %ropsten %local)
+$ net ?(%mainnet %ropsten %local %default)
::
+$ config
$% [%frequency frequency=@dr]

View File

@ -208,7 +208,7 @@
app
%poke
%azimuth-poke
!>([%watch (crip (en-purl:html purl))])
!>([%watch (crip (en-purl:html purl)) %default])
==
::
++ sein :: sponsor

View File

@ -88,7 +88,7 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.kno_w = DefaultKernel;
while ( -1 != (ch_i=getopt(argc, argv,
"X:Y:G:J:B:b:K:A:H:I:C:w:u:e:F:k:n:p:r:i:Z:LljacdgqstvxPDRS")) )
"X:Y:G:J:B:b:K:A:H:I:C:w:u:e:E:F:k:n:p:r:i:Z:LljacdgqstvxPDRS")) )
{
switch ( ch_i ) {
case 'X': {
@ -141,6 +141,10 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.eth_c = strdup(optarg);
break;
}
case 'E': {
u3_Host.ops_u.nav_c = strdup(optarg);
break;
}
case 'F': {
u3_Host.ops_u.fak_c = _main_presig(optarg);
u3_Host.ops_u.net = c3n;
@ -445,6 +449,7 @@ u3_ve_usage(c3_i argc, c3_c** argv)
"-D Recompute from events\n",
"-d Daemon mode; implies -t\n",
"-e url Ethereum gateway\n",
"-E url Naive (L2) gateway\n",
"-F ship Fake keys; also disables networking\n",
"-g Set GC flag\n",
"-i jam_file import pier state\n",

View File

@ -278,6 +278,7 @@
c3_o dry; // -D, dry compute, no checkpoint
c3_o dem; // -d, daemon
c3_c* eth_c; // -e, ethereum node url
c3_c* nav_c; // -E, naive node url
c3_c* fak_c; // -F, fake ship
c3_c* gen_c; // -G, czar generator
c3_o gab; // -g, test garbage collection

View File

@ -336,12 +336,9 @@ u3_dawn_vent(u3_noun ship, u3_noun feed)
url = _dawn_purl(rank);
// XX require https?
//TODO make L2 endpoint real
//
c3_c* url_c = ( 0 != u3_Host.ops_u.eth_c ) ?
u3_Host.ops_u.eth_c :
"http://l2.urbit.org:1234";
c3_c* url_c = ( 0 != u3_Host.ops_u.nav_c ) ?
u3_Host.ops_u.nav_c :
"https://roller.urbit.org/v1/azimuth";
{
// +point:azimuth: on-chain state
@ -378,10 +375,6 @@ u3_dawn_vent(u3_noun ship, u3_noun feed)
u3l_log("boot: verifying keys\r\n");
// TODO: remove when L2 is supported
u3l_log("boot: if you're trying to start an L2 ship,"
" upgrade your binary\r\n");
// (each seed (lest error=@tas))
//
sed = u3dq("veri:dawn", u3k(ship), u3k(feed), u3k(pot), u3k(liv));