-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
big-integer
shim testing on android-jsc
#6221
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
This reverts commit d598537.
New dependency changes detected. Learn more about Socket for GitHub ↗︎ 👍 No new dependency issues detected in pull request Bot CommandsTo ignore an alert, reply with a comment starting with Pull request alert summary
📊 Modified Dependency Overview:
|
resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.0.5.tgz#b9088fc687cc13f0c1243d6133d145dfcf3fe446" | ||
integrity sha512-259rXKK3b3D8HRVdRmlOEi6QFvwxdt304hhrEAmpZhsj7ufXEOTIc9JRZPMnXatKjECokdLNBcDOFBeBSzAIaw== | ||
dependencies: | ||
"@chainsafe/ssz" "0.9.4" |
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.
@leotm in case you're not aware and it's relevant, this will pull in a WASM dependency. MetaMask/eth-sig-util#302 (comment)
My understanding is that @chainsafe/ssz
is runtime-agnostic as of recent 0.11.1
, which will be incorporated in an imminent @ethereumjs/*
release.
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.
thanks again for bringing up earlier ^ and the link
gotcha so the shim could be incompat w @ethereumjs/util>@ChainSafe/ssz>@chainsafe/as-sha256
's wasm serialisation, which @ethereumjs/util
bump might fix (replacing w e.g. js-only noble-hashes
)
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.
the shim's unsupported big int literals on android-jsc (e.g. 1n
) remain
but yeah not rly a prob long as @ethereumjs/util
doesn't complain
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.
testing @ethereumjs/util
8.0.6 with arrToBufArr
64fb902 throws (screenshot)
error: Error: Unable to resolve module zlib from .../metamask-mobile/node_modules/micro-ftch/index.js: zlib could not be found within the project or in these directories:
node_modules
which is true node_modules/zlib
doesn't exist 🤔
and noticed
@ethereumjs/util/src/index.ts also exports * from './provider'
'./provider' imports fetch from 'micro-ftch'
'./provider' exports fetchFromProvider
edit: ah zlib
is a node API we'd need to shim too for arrToBufArr
looks like https://github.com/tradle/rn-nodeify/blob/master/shims.js#L3 already has browserify-zlib
to potentially add to our postinstall.sh
(otherwise shim manually again like big-integer
)
if going down this potential whack-a-mole route, to get all @ethereumjs/util
methods like arrToBufArr
working
also we have a Metro warning which could be related
warn Package @metamask/eth-sig-util has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/leo/Documents/GitHub/metamask-mobile/node_modules/@metamask/eth-sig-util/package.json
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.
just checked a fresh (RN 0.71.6) as well
switched off Hermes (for android-jsc)
added and ran rn-nodeify --install http,https,zlib,events,util --hack --yarn
(minimal shims)
added and manually shimmed big-integer
added @ethereumjs/util
8.0.6 and tested arrToBufArr
which gets us past node missing shim issues like zlib
onto a new issue (potentially more):
And create a new example Uint8Array
Error: Unable to resolve module zlib from .../metamask-mobile/node_modules/micro-ftch/index.js: zlib could not be found within the project or in these directories: node_modules @ethereumjs/util/src/index.ts exports * from './provider' './provider' imports fetch from 'micro-ftch' './provider' exports fetchFromProvider
- react-native-community/jsc-android-buildscripts#159 (comment) - facebook/react-native#35504 (comment) - vanilla RN 0.71.6 tested working: 1n+2n, BigInt(1)+BigInt(2) - package.json>resolution not required (result: resolution field incompatible) - org.webkit:android-jsc-intl:+ required (which we're already using) 294992.0.0 prevents need for e.g. `big-integer` shim, till RN 0.71.6 shipped #6221 294992.0.0 prevents need for BE patches, till RN 0.71.6 upgrade shipped e.g. #6305 cc @Cal-L But (the catch) 294992.0.0 results in repo-specific dep build error, possibly more deps to resolve, likely via patch(es): > Configure project :react-native-reanimated No AAR for react-native-reanimated found. Attempting to build from source. Android gradle plugin: 4.2.2 Gradle: 6.9 Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings Error: Command failed: ./gradlew app:installProdDebug -PreactNativeDevServerPort=8081 OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0 Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01 FAILURE: Build failed with an exception. * Where: Build file '/Users/leo/Documents/GitHub/metamask-mobile/node_modules/react-native-reanimated/android/build.gradle' line: 1059 * What went wrong: A problem occurred evaluating project ':react-native-reanimated'. > Expected directory '/Users/leo/Documents/GitHub/metamask-mobile/node_modules/react-native/../jsc-android/dist/org/webkit/android-jsc' to contain exactly one file, however, it contains no files.
This PR has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions. |
This should no longer be relevant now that we've upgraded React Native |
Description
Testing
big-integer
shim on problematicandroid-jsc
cc @Gudahttsince iOS JSC already natively fully supports big integers (
BigInt
and big integer literals like1n
)thus compat with
@ethereumjs/util
whereas vanilla
android-jsc
(even on latest RN 0.71.6) throwsBigInt(1)
: ReferenceError: Can't find variable: BigIntbig-integer
shim1n
: SyntaxError: No identifiers allowed directly after numeric literalbig-integer
shimScreenshots/Recordings
If applicable, add screenshots and/or recordings to visualize the before and after of your change
Issue
Progresses #???
Checklist