Skip to content

fix: encode deploy package bytes in chunks - #9

Open
omerbek wants to merge 1 commit into
0xMiden:mainfrom
omerbek:fix/deploy-package-base64
Open

fix: encode deploy package bytes in chunks#9
omerbek wants to merge 1 commit into
0xMiden:mainfrom
omerbek:fix/deploy-package-base64

Conversation

@omerbek

@omerbek omerbek commented Aug 17, 2026

Copy link
Copy Markdown

Summary

Fixes #8.

This replaces the deploy button's String.fromCharCode(...contract.packageBytes) conversion with a chunked uint8ArrayToBase64() helper.

Why

The spread call passes every byte as a separate argument to String.fromCharCode(). For larger compiled .masp packages, that can exceed the JavaScript engine argument limit and throw RangeError: Maximum call stack size exceeded before useDeploy() is called.

Chunking keeps the conversion bounded while preserving the same base64 payload passed to deploy().

Testing

  • node -e repro/round-trip for a 200000-byte Uint8Array
  • corepack yarn@1.22.22 typecheck
  • corepack yarn@1.22.22 build

Note: dependency install required --ignore-engines locally because this machine is on Node 21.6.1 while glob@11.1.0 declares 20 || >=22. Also, corepack yarn@1.22.22 lint currently fails because the repo's lint script calls eslint, but eslint is not installed in package.json devDependencies.

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.

Deploying larger compiled packages can fail during base64 encoding

1 participant