Skip to content
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

fix: Handle nullptr JS TypedArrays by bumping napi to 2.6.11 #673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Xanewok
Copy link
Member

@Xanewok Xanewok commented Sep 20, 2024

This fixes an instance where we roundtrip a zero-length Uint8Array in JS code and violate the slice::from_raw_parts contract (checked in debug builds at run-time since Rust 1.78) because internally napi calls it with a null pointer, see napi-rs/napi-rs#2258.

Found while running the test suite of https://github.com/ProjectOpenSea/seaport with local, most recent Hardhat+EDR.

This should unblock further testing and releasing a Hardhat version that uses the EDR-powered stack tracing.

@Xanewok Xanewok requested review from fvictorio and a team September 20, 2024 12:39
Copy link

changeset-bot bot commented Sep 20, 2024

⚠️ No Changeset found

Latest commit: c11ea49

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Xanewok Xanewok had a problem deploying to github-action-benchmark September 20, 2024 12:39 — with GitHub Actions Failure
@@ -18,8 +18,8 @@ k256 = { version = "0.13.1", default-features = false, features = ["arithmetic",
log = { version = "0.4.20", default-features = false }
# when napi is pinned, be sure to pin napi-derive to the same version
Copy link
Member Author

Choose a reason for hiding this comment

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

These don't seem to be released in tandem (anymore?). Should we remove the comment or reword it to something like "If you bump the napi version, please also make sure that we use a compatible napi-derive"?.

This should ideally be handled by the upstream package but sometimes mistakes happen and I assume one of these were the reason for this warning, here.

Copy link
Member

Choose a reason for hiding this comment

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

Feel free to. I also removed the comment in feat/multichain

@Xanewok Xanewok added the no changeset needed This PR doesn't require a changeset label Sep 20, 2024
@Xanewok Xanewok had a problem deploying to github-action-benchmark September 20, 2024 15:58 — with GitHub Actions Failure
Copy link
Member

@agostbiro agostbiro left a comment

Choose a reason for hiding this comment

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

The code LGTM, but there seems to be a big regression on the seaport benchmark: https://github.com/NomicFoundation/edr/actions/runs/10959402320/job/30431668868?pr=673

I reran it just in case it's a false positive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changeset needed This PR doesn't require a changeset
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants