Merge remote-tracking branch 'origin/philip/roller' into naive/roller

This commit is contained in:
yosoyubik 2021-11-10 18:44:25 +01:00
commit ed2d9bb482
15 changed files with 44 additions and 576 deletions

View File

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

View File

@ -41,6 +41,10 @@ in stdenvNoCC.mkDerivation {
if check && sleep 10 && check; then
header "boot success"
herb ./pier -p hood -d '+hood/exit'
while [ -f ./pier/.vere.lock ]; do
echo "waiting for pier to shut down"
sleep 5
done
else
header "boot failure"
kill $(< ./pier/.vere.lock) || true
@ -49,6 +53,8 @@ in stdenvNoCC.mkDerivation {
'';
installPhase = ''
ls
ls -a ./pier
mv ./pier $out
'';
}

View File

@ -67,6 +67,8 @@
url.state 'http://eth-mainnet.urbit.org:8545'
==
:_ this
?: .^(? %j /(scot %p our.bowl)/fake/(scot %da now.bowl))
~
:~ :* %pass /old-tracker %agent [our.bowl %hood]
%poke %kiln-nuke !>([%azimuth-tracker %|])
==

View File

@ -50,7 +50,7 @@
|=(c=@tD `@tD`?:(=('/' c) '-' c))
=/ sing=card
:+ %pass /build/mar/[mak]
[%arvo %c %warp our.bowl %home ~ %sing %b da+now.bowl /[mak]]
[%arvo %c %warp our.bowl q.byk.bowl ~ %sing %b da+now.bowl /[mak]]
%_ $
paz t.paz
fex [sing fex]
@ -72,7 +72,7 @@
$(daz t.daz)
=/ sing=card
:+ %pass /build/app/[i.daz]
[%arvo %c %warp our.bowl %home ~ %sing %a da+now.bowl dap-pax]
[%arvo %c %warp our.bowl q.byk.bowl ~ %sing %a da+now.bowl dap-pax]
%_ $
daz t.daz
fex [sing fex]
@ -92,7 +92,7 @@
$(paz t.paz)
=/ sing=card
:+ %pass build+i.paz
[%arvo %c %warp our.bowl %home ~ %sing %a da+now.bowl i.paz]
[%arvo %c %warp our.bowl q.byk.bowl ~ %sing %a da+now.bowl i.paz]
%_ $
paz t.paz
fex [sing fex]

View File

@ -1,30 +0,0 @@
/- ms=metadata-store
/+ crunch
:- %say
|= [[now=@da * bec=beak] [csv-path=path from=@da ~] [to=@da groups=(list path) content=(unit ?) ~]]
=/ our=@p p.bec
:: check given path has `csv` mark
::
?> =(%csv (snag (dec (lent csv-path)) csv-path))
:: get all graph associations ship is a part of
::
=/ associations=associations:ms
(~(scry-graph-associations crunch [our now]))
:: filter by input groups, if any (default: all from scry)
::
=/ filtered-associations=associations:ms
?~ groups
associations
%+ filter-associations-by-group-resources.crunch
associations
(paths-to-resources.crunch groups)
:: walk graphs to extract content
::
=/ file-content=wain
%: ~(walk-graph-associations crunch [our now])
filtered-associations
?~ content %.n u.content
from
?: =(*@da to) now to
==
[%helm-pass (note-write-csv-to-clay.crunch csv-path file-content)]

View File

@ -10,8 +10,9 @@
|= $: [now=@da eny=@uvJ bec=beak]
[arg=[@ $@(~ [@ ~])] ~]
==
:- %drum-start
?> ((sane %tas) -.arg)
?@ +.arg [q.bec -.arg]
?> ((sane %tas) +<.arg)
[-.arg +<.arg]
=/ [des=@tas dap=@tas]
?> ((sane %tas) -.arg)
?@ +.arg [q.bec -.arg]
?> ((sane %tas) +<.arg)
[-.arg +<.arg]
[%kiln-rein des & [dap ~ ~] ~]

View File

@ -1,4 +1,3 @@
/- *bill
:- %say
|= $: [now=@da eny=@uvJ bec=beak]
[=desk ~]
@ -11,5 +10,5 @@
:~ 'sys.kelvin:'
leaf/"[%{<lal>} %{<num>}]"
'desk.bill:'
(sell !>(.^(bill cx+(weld pax /desk/bill))))
(sell !>(.^((list dude:gall) cx+(weld pax /desk/bill))))
==

View File

@ -42,7 +42,7 @@
^- @t
=/ account (hex-to-num:eth '0xb026b0AA6e686F2386051b31A03E5fB95513e1c0')
=/ tx=octs
(take-ship-address:bits:l2:tt %set-spawn-proxy ~ravmun-mitbus %own account)
(gen-tx-octs:tt [~ravmun-mitbus %own] %set-spawn-proxy account)
=/ prepped=octs (prepare-for-sig:tt 3 0 tx)
?~ sig
(cat 3 'sign: ' (print-for-web3 prepped))

View File

@ -1,356 +0,0 @@
/- c=crunch, gs=graph-store, ms=metadata-store, p=post, r=resource
::
=<
|_ [our=ship now=@da]
++ walk-graph-associations
|= [=associations:ms content=? from=@da to=@da]
^- wain
:: graph resources in `our`; used to avoid scrying, e.g.,
:: a graph `our` has left and can no longer access
::
=/ accessible-graphs=(set resource:r) (scry-graph-resources)
%- ~(rep by associations)
|= [[=md-resource:ms =association:ms] out=wain]
^- wain
?. ?=(%graph app-name.md-resource)
out
?. ?=(%graph -.config.metadatum.association)
out
:: ensure graph, given by association, exists in `our`
::
?. (~(has in accessible-graphs) resource.md-resource)
out
:: scry the graph
::
=/ graph=(unit graph:gs) (scry-graph resource.md-resource)
?~ graph
out
:: prepare channel-info argument
::
=/ channel-info=channel-info:c
:* group.association
resource.md-resource
module.config.metadatum.association
==
:: walk the graph
::
?+ module.config.metadatum.association
:: non-chat (e.g. links & notes)
::
%+ weld out
%: walk-nested-graph-for-most-recent-entries
u.graph
content
channel-info
from
to
==
::
%chat
%+ weld out
%: walk-chat-graph
u.graph
content
channel-info
from
to
==
==
::
++ scry-graph
|= graph-resource=resource:r
^- (unit graph:gs)
=/ scry-response=update:gs
.^ update:gs
%gx
(scot %p our)
%graph-store
(scot %da now)
%graph
(scot %p entity.graph-resource)
name.graph-resource
/noun
==
?. ?=(%add-graph -.q.scry-response)
~
?~ graph.q.scry-response
~
[~ graph.q.scry-response]
::
++ scry-graph-resources
|= ~
^- (set resource:r)
=/ scry-response=update:gs
.^ update:gs
%gx
(scot %p our)
%graph-store
(scot %da now)
/keys/noun
==
?. ?=(%keys -.q.scry-response)
~
resources.q.scry-response
:: helper arm for callers to get graph associations
:: to pass to `walk-graph-associations`
::
++ scry-graph-associations
|= ~
^- associations:ms
.^ associations:ms
%gx
(scot %p our)
%metadata-store
(scot %da now)
/app-name/graph/noun
==
--
::
|%
::
:: parsing and formatting
::
++ resource-to-cord
|= =resource:r
^- @t
(rap 3 (scot %p entity.resource) '/' (scot %tas name.resource) ~)
::
++ paths-to-resources
|= paxs=(list path)
^- (set resource:r)
%- ~(gas in *(set resource:r))
(turn paxs path-to-resource)
::
++ path-to-resource
|= pax=path
^- resource:r
=/ entity=@p (slav %p -.pax)
=/ name=@tas -.+.pax
[entity name]
::
++ escape-characters-in-cord
|= =cord
^- @t
%- crip
%- mesc
:: specific to CSVs: make sure content does not
:: contain commas (only allowed as delimiters)
::
%- replace-tape-commas-with-semicolons
%- trip
cord
::
++ replace-tape-commas-with-semicolons
|= string=tape
^- tape
=/ comma-indices=(list @ud) (fand "," string)
|-
^- tape
?~ comma-indices
string
$(string (snap string i.comma-indices ';'), comma-indices t.comma-indices)
::
++ contents-to-cord
|= contents=(list content:p)
^- @t
?~ contents
''
%+ join-cords
' '
(turn contents content-to-cord)
::
++ content-to-cord
|= =content:p
^- @t
?- -.content
%text (escape-characters-in-cord text.content)
%mention (scot %p ship.content)
%url url.content
%code expression.content :: TODO: also print output?
%reference (reference-content-to-cord reference.content)
==
::
++ reference-content-to-cord
|= =reference:p
^- @t
?- -.reference
%group (resource-to-cord group.reference)
%graph (rap 3 (resource-to-cord group.reference) ': ' (resource-to-cord resource.uid.reference) ~)
==
::
++ format-post-to-comma-separated-cord
|= [=post:gs =channel-info:c]
^- @t
%+ join-cords
','
:~ (scot %da time-sent.post)
(scot %p author.post)
(resource-to-cord group.channel-info)
(resource-to-cord channel.channel-info)
(scot %tas channel-type.channel-info)
:: exclude content; optionally add later
::
==
::
++ join-cords
|= [delimiter=@t cords=(list @t)]
^- @t
%+ roll cords
|= [cord=@t out=@t]
^- @t
?: =('' out)
:: don't put delimiter before first element
::
cord
(rap 3 out delimiter cord ~)
::
:: walking graphs
::
++ walk-chat-graph
|= [=graph:gs content=? =channel-info:c from=@da to=@da]
^- wain
%- flop
%+ roll
:: filter by time
::
%+ only-nodes-older-than to
%+ only-nodes-newer-than from
~(val by graph)
|= [=node:gs out=wain]
^- wain
?- -.post.node
%|
:: do not output deleted posts
::
out
%&
?~ contents.p.post.node
:: do not output structural nodes
::
out
:_ out
=/ post-no-content=@t (format-post-to-comma-separated-cord p.post.node channel-info)
?- content
%| post-no-content
%&
%+ join-cords ','
~[post-no-content (contents-to-cord contents.p.post.node)]
==
==
::
++ walk-nested-graph-for-most-recent-entries
|= [=graph:gs content=? =channel-info:c from=@da to=@da]
^- wain
=| out=wain
=| most-recent-post-content=@t
=/ nodes
:: filter by time
::
%+ only-nodes-older-than to
%+ only-nodes-newer-than from
~(val by graph)
%- flop
|-
^- wain
?~ nodes
?: =('' most-recent-post-content)
:: don't return a cell: `['' ~]`
:: we want either an empty list `~`
:: or a list populated with actual entries
::
out
[most-recent-post-content out]
::
=? out ?=(%graph -.children.i.nodes)
%+ weld out
%: walk-nested-graph-for-most-recent-entries
p.children.i.nodes
content
channel-info
from
to
==
::
?- -.post.i.nodes
%|
:: do not keep deleted posts
::
$(nodes t.nodes)
%&
?~ contents.p.post.i.nodes
:: do not keep structural nodes
::
$(nodes t.nodes)
=/ post-no-content=@t (format-post-to-comma-separated-cord p.post.i.nodes channel-info)
%= $
nodes t.nodes
most-recent-post-content
?- content
%| post-no-content
%&
%+ join-cords ','
~[post-no-content (contents-to-cord contents.p.post.i.nodes)]
==
==
==
::
:: filters
::
++ filter-associations-by-group-resources
|= [=associations:ms group-resources=(set resource:r)]
^- associations:ms
%- ~(rep by associations)
|= [[=md-resource:ms =association:ms] out=associations:ms]
^- associations:ms
?. (~(has in group-resources) group.association)
out
(~(put by out) md-resource association)
:: wrappers for intuitive use of `filter-nodes-by-timestamp`:
:: pass `nodes` as given by the `graph-store` scry and no
:: need to worry about comparators
::
++ only-nodes-older-than
|= [time=@da nodes=(list node:gs)]
(filter-nodes-by-timestamp nodes lte time)
::
++ only-nodes-newer-than
|= [time=@da nodes=(list node:gs)]
%- flop
(filter-nodes-by-timestamp (flop nodes) gte time)
::
++ filter-nodes-by-timestamp
|= [nodes=(list node:gs) comparator=$-([@ @] ?) time=@da]
=| out=(list node:gs)
:: return `out` in same time-order as `nodes`
::
%- flop
|-
^- (list node:gs)
?~ nodes
out
?- -.post.i.nodes
%|
:: skip deleted posts
::
$(nodes t.nodes)
%&
?. (comparator time-sent.p.post.i.nodes time)
:: assume:
:: * time is monotonic
:: * first `%.n` we hit indicates nodes further on are `%.n`
:: (i.e. `nodes` must be ordered st. they start `%.y`,
:: e.g. if want all `nodes` older than given time,
:: `nodes` must start with oldest and comparator is `lth`)
::
out
$(nodes t.nodes, out [i.nodes out])
==
::
:: io
::
++ note-write-csv-to-clay
|= [pax=path file-content=wain]
?> =(%csv (snag (dec (lent pax)) pax))
[%c [%info %base %& [pax %ins %csv !>(file-content)]~]]
::
--

View File

@ -409,8 +409,7 @@
==
take-commit:(abed:vats %base)
=? kiln ?=(^ wef)
=/ except=(set desk) (sy %base %kids ~)
(bump:vats u.wef except force=%.n)
(bump:vats u.wef (get-unblockers ark.old) force=%.n)
=. wef ~
abet:kiln
::
@ -605,7 +604,7 @@
vats
~> %slog.(fmt "{<lac>} pausing updates")
=/ rel ral
=. rail.rak `rel(paused &, aeon 0)
=. rail.rak `rel(paused &, aeon 0, next ~)
vats
::
:: +gall-lyv: watch gall source for reloading
@ -919,7 +918,7 @@
?~ rail.rak zuse/zuse
?~ next.u.rail.rak zuse/zuse
weft.i.next.u.rail.rak
(bump-many kel (all-desks-but (sy %base ~)))
(bump-many kel (all-desks-but (get-unblockers ark)))
::
++ take-merge-main
|= syn=sign-arvo
@ -1034,6 +1033,19 @@
?: (lien next.u.rail.arak |=([* k=weft] =(k kel)))
~
`desk
:: +get-unblockers: find desks which shouldn't block a kernel upgrade
::
++ get-unblockers
|= ark=(map desk arak)
=/ base=(set desk) (sy %base %kids ~)
%- ~(gas in base)
%+ murn ~(tap by ark)
|= [loc=desk ark=arak]
^- (unit desk)
?. liv.rein.ark `loc
?~ rail.ark `loc
?: paused.u.rail.ark `loc
~
:: +get-germ: select merge strategy into local desk
::
:: If destination desk doesn't exist, need a %init merge. If this is

View File

@ -1,15 +0,0 @@
=, format
=, mimes:html
|_ csv=wain
::
++ grab :: convert from
|%
++ mime |=((pair mite octs) (to-wain q.q))
++ noun wain :: clam from %noun
--
++ grow
|%
++ mime [/text/csv (as-octs (of-wain csv))]
--
++ grad %mime
--

View File

@ -1,9 +0,0 @@
/- resource
::
|%
+$ channel-info
$: group=resource:resource
channel=resource:resource
channel-type=term
==
--

View File

@ -1098,6 +1098,12 @@
=/ sec (~(got by jaw.own.pki.lex) lyf.own.pki.lex)
=/ sal (add %pass step.own.pki.lex)
``[%noun !>((end 6 (shaf sal (shax sec))))]
::
%fake
?. ?=(~ tyl) [~ ~]
?. =([%& our] why)
[~ ~]
``[%noun !>(fak.own.pki.lex)]
::
%life
?. ?=([@ ~] tyl) [~ ~]

View File

@ -29,15 +29,6 @@
%+ weld "0x"
(render-hex-bytes:ethereum 20 `@`azimuth:contracts:^azimuth)
::
++ test-give-bloq
=/ oct
%- as-octs:mimes:html
'{"params":[],"id":"0","jsonrpc":"2.0","method":"eth_blockNumber"}'
%+ expect-eq
!> oct
!> bloq:give:dawn
:: this produces a 1000+ line payload, so we just check that it doesn't crash
::
++ test-give-czar
=/ zar czar:give:dawn
~! zar
@ -45,146 +36,6 @@
!> &
!> ?=(^ zar)
::
++ test-give-point
=/ oct
%- as-octs:mimes:html
%+ rap 3
:~ '{"params":[{"to":"' azimuth '","data":"'
'0x63fa9a87'
'0000000000000000000000000000000000000000000000000000000000000000'
'"},"0x0"],"id":"0","jsonrpc":"2.0","method":"eth_call"}'
==
%+ expect-eq
!> oct
!> (point:give:dawn 0 ~zod)
::
++ test-give-turf
=/ oct
%- as-octs:mimes:html
%+ rap 3
:~ '[{"params":[{"to":"' azimuth '","data":"'
'0xeccc8ff1'
'0000000000000000000000000000000000000000000000000000000000000000'
'"},"0x0"],"id":"turf-0","jsonrpc":"2.0","method":"eth_call"},'
'{"params":[{"to":"' azimuth '","data":"'
'0xeccc8ff1'
'0000000000000000000000000000000000000000000000000000000000000001'
'"},"0x0"],"id":"turf-1","jsonrpc":"2.0","method":"eth_call"},'
'{"params":[{"to":"' azimuth '","data":"'
'0xeccc8ff1'
'0000000000000000000000000000000000000000000000000000000000000002'
'"},"0x0"],"id":"turf-2","jsonrpc":"2.0","method":"eth_call"}]'
==
%+ expect-eq
!> oct
!> (turf:give:dawn 0)
::
++ test-take-bloq
=/ oct
%- as-octs:mimes:html
'{"id":"0","jsonrpc":"2.0","result":"0x20"}'
=/ boq 32
%+ expect-eq
!> [~ boq]
!> (bloq:take:dawn oct)
::
++ test-take-czar
=/ oct
%- as-octs:mimes:html
%+ rap 3
:~ '[{"id":"gal-0","jsonrpc":"2.0","result":"'
'0xb69b6818b17b7cc22f8e0a2291f58e4aa840cbf44cb2f1c94dc3d71e3cda0d94'
'3defb87516f42ce4327820b588002aa53e52527af8d23bee4aa215fa296bdf5f'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000002'
'"},{"id":"gal-1","jsonrpc":"2.0","result":"'
'0xb727e38d031162e50913b2e37a2e29d4ba457eff4f7fd4ac47dc68fcb54260d3'
'b8bfe4789483c171f7fa359438cdcc8d268d40fe08d6c1d8b36267748d2139f8'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000003'
'"},{"id":"gal-2","jsonrpc":"2.0","result":"'
'0x0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000004'
'"}]'
==
=/ kyz
^- [zod=pass nec=pass]
:- 2.448.360.348.730.164.860.814.441.775.703.143.856.915.192.920.639.124.
529.297.987.279.849.833.790.775.864.413.949.853.880.667.744.188.597.545.
066.664.466.963.044.328.182.155.965.137.512.758.548.384.637.214.562
::
2.455.718.000.840.284.920.492.237.722.671.938.413.341.955.411.945.312.
638.361.167.187.097.711.481.986.932.531.569.955.478.938.087.263.286.158.
823.313.739.767.009.446.819.531.923.255.637.798.148.055.143.938.146
%+ expect-eq
!> :- ~
%- ~(gas by *(map ship [=rift =life =pass]))
[[~zod 2 1 zod.kyz] [~nec 3 1 nec.kyz] [~bud 4 1 'b'] ~]
!> (czar:take:dawn oct)
::
++ test-take-point
=/ oct
%- as-octs:mimes:html
%+ rap 3
:~ '{"jsonrpc":"2.0","result":"'
'0xb69b6818b17b7cc22f8e0a2291f58e4aa840cbf44cb2f1c94dc3d71e3cda0d94'
'3defb87516f42ce4327820b588002aa53e52527af8d23bee4aa215fa296bdf5f'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000000'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000001'
'0000000000000000000000000000000000000000000000000000000000000000'
'"}'
==
%+ expect-eq
!> [~ pot]
!> (point:take:dawn ~zod oct)
::
++ test-take-turf
=/ oct
%- as-octs:mimes:html
%+ rap 3
:~ '[{"id":"turf-0","jsonrpc":"2.0","result":"'
'0x0000000000000000000000000000000000000000000000000000000000000020'
'0000000000000000000000000000000000000000000000000000000000000009'
'75726269742e6f72670000000000000000000000000000000000000000000000'
'"},{"id":"turf-1","jsonrpc":"2.0","result":"'
'0x0000000000000000000000000000000000000000000000000000000000000020'
'0000000000000000000000000000000000000000000000000000000000000009'
'75726269742e6f72670000000000000000000000000000000000000000000000'
'"},{"id":"turf-2","jsonrpc":"2.0","result":"'
'0x0000000000000000000000000000000000000000000000000000000000000020'
'0000000000000000000000000000000000000000000000000000000000000009'
'75726269742e6f72670000000000000000000000000000000000000000000000'
'"}]'
==
%+ expect-eq
!> [~ [/org/urbit ~]]
!> (turf:take:dawn oct)
::
++ test-veri-good
=/ sed [~zod 1 sec ~]
%+ expect-eq

View File

@ -225,6 +225,7 @@
++ get-apps-want
|= [duz=(list dude) =rein]
^- (list dude)
?. liv.rein ~
=. duz (skip duz ~(has in sub.rein))
=. duz (weld duz (skip ~(tap in add.rein) ~(has in (sy duz))))
duz