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

feat: cleanup provider and stack traces logic #6164

Merged
merged 8 commits into from
Jan 30, 2025
Merged

Conversation

schaable
Copy link
Member

@schaable schaable commented Jan 20, 2025

This is the final cleanup PR for the network stack in preparation for the alpha (and ideally the beta). It includes:

  • Normalized the EDR and HTTP providers to make them as similar as possible.
  • Removed the emission of the hardhatNetworkReset event in the request method, as it no longer makes sense in v3.
  • Free resources for garbage collection on close (unset the provider for the EDR provider and the dispatcher for the HTTP provider) and throw an error if the request method is called after closing.
  • EDR Provider – request method:
    • Removed InvalidInputError logic, as it is already handled by getJsonRpcRequest.
    • Replaced assertions on jsonRpcResponse.result with assertHardhatInvariant.
    • Cleaned up the #handleEdrResponse function.
  • Improved functions in stack-trace-solidity-errors.ts by removing TODOs and enhancing overall code flow.
  • Made other minor adjustments to improve code clarity and flow.

@schaable schaable requested a review from alcuadrado January 20, 2025 22:24
Copy link

vercel bot commented Jan 20, 2025

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 28, 2025 11:41pm

Copy link

changeset-bot bot commented Jan 20, 2025

⚠️ No Changeset found

Latest commit: a6fe358

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.

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

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Jan 20, 2025
@schaable schaable added the v-next A Hardhat v3 development task label Jan 20, 2025
@Wodann Wodann force-pushed the optimism/stack-traces branch from 4dd2b13 to 0a8ff72 Compare January 23, 2025 22:54
Base automatically changed from optimism/stack-traces to v-next January 23, 2025 23:06
Copy link
Member

@alcuadrado alcuadrado left a comment

Choose a reason for hiding this comment

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

I left a few comments.

@schaable schaable added this pull request to the merge queue Jan 30, 2025
Merged via the queue into v-next with commit 66fcd56 Jan 30, 2025
86 checks passed
@schaable schaable deleted the cleanup-providers branch January 30, 2025 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on v-next A Hardhat v3 development task
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants