-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: browser chunking #11102
feat: browser chunking #11102
Conversation
… gj/browser_chunking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I left several comments but none of them are blockers. More in general, I got the same concern as with the previous PR for browser usage: it's really easy to screw this up by adding the wrong import in the wrong place. Should we tweak the vite or webpack box config so that it fails with an error if the bundle exceeds a certain size, so we don't inadvertently screw up the bundle again?
And a nit about naming: I'm not a fan of server/client/client-async. WDYT about server/client/browser? Though server/client can mean "the artifacts for the server/client" or "to be used in the server/client", which makes things confusing. Hmm...
yarn-project/noir-protocol-circuits-types/src/execution/client.ts
Outdated
Show resolved
Hide resolved
yarn-project/noir-protocol-circuits-types/src/execution/client/index.ts
Outdated
Show resolved
Hide resolved
yarn-project/noir-protocol-circuits-types/src/scripts/generate_private_kernel_reset_data.ts
Outdated
Show resolved
Hide resolved
Thanks for the comments @spalladino ! Had to revert to draft because I wanted to rework
|
I don't think it needs to be a new task. We should be able to configure webpack on aztec.js to error on bundle size exceeded using |
As for naming, I asked ChatGPT. I like the
|
… gj/browser_chunking
@spalladino implemented your suggestions, finally went with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome
* master: (287 commits) feat: Sync from noir (#11051) chore(docs): Update tx concepts page (#10947) chore(docs): Edit Aztec.nr Guide section (#10866) chore: test:e2e defaults to no-docker (#10966) chore(avm): improve column stats (#11135) chore: Sanity checking of proving job IDs (#11134) feat: permutation argument optimizations (#10960) feat: single tx block root rollup (#11096) refactor: prover db config (#11126) feat: monitor event loop lag (#11127) chore: Greater stability at 1TPS (#10981) chore: Jest reporters for CI (#11125) fix: Sequencer times out L1 tx at end of L2 slot (#11112) feat: browser chunking (#11102) fix: Added start/stop guards to running promise and serial queue (#11120) fix: Don't retransmit txs upon node restart (#11123) fix: Prover node aborts execution at epoch end (#11111) feat: blob sink in sandbox without extra process (#11032) chore: log number of instructions executed for call in AVM. Misc fix. (#11110) git subrepo push --branch=master noir-projects/aztec-nr ...
Further modularises
noir-protocol-circuits-types
, exposing aclient/lazy
API that allow browser bundles to not import every single JSON artifact at once, but rather pull them on demand./server
and/vks
entrypoints are also provided to aid in startup CLI times, jest cache and general cleanup.This is very important due to the sheer amount of different reset variants we currently have. However, a regular
/client/bundle
is still exposed in case dynamic imports are not supported in the target platform.This takes our bundle sizes in the example vite box (with PXE in the browser and proving) from 50MB (30 compressed) to ~3MB before meaningful content is displayed. After that,
bb.js
is an additional 8-9 and each circuit hovers around 0.3-1, but only the ones used in the transactions are pulled when required.Also removed the
TestPrivateKernelProver
, and replaced it by each of our prover implementations providing a cleaner simulation vs. witgen+proving interface. This way, the prover is now 100% a PXE plugin (which will allow us to even delegate proving!)