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

test: enable hardhat module tests #4721

Merged
merged 27 commits into from
Jan 8, 2024
Merged

Conversation

Wodann
Copy link
Member

@Wodann Wodann commented Dec 29, 2023

No description provided.

@Wodann Wodann self-assigned this Dec 29, 2023
Copy link

changeset-bot bot commented Dec 29, 2023

⚠️ No Changeset found

Latest commit: cd3ca9c

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

Copy link

vercel bot commented Dec 29, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 5, 2024 8:55pm

@Wodann Wodann requested a review from agostbiro January 4, 2024 00:14
@Wodann Wodann marked this pull request as ready for review January 4, 2024 00:14
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.

Thanks for this PR! I left some comments + it looks like there are failing tests in the CI.

@@ -1910,54 +2091,6 @@ mod tests {
Ok(())
}

#[test]
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering, what's the reason for removing this test?

Copy link
Member Author

Choose a reason for hiding this comment

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

When setting the nonce, we're now returning an error if there are any pending transactions (this is the behaviour in Hardhat). As a result, it's never possible for the mem pool to be updated

Copy link
Member Author

Choose a reason for hiding this comment

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

I could move the check to the JSON-RPC layer, but it feels like a product design decision.

@alcuadrado & @fvictorio thoughts?

crates/edr_provider/src/lib.rs Show resolved Hide resolved
`Storage key must not be greater than or equal to 2^256. Received ${
isEdr
? "0x10000000000000000000000000000000000000000000000000000000000000001"
: "115792089237316195423570985008687907853269984665640564039457584007913129639937"
Copy link
Member

Choose a reason for hiding this comment

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

Why are the values allowed to differ between EDR and Hardhat?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is something I wanted to discuss:

In JS/TS there is the BigInt type which is a smart integer type that can grow to any size. When this error is created by Hardhat, the incoming hexadecimal string is first parsed to a BigInt and then a check occurs to see whether the key is too large.

I wonder whether we should actually be printing the decimal notation of the key or the original hex string?

@fvictorio & @alcuadrado, I would appreciate your input.

If we should be returning a decimal number, we'd need to decode the hexadecimal value to a decimal string value, as there is no equivalent of the BigInt in our codebase.

Copy link
Member

Choose a reason for hiding this comment

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

I think the user would expect the original hex string, as that's what we are telling them that is invalid.

Copy link
Member Author

Choose a reason for hiding this comment

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

In that case, Hardhat would need to change its behaviour to return a hexadecimal string instead of the decimal one.

Copy link
Member Author

Choose a reason for hiding this comment

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

I resolved it as follows: 052ebe8

@Wodann Wodann merged commit 31123bf into edr/main Jan 8, 2024
101 of 103 checks passed
@Wodann Wodann deleted the edr/feat/drop-transaction branch January 8, 2024 14:54
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Port hardhat_mine Port mempool transaction RPC methods Port evm_setIntervalMining
3 participants