Skip to content

chore: Lazy loading artifacts everywhere#12285

Merged
Thunkar merged 12 commits intomasterfrom
gj/lazy_loading_artifacts_everywhere
Feb 26, 2025
Merged

chore: Lazy loading artifacts everywhere#12285
Thunkar merged 12 commits intomasterfrom
gj/lazy_loading_artifacts_everywhere

Conversation

@Thunkar
Copy link
Contributor

@Thunkar Thunkar commented Feb 26, 2025

This PR adds the option to lazily load JSON artifacts in all the packages that were missing that functionality, further improving bundle sizes for the browser and allowing us to finally put limits on our example apps bundle sizes:

  • noir-protocol-circuits-types/vks: now allow vk lazy imports via the LazyArtifactProvider in the /client export, while maintaining the bundled version for the server under /server/vks
  • accounts: Now all exports provide a lazy version, e.g: @aztec/accounts/schnorr/lazy. This has proven to be complicated due to the testing import leaking into the browser (where type assertions are not widely supported). Now there's also /testing/lazy. This testing package is needed in the browser for the prefunded accounts.
  • protocol-contracts: Now with a lazy version and exporting ProtocolContractProviders so that PXE can be configured with bundled and lazy versions.

Besides the type assertion issue, we absolutely want to keep bundled and lazy versions because some environments don't play well with await import (namely service workers in firefox)

@Thunkar Thunkar self-assigned this Feb 26, 2025
@Thunkar Thunkar requested a review from nventuro February 26, 2025 15:30
Copy link
Contributor

@sklppy88 sklppy88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely, just got some small nits !

* @param signingPrivateKey - ECDSA key used for signing transactions.
* @returns A wallet for this account that can be used to interact with a contract instance.
*/
export function getEcdsaRSSHWallet(pxe: PXE, address: AztecAddress, signingPublicKey: Buffer): Promise<AccountWallet> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export function getEcdsaRSSHWallet(pxe: PXE, address: AztecAddress, signingPublicKey: Buffer): Promise<AccountWallet> {
export function getEcdsaRSSHWallet(pxe: PXE, address: AztecAddress, signingPrivateKey: Buffer): Promise<AccountWallet> {

Seems like this is more correct

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funnily enough, in this case it is a public key. It's what identifies the private key that lives inside the secure enclave of the mac and is used for actual signing, but we don't have access to it! That's why we keep the public one around to request a signature (essentially "please touchid, sign this with a private key that I can verify with this public key)

Thunkar and others added 4 commits February 26, 2025 20:02
Co-authored-by: esau <152162806+sklppy88@users.noreply.github.com>
@Thunkar Thunkar enabled auto-merge (squash) February 26, 2025 19:34
@Thunkar Thunkar merged commit 3cb6920 into master Feb 26, 2025
9 checks passed
@Thunkar Thunkar deleted the gj/lazy_loading_artifacts_everywhere branch February 26, 2025 19:56
TomAFrench added a commit that referenced this pull request Feb 26, 2025
* master: (31 commits)
  feat: Slack message to ci channel tagging owners on flakes. (#12284)
  fix: slack notify was broken by quoted commit titles
  revert: "chore: Fix and reenable fees-settings test (#12302)"
  fix: run arm64 on master (#12307)
  yolo fix
  chore: Fix and reenable fees-settings test (#12302)
  feat!: rename compute_nullifier_without_context (#12308)
  chore: Lazy loading artifacts everywhere (#12285)
  chore: Reenable dapp subscription test (#12304)
  chore: Run prover test with fake proofs when requested (#12305)
  chore: Do not set CI_FULL outside CI (#12300)
  chore: new mnemonic deployments on sepolia (#12076)
  chore!: enable multiple L1 nodes to be used (#11945)
  chore: remove no longer supported extension from vscode/extension.json (#12303)
  fix(e2e): p2p_reqresp (#12297)
  feat: Sync from noir (#12298)
  chore: enabling `e2e_contract_updates` in CI + nuking irrelevant test (#12293)
  feat: prepend based merge (#12093)
  feat: fetch addresses from registry (#12000)
  feat: live logs (#12271)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants