fix: encode deploy package bytes in chunks - #9
Open
omerbek wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #8.
This replaces the deploy button's
String.fromCharCode(...contract.packageBytes)conversion with a chunkeduint8ArrayToBase64()helper.Why
The spread call passes every byte as a separate argument to
String.fromCharCode(). For larger compiled.masppackages, that can exceed the JavaScript engine argument limit and throwRangeError: Maximum call stack size exceededbeforeuseDeploy()is called.Chunking keeps the conversion bounded while preserving the same base64 payload passed to
deploy().Testing
node -erepro/round-trip for a 200000-byteUint8Arraycorepack yarn@1.22.22 typecheckcorepack yarn@1.22.22 buildNote: dependency install required
--ignore-engineslocally because this machine is on Node 21.6.1 whileglob@11.1.0declares20 || >=22. Also,corepack yarn@1.22.22 lintcurrently fails because the repo's lint script callseslint, buteslintis not installed inpackage.jsondevDependencies.