diff --git a/MAINTAINERS.md b/MAINTAINERS.md index a34bda9757..e290b1b453 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -119,7 +119,7 @@ the network. Take [this PR][1], as an example. This constituted a great hotfix. It's a single commit, targeting a problem that existed on the network at the time. -Here's it should be released and deployed OTA. +Here's how it should be released and deployed OTA. [1]: https://github.com/urbit/urbit/pull/2025 @@ -159,15 +159,31 @@ so that I can type e.g. `git mu origin/foo 1337`. ### Prepare a release commit -You should create Landscape or alternative pill builds, if or as appropriate -(i.e., if anything in Landscape changed -- don't trust any compiled JS/CSS -that's included in the commit), and commit these in a release commit. - -You should always create a solid pill, in particular, as it's convenient for -tooling to be able to boot directly from a given release. - If you're making a Vere release, just play it safe and update all the pills. +For an Urbit OS release, after all the merge commits, make a release with the +commit message "release: urbit-os-v1.0.xx". This commit should have up-to-date +artifacts from pkg/interface and a new solid pill. If neither the pill nor the +JS need to be updated (e.g if the pill was already updated in the previous merge +commit), consider making the release commit with --allow-empty. + +If anything in `pkg/interface` has changed, ensure it has been built and +deployed properly. You'll want to do this before making a pill, since you want +the pill to have the new files/hash. For most things, it is sufficient to run +`npm install; npm run build:prod` in `pkg/interface`. + +However, if you've made a change to Landscape's JS, then you will need to build +a "glob" and upload it to bootstrap.urbit.org. To do this, run `npm install; +npm run build:prod` in `pkg/interface`, and add the resulting +`pkg/arvo/app/landscape/index.js` to a fakezod at that path (or just create a +new fakezod with `urbit -F zod -B bin/solid.pill -A pkg/arvo`). Run +`:glob|make`, and this will output a file in `fakezod/.urb/put/glob-0vXXX.glob`. + +Upload this file to bootstrap.urbit.org, and modify `+hash` at the top of +`pkg/arvo/app/glob.hoon` to match the hash in the filename. Do not commit the +produced `index.js` and make sure it doesn't end up in your pills (they should +be less than 10MB each). + ### Tag the resulting commit What you should do here depends on the type of release being made. @@ -205,7 +221,7 @@ You can get the "contributions" section by the shortlog between the last release and this release: ``` -git log --pretty=short LAST_RELEASE.. | git shortlog +git shortlog LAST_RELEASE.. ``` I originally tried to curate this list somewhat, but now just paste it diff --git a/README.md b/README.md index 5dd5ace5e8..c5018a871e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Urbit uses [Nix][nix] to manage builds. On Linux and macOS you can install Nix via: ``` -curl https://nixos.org/nix/install | sh +curl -L https://nixos.org/nix/install | sh ``` The Makefile in the project's root directory contains useful phony targets for diff --git a/bin/brass.pill b/bin/brass.pill index 72a256ae6b..cc8c83ed8b 100644 --- a/bin/brass.pill +++ b/bin/brass.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:29a948ebcf5d82577b3d1271cb8d0c6cf1fa8b63a324ad2ef43e73ad5dcfe62c -size 4846052 +oid sha256:f738f60e9e028081864f317106f623d2f21a5fe5c2f6fdd83576e22d21a8c6a6 +size 14862847 diff --git a/bin/ivory.pill b/bin/ivory.pill index 3bdc23eabc..829304a932 100644 --- a/bin/ivory.pill +++ b/bin/ivory.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c9cec5d3dd639a82b1b867375225e6becb9f234338ef0a4cb2626ae72ba8944 -size 1265620 +oid sha256:9fbfbe75a6685df444621ebd27677716fd0abf7113020f3274c3b5c209e3616e +size 1304972 diff --git a/bin/solid.pill b/bin/solid.pill index 3ada6c01d4..e56fe36f0d 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f41c00b072d8b4a8e18908b038f65602e698b92d02846f44d463c4f3d425680c -size 7313574 +oid sha256:463039d83a55c7a560101bda1614a6501ef8b0cc91144588cb372f36d1b42486 +size 6259468 diff --git a/nix/ops/boot-ship.nix b/nix/ops/boot-ship.nix index ef78c294d8..2fb2ba2e79 100644 --- a/nix/ops/boot-ship.nix +++ b/nix/ops/boot-ship.nix @@ -10,9 +10,10 @@ let tlon = import ../pkgs { inherit pkgs; }; arvo = tlon.arvo; urbit = tlon.urbit; + herb = tlon.herb; in import ./fakeship { - inherit pkgs tlon deps arvo pill ship debug; + inherit pkgs arvo pill ship herb urbit; } diff --git a/nix/ops/test/builder.sh b/nix/ops/test/builder.sh index 4a852ab3f5..2746797abf 100644 --- a/nix/ops/test/builder.sh +++ b/nix/ops/test/builder.sh @@ -22,50 +22,59 @@ trap shutdown EXIT herb ./ship -p hood -d '+hood/mass' -# Start the test app +# Run the unit tests and then print scrollback +herb ./ship -d '~& ~ ~& %test-unit-start ~' +herb ./ship -d '####-test %/tests' +herb ./ship -d '~& ~ ~& %test-unit-end ~' + +# Start and run the test app herb ./ship -p hood -d '+hood/start %test' -# Run the %cores tests -herb ./ship -d '~& ~ ~& %start-test-cores ~' -herb ./ship -p test -d ':- %cores /' -herb ./ship -d '~& %finish-test-cores ~' +herb ./ship -d '~& ~ ~& %test-agents-start ~' +herb ./ship -p test -d '%agents' +herb ./ship -d '~& ~ ~& %test-agents-end ~' +herb ./ship -d '~& ~ ~& %test-generators-start ~' +herb ./ship -p test -d '%generators' +herb ./ship -d '~& ~ ~& %test-generators-end ~' + +herb ./ship -d '~& ~ ~& %test-marks-start ~' +herb ./ship -p test -d '%marks' +herb ./ship -d '~& ~ ~& %test-marks-end ~' + +# compact the loom, comparing memory use before and after herb ./ship -p hood -d '+hood/mass' -# Run the %renders tests -herb ./ship -d '~& ~ ~& %start-test-renders ~' -herb ./ship -p test -d ':- %renders /' -herb ./ship -d '~& %finish-test-renders ~' - -# Run the test generator -herb ./ship -d '+test, =seed `@uvI`(shaz %reproducible)' > test-generator-output - -cat test-generator-output || true - -herb ./ship -p hood -d '+hood/mass' - -herb ./ship -d '~& ~ ~& %start-pack ~' +herb ./ship -d '~& ~ ~& %pack-start ~' herb ./ship -p hood -d '+hood/pack' -herb ./ship -d '~& ~ ~& %finish-pack ~' +herb ./ship -d '~& ~ ~& %pack-end ~' + +herb ./ship -p hood -d '+hood/mass' shutdown # Collect output -cp urbit-output test-cores-output -cp urbit-output test-renders-output +cp urbit-output test-output-unit +cp urbit-output test-output-agents +cp urbit-output test-output-generators +cp urbit-output test-output-marks rm urbit-output -sed -i '0,/start-test-renders/d' test-renders-output -sed -i '/finish-test-renders/,$d' test-renders-output +sed -i '0,/test-unit-start/d' test-output-unit +sed -i '/test-unit-end/,$d' test-output-unit -sed -i '0,/start-test-cores/d' test-cores-output -sed -i '/finish-test-cores/,$d' test-cores-output +sed -i '0,/test-agents-start/d' test-output-agents +sed -i '/test-agents-end/,$d' test-output-agents + +sed -i '0,/test-generators-start/d' test-output-generators +sed -i '/test-generators-end/,$d' test-output-generators + +sed -i '0,/test-marks-start/d' test-output-marks +sed -i '/test-marks-end/,$d' test-output-marks mkdir $out -cp test-renders-output $out/renders -cp test-cores-output $out/cores -cp test-generator-output $out/generator +cp -r test-output-* $out/ set +x diff --git a/pkg/arvo/app/aqua.hoon b/pkg/arvo/app/aqua.hoon index b10b9556a0..748a2ee2f5 100644 --- a/pkg/arvo/app/aqua.hoon +++ b/pkg/arvo/app/aqua.hoon @@ -163,7 +163,9 @@ $ =. snap +.p.poke-result =. ..abet-pe (publish-event tym ue) - =. ..abet-pe (handle-effects ((list ovum) -.p.poke-result)) + =. ..abet-pe + ~| ova=-.p.poke-result + (handle-effects ;;((list ovum) -.p.poke-result)) $ :: :: Peek @@ -380,13 +382,12 @@ %c %clay %d %dill %e %eyre - %f %ford %g %gall %j %jael %g %gall == =/ pax - /(scot %p our.hid)/home/(scot %da now.hid)/sys/vane/[vane] + /(scot %p our.hid)/work/(scot %da now.hid)/sys/vane/[vane] =/ txt .^(@ %cx (weld pax /hoon)) [/vane/[vane] [%veer v pax txt]] => .(this ^+(this this)) @@ -400,7 +401,7 @@ :_ ~ %- unix-event %- %*(. file-ovum:pill-lib directories slim-dirs) - /(scot %p our.hid)/home/(scot %da now.hid) + /(scot %p our.hid)/work/(scot %da now.hid) =^ ms all-state (poke-pill pil) (emit-cards ms) :: diff --git a/pkg/arvo/app/chat-cli.hoon b/pkg/arvo/app/chat-cli.hoon index 20065b4843..005f9b8f31 100644 --- a/pkg/arvo/app/chat-cli.hoon +++ b/pkg/arvo/app/chat-cli.hoon @@ -451,6 +451,7 @@ :: ++ parser |^ + %+ stag | %+ knee *command |. ~+ =- ;~(pose ;~(pfix mic -) message) ;~ pose @@ -646,24 +647,24 @@ ++ tab-list ^- (list [@t tank]) :~ - [%join leaf+";join ~ship/chat-name (glyph)"] - [%leave leaf+";leave ~ship/chat-name"] + [';join' leaf+";join ~ship/chat-name (glyph)"] + [';leave' leaf+";leave ~ship/chat-name"] :: - [%create leaf+";create [type] /chat-name (glyph)"] - [%delete leaf+";delete /chat-name"] - [%invite leaf+";invite /chat-name ~ships"] - [%banish leaf+";banish /chat-name ~ships"] + [';create' leaf+";create [type] /chat-name (glyph)"] + [';delete' leaf+";delete /chat-name"] + [';invite' leaf+";invite /chat-name ~ships"] + [';banish' leaf+";banish /chat-name ~ships"] :: - [%bind leaf+";bind [glyph] ~ship/chat-name"] - [%unbind leaf+";unbind [glyph]"] - [%what leaf+";what (~ship/chat-name) (glyph)"] + [';bind' leaf+";bind [glyph] ~ship/chat-name"] + [';unbind' leaf+";unbind [glyph]"] + [';what' leaf+";what (~ship/chat-name) (glyph)"] :: - [%settings leaf+";settings"] - [%set leaf+";set key (value)"] - [%unset leaf+";unset key"] + [';settings' leaf+";settings"] + [';set' leaf+";set key (value)"] + [';unset' leaf+";unset key"] :: - [%chats leaf+";chats"] - [%help leaf+";help"] + [';chats' leaf+";chats"] + [';help' leaf+";help"] == :: +work: run user command :: diff --git a/pkg/arvo/app/chat-hook.hoon b/pkg/arvo/app/chat-hook.hoon index 0005f07f7b..3e1156be5a 100644 --- a/pkg/arvo/app/chat-hook.hoon +++ b/pkg/arvo/app/chat-hook.hoon @@ -14,11 +14,17 @@ +$ versioned-state $% state-0 state-1 + state-2 + == +:: ++$ state-2 + $: %2 + state-base == :: +$ state-1 $: %1 - loaded-cards=(list card) + loaded-cards=* state-base == +$ state-0 [%0 state-base] @@ -39,7 +45,7 @@ $% [%chat-update update:store] == -- -=| state-1 +=| state-2 =* state - :: %- agent:dbug @@ -66,29 +72,30 @@ ^- (quip card _this) |^ =/ old !<(versioned-state old-vase) - ?: ?=(%1 -.old) - :_ this(state old) - %+ murn ~(tap by wex.bol) - |= [[=wire =ship =term] *] - ^- (unit card) - ?. &(?=([%mailbox *] wire) =(our.bol ship) =(%chat-store term)) - ~ - `[%pass wire %agent [our.bol %chat-store] %leave ~] - :: path structure ugprade logic - :: - =/ keys=(set path) (scry:cc (set path) %chat-store /keys) - =/ upgraded-state - %* . *state-1 - synced synced - invite-created invite-created - allow-history allow-history - loaded-cards - %- zing - ^- (list (list card)) - %+ turn ~(tap in keys) generate-cards - == - :_ this(state upgraded-state) - loaded-cards.upgraded-state + =^ moves state + ^- (quip card state-2) + ?: ?=(%2 -.old) + ^- (quip card state-2) + `old + :: + ?: ?=(%1 -.old) + ^- (quip card state-2) + :_ [%2 +>.old] + %+ murn ~(tap by wex.bol) + |= [[=wire =ship =term] *] + ^- (unit card) + ?. &(?=([%mailbox *] wire) =(our.bol ship) =(%chat-store term)) + ~ + `[%pass wire %agent [our.bol %chat-store] %leave ~] + ^- (quip card state-2) + :: path structure ugprade logic + :: + =/ keys=(set path) (scry:cc (set path) %chat-store /keys) + :_ [%2 +.old] + %- zing + ^- (list (list card)) + (turn ~(tap in keys) generate-cards) + [moves this] :: ++ generate-cards |= old-chat=path @@ -234,10 +241,7 @@ ?+ mark (on-poke:def mark vase) %json (poke-json:cc !<(json vase)) %chat-action (poke-chat-action:cc !<(action:store vase)) - %noun - ?: =(%store-load q.vase) - [loaded-cards.state state(loaded-cards ~)] - [~ state] + %noun [~ state] :: %chat-hook-action (poke-chat-hook-action:cc !<(action:hook vase)) @@ -459,7 +463,7 @@ (chats-of-group pax) |= chat=path ^- (list card) - =/ owner (~(get by synced) chat) + =/ owner (~(get by synced.state) chat) ?~ owner ~ ?. =(u.owner our.bol) ~ %- zing diff --git a/pkg/arvo/app/chat-store.hoon b/pkg/arvo/app/chat-store.hoon index b37b1f0445..5a468ecb00 100644 --- a/pkg/arvo/app/chat-store.hoon +++ b/pkg/arvo/app/chat-store.hoon @@ -5,17 +5,20 @@ |% +$ card card:agent:gall +$ versioned-state - $% state-zero - state-one - state-two + $% state-0 + state-1 + state-2 == :: -+$ state-zero [%0 =inbox:store] -+$ state-one [%1 =inbox:store] -+$ state-two [%2 =inbox:store] ++$ state-0 [%0 =inbox:store] ++$ state-1 [%1 =inbox:store] ++$ state-2 [%2 =inbox:store] ++$ admin-action + $% [%trim ~] + == -- :: -=| state-two +=| state-2 =* state - :: %- agent:dbug @@ -33,15 +36,24 @@ ++ on-save !>(state) ++ on-load |= old-vase=vase + ^- (quip card _this) + |^ =/ old !<(versioned-state old-vase) - ?: ?=(%2 -.old) - [~ this(state old)] - =/ reversed-inbox=inbox:store - %- ~(run by inbox.old) + =? old ?=(%0 -.old) + (old-to-2 inbox.old) + =? old ?=(%1 -.old) + (old-to-2 inbox.old) + [~ this(state [%2 inbox.old])] + :: + ++ old-to-2 + |= =inbox:store + ^- state-2 + :- %2 + %- ~(run by inbox) |= =mailbox:store ^- mailbox:store [config.mailbox (flop envelopes.mailbox)] - [~ this(state [%2 reversed-inbox])] + -- :: ++ on-poke ~/ %chat-store-poke @@ -52,6 +64,7 @@ ?+ mark (on-poke:def mark vase) %json (poke-json:cc !<(json vase)) %chat-action (poke-chat-action:cc !<(action:store vase)) + %noun [~ (poke-noun:cc !<(admin-action vase))] == [cards this] :: @@ -148,6 +161,32 @@ [~ ~ %noun !>((swag [start (sub end start)] envelopes))] == :: +++ poke-noun + |= nou=admin-action + ^- _state + ~& %trimming-chat-store + %_ state + inbox + %- ~(urn by inbox) + |= [=path mailbox:store] + ^- mailbox:store + =/ [a=* out=(list envelope:store)] + %+ roll envelopes + |= $: =envelope:store + o=[[hav=(set serial:store) curr=@] out=(list envelope:store)] + == + ?: (~(has in hav.o) uid.envelope) + [[hav.o curr.o] out.o] + :- + ^- [(set serial:store) @] + [(~(put in hav.o) uid.envelope) +(curr.o)] + ^- (list envelope:store) + [envelope(number curr.o) out.o] + =/ len (lent out) + ~? !=(len (lent envelopes)) [path [%old (lent envelopes)] [%new len]] + [[len len] (flop out)] + == +:: ++ poke-json |= jon=json ^- (quip card _state) @@ -197,8 +236,8 @@ [~ state] =. letter.envelope.action (evaluate-letter [author letter]:envelope.action) =^ envelope u.mailbox (prepend-envelope u.mailbox envelope.action) - :- (send-diff path.action action(envelope envelope)) - state(inbox (~(put by inbox) path.action u.mailbox)) + :_ state(inbox (~(put by inbox) path.action u.mailbox)) + (send-diff path.action action(envelope envelope)) :: ++ handle-messages |= act=action:store diff --git a/pkg/arvo/app/chat-view.hoon b/pkg/arvo/app/chat-view.hoon index 5dbd0a9e55..2a13eb8d3f 100644 --- a/pkg/arvo/app/chat-view.hoon +++ b/pkg/arvo/app/chat-view.hoon @@ -1,19 +1,19 @@ :: chat-view: sets up chat JS client, paginates data, and combines commands :: into semantic actions for the UI :: -/- *permission-store, - *permission-hook, - *group-store, - *invite-store, - *metadata-store, - *permission-group-hook, - *chat-hook, - *metadata-hook, - *rw-security, - hook=chat-hook -/+ *server, default-agent, verb, dbug, - store=chat-store, - view=chat-view +/- *permission-store +/- *permission-hook +/- *group-store +/- *invite-store +/- *metadata-store +/- *permission-group-hook +/- *chat-hook +/- *metadata-hook +/- *rw-security +/- hook=chat-hook +/+ *server, default-agent, verb, dbug +/+ store=chat-store +/+ view=chat-view :: ~% %chat-view-top ..is ~ |% @@ -96,7 +96,9 @@ ++ truncated-inbox ^- inbox:store =/ =inbox:store - .^(inbox:store %gx /=chat-store/(scot %da now.bol)/all/noun) + =/ our (scot %p our.bol) + =/ now (scot %da now.bol) + .^(inbox:store %gx /[our]/chat-store/[now]/all/noun) %- ~(run by inbox) |= =mailbox:store ^- mailbox:store @@ -403,7 +405,12 @@ ++ chat-scry |= pax=path ^- (unit mailbox:store) - =. pax ;:(weld /=chat-store/(scot %da now.bol)/mailbox pax /noun) + =. pax + ;: weld + /(scot %p our.bol)/chat-store/(scot %da now.bol)/mailbox + pax + /noun + == .^((unit mailbox:store) %gx pax) :: ++ maybe-group-from-chat diff --git a/pkg/arvo/app/contact-hook.hoon b/pkg/arvo/app/contact-hook.hoon index 2415380ec1..b5a2b83fb8 100644 --- a/pkg/arvo/app/contact-hook.hoon +++ b/pkg/arvo/app/contact-hook.hoon @@ -456,20 +456,30 @@ ++ contacts-scry |= pax=path ^- (unit contacts) - =. pax ;:(weld /=contact-store/(scot %da now.bol)/contacts pax /noun) + =. pax + ;: weld + /(scot %p our.bol)/contact-store/(scot %da now.bol)/contacts + pax + /noun + == .^((unit contacts) %gx pax) :: ++ invite-scry |= uid=serial ^- (unit invite) =/ pax - /=invite-store/(scot %da now.bol)/invite/contacts/(scot %uv uid)/noun + ;: weld + /(scot %p our.bol)/invite-store/(scot %da now.bol) + /invite/contacts/(scot %uv uid)/noun + == .^((unit invite) %gx pax) :: ++ group-scry |= pax=path - ^- (unit group) - .^((unit group) %gx ;:(weld /=group-store/(scot %da now.bol) pax /noun)) + .^ (unit group) + %gx + ;:(weld /(scot %p our.bol)/group-store/(scot %da now.bol) pax /noun) + == :: ++ pull-wire |= pax=path diff --git a/pkg/arvo/app/contact-view.hoon b/pkg/arvo/app/contact-view.hoon index f30f85b504..e6fc820c9f 100644 --- a/pkg/arvo/app/contact-view.hoon +++ b/pkg/arvo/app/contact-view.hoon @@ -1,14 +1,15 @@ :: contact-view: sets up contact JS client and combines commands :: into semantic actions for the UI :: -/- *group-store, - *group-hook, - *invite-store, - *contact-hook, - *metadata-store, - *metadata-hook, - *permission-group-hook, - *permission-hook +/- *group-store +/- *group-hook +/- *invite-store +/- *contact-hook +/- *metadata-store +/- *metadata-hook +/- *permission-group-hook +/- *permission-hook +:: /+ *server, *contact-json, default-agent, dbug |% +$ versioned-state @@ -256,11 +257,16 @@ :: ++ all-scry ^- rolodex - .^(rolodex %gx /=contact-store/(scot %da now.bol)/all/noun) + .^(rolodex %gx /(scot %p our.bol)/contact-store/(scot %da now.bol)/all/noun) :: ++ contact-scry |= pax=path ^- (unit contact) - =. pax ;:(weld /=contact-store/(scot %da now.bol)/contact pax /noun) + =. pax + ;: weld + /(scot %p our.bol)/contact-store/(scot %da now.bol)/contact + pax + /noun + == .^((unit contact) %gx pax) -- diff --git a/pkg/arvo/app/dbug.hoon b/pkg/arvo/app/dbug.hoon index 320a03dbae..7d980713a9 100644 --- a/pkg/arvo/app/dbug.hoon +++ b/pkg/arvo/app/dbug.hoon @@ -360,12 +360,13 @@ :- %a %+ turn %+ sort ~(tap by sessions:auth-state:v-eyre) - |= [[@uv a=@da] [@uv b=@da]] - (gth a b) + |= [[@uv a=session:eyre] [@uv b=session:eyre]] + (gth expiry-time.a expiry-time.b) |= [cookie=@uv session:eyre] %- pairs :~ 'cookie'^s+(end 3 4 (rsh 3 2 (scot %x (shax cookie)))) 'expiry'^(time expiry-time) + 'channels'^(numb ~(wyt in channels)) == :: :: /eyre/channels.json diff --git a/pkg/arvo/app/debug/index.html b/pkg/arvo/app/debug/index.html index b16e317b03..eb37ada11d 100644 --- a/pkg/arvo/app/debug/index.html +++ b/pkg/arvo/app/debug/index.html @@ -12,8 +12,8 @@
=0;r--){for(var c=t.words[r],u=l-1;u>=0;u--){var d=c>>u&1;i!==n[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4===++s||0===r&&0===u)&&(i=this.mul(i,n[a]),s=0,a=0)):s=0}l=26}return i},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new x(e)},i(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,n(31)(e))},function(e,t,n){"use strict";e.exports=n(239)},function(e,t){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}},function(e,t,n){var r=n(373);e.exports=h,e.exports.parse=o,e.exports.compile=function(e,t){return s(o(e,t),t)},e.exports.tokensToFunction=s,e.exports.tokensToRegExp=f;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,a=0,s="",u=t&&t.delimiter||"/";null!=(n=i.exec(e));){var d=n[0],f=n[1],h=n.index;if(s+=e.slice(a,h),a=h+d.length,f)s+=f[1];else{var p=e[a],m=n[2],b=n[3],g=n[4],y=n[5],v=n[6],_=n[7];s&&(r.push(s),s="");var k=null!=m&&null!=p&&p!==m,w="+"===v||"*"===v,x="?"===v||"*"===v,M=n[2]||u,S=g||y;r.push({name:b||o++,prefix:m||"",delimiter:M,optional:x,repeat:w,partial:k,asterisk:!!_,pattern:S?c(S):_?".*":"[^"+l(M)+"]+?"})}}return a