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 version https://git-lfs.github.com/spec/v1
oid sha256:e6e3c7c0274352d2cfba2a9f2b3382cdeab0e0fb97455b42293a214561d177ee oid sha256:f59ec4eaf907227a1fd64e1d54810b769b5d39f6811c6bb254b2e89de528ca04
size 1101949 size 1209494

View File

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

View File

@ -6,10 +6,16 @@
default-agent, default-agent,
verb, verb,
dbug 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 /* snap %eth-logs /app/azimuth/logs/eth-logs
:: ::
=/ last-snap :: maybe just use the last one? =/ 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] |= [log=event-log:rpc:ethereum last=@ud]
?~ mined.log ?~ mined.log
last last
@ -24,7 +30,7 @@
+$ app-state +$ app-state
$: %0 $: %0
url=@ta url=@ta
net=network =net
whos=(set ship) whos=(set ship)
nas=^state:naive nas=^state:naive
own=owners own=owners
@ -37,11 +43,10 @@
[%listen whos=(list ship) =source:jael] [%listen whos=(list ship) =source:jael]
:: %watch: configure node url and network :: %watch: configure node url and network
:: ::
[%watch url=@ta net=network] [%watch url=@ta =net]
== ==
:: ::
+$ tagged-diff [=id:block diff:naive] +$ tagged-diff [=id:block diff:naive]
+$ network ?(%mainnet %ropsten %local)
+$ card card:agent:gall +$ card card:agent:gall
:: TODO: add to state? :: TODO: add to state?
:: ::
@ -117,9 +122,12 @@
net.state net.poke net.state net.poke
url.state url.poke url.state url.poke
own.state ~ 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 ++ on-watch
@ -138,7 +146,13 @@
~ ~
(~(put in whos.state) u.who) (~(put in whos.state) u.who)
^- (quip card _this) ^- (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-leave on-leave:def
++ on-peek ++ on-peek
@ -291,7 +305,7 @@
++ jael-update ++ jael-update
|= =udiffs:point |= =udiffs:point
^- (list card) ^- (list card)
?: & ~ :: XX :: ?: & ~ :: XX
:- [%give %fact ~[/] %azimuth-udiffs !>(udiffs)] :- [%give %fact ~[/] %azimuth-udiffs !>(udiffs)]
|- ^- (list card) |- ^- (list card)
?~ udiffs ?~ udiffs
@ -314,14 +328,15 @@
[%give %fact ~[/event] %naive-diffs !>(+.tag)] [%give %fact ~[/event] %naive-diffs !>(+.tag)]
:: ::
++ get-network ++ get-network
|= =network |= =net
^- [azimuth=@ux naive=@ux chain-id=@ launch=@] ^- [azimuth=@ux naive=@ux chain-id=@ launch=@]
=< [azimuth naive chain-id launch] =< [azimuth naive chain-id launch]
=, azimuth =, azimuth
?- network ?- net
%mainnet mainnet-contracts %mainnet mainnet-contracts
%ropsten ropsten-contracts %ropsten ropsten-contracts
%local local-contracts %local local-contracts
%default contracts
== ==
:: ::
++ start ++ start

Binary file not shown.

View File

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

View File

@ -78,7 +78,7 @@
:: # constants :: # constants
:: ::
:: contract addresses :: contract addresses
++ contracts ropsten-contracts ++ contracts mainnet-contracts
++ mainnet-contracts ++ mainnet-contracts
|% |%
:: azimuth: data contract :: azimuth: data contract
@ -99,7 +99,7 @@
0xf790.8ab1.f1e3.52f8.3c5e.bc75.051c.0565.aeae.a5fb 0xf790.8ab1.f1e3.52f8.3c5e.bc75.051c.0565.aeae.a5fb
:: ::
++ naive ++ 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 :: launch: block number of azimuth deploy
:: ::

View File

@ -90,7 +90,7 @@
|_ id=@t |_ id=@t
:: https://www.jsonrpc.org/specification#error_object :: 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'] ++ request [%error id '-32600' 'Invalid Request']
++ method [%error id '-32601' 'Method not found'] ++ method [%error id '-32601' 'Method not found']
++ params [%error id '-32602' 'Invalid params'] ++ params [%error id '-32602' 'Invalid params']

View File

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

View File

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

View File

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

View File

@ -12,10 +12,10 @@
=+ !<([~ pup=watchpup] args) =+ !<([~ pup=watchpup] args)
=/ m (strand:strandio ,vase) =/ m (strand:strandio ,vase)
^- form:m ^- form:m
;< =latest=block bind:m (get-latest-block:ethio url.pup) ;< =latest=block bind:m (get-latest-block:ethio url.pup)
;< pup=watchpup bind:m (zoom pup number.id.latest-block) ;< pup=watchpup bind:m (zoom pup number.id.latest-block)
=| vows=disavows =| vows=disavows
;< pup=watchpup bind:m (fetch-batches pup) ;< pup=watchpup bind:m (fetch-batches pup)
::?. eager.pup ::?. eager.pup
(pure:m !>([vows pup])) (pure:m !>([vows pup]))
:: |- ^- form:m :: |- ^- form:m

View File

@ -88,7 +88,7 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.kno_w = DefaultKernel; u3_Host.ops_u.kno_w = DefaultKernel;
while ( -1 != (ch_i=getopt(argc, argv, 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 ) { switch ( ch_i ) {
case 'X': { case 'X': {
@ -141,6 +141,10 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.eth_c = strdup(optarg); u3_Host.ops_u.eth_c = strdup(optarg);
break; break;
} }
case 'E': {
u3_Host.ops_u.nav_c = strdup(optarg);
break;
}
case 'F': { case 'F': {
u3_Host.ops_u.fak_c = _main_presig(optarg); u3_Host.ops_u.fak_c = _main_presig(optarg);
u3_Host.ops_u.net = c3n; 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 Recompute from events\n",
"-d Daemon mode; implies -t\n", "-d Daemon mode; implies -t\n",
"-e url Ethereum gateway\n", "-e url Ethereum gateway\n",
"-E url Naive (L2) gateway\n",
"-F ship Fake keys; also disables networking\n", "-F ship Fake keys; also disables networking\n",
"-g Set GC flag\n", "-g Set GC flag\n",
"-i jam_file import pier state\n", "-i jam_file import pier state\n",

View File

@ -278,6 +278,7 @@
c3_o dry; // -D, dry compute, no checkpoint c3_o dry; // -D, dry compute, no checkpoint
c3_o dem; // -d, daemon c3_o dem; // -d, daemon
c3_c* eth_c; // -e, ethereum node url 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* fak_c; // -F, fake ship
c3_c* gen_c; // -G, czar generator c3_c* gen_c; // -G, czar generator
c3_o gab; // -g, test garbage collection 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); url = _dawn_purl(rank);
// XX require https? c3_c* url_c = ( 0 != u3_Host.ops_u.nav_c ) ?
//TODO make L2 endpoint real u3_Host.ops_u.nav_c :
// "https://roller.urbit.org/v1/azimuth";
c3_c* url_c = ( 0 != u3_Host.ops_u.eth_c ) ?
u3_Host.ops_u.eth_c :
"http://l2.urbit.org:1234";
{ {
// +point:azimuth: on-chain state // +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"); 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)) // (each seed (lest error=@tas))
// //
sed = u3dq("veri:dawn", u3k(ship), u3k(feed), u3k(pot), u3k(liv)); sed = u3dq("veri:dawn", u3k(ship), u3k(feed), u3k(pot), u3k(liv));