Skip to content

Enable stack traces in the EDR provider #6214

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

Merged
merged 9 commits into from
Feb 4, 2025
Merged

Conversation

alcuadrado
Copy link
Member

While cleaning up the ArtifactsManager interface in #6213 I noticed that we may have a misalignment between the build info formats that EDR was expecting and the ones we generated, so I took a stab at this.

This PR those a few things:

  • Sets the correct types in our own EDR node-types, as for some reason EDR is using some anys.
  • It loads and converts all the build infos into the expected format.
  • Adds the artifacts plugin as a dependency of the network manager plugin, so that it can load the build infos
  • Fixes an issue related to how we were creating the solc inputs.

While this closes #5981, there's going to be a bit of follow up work.

  1. Once Agost releases a new version of @ignored/edr, we should do something similar for the solidity tests. Except without transforming the build infos into HH2 build infos.
  2. Once Remco adapts the interface of @ignored/edr-optimism, we should stop parsing and transforming the build infos in the NetworkManager.
  3. We should test this integration, as right now its only "tested" in the example project.

Copy link

changeset-bot bot commented Jan 31, 2025

⚠️ No Changeset found

Latest commit: 8484d3c

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

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package "@nomicfoundation/ignition-core" depends on the ignored package "hardhat", but "@nomicfoundation/ignition-core" is not being ignored. Please add "@nomicfoundation/ignition-core" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition-ethers" depends on the ignored package "hardhat", but "@nomicfoundation/hardhat-ignition-ethers" is not being ignored. Please add "@nomicfoundation/hardhat-ignition-ethers" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition-viem" depends on the ignored package "hardhat", but "@nomicfoundation/hardhat-ignition-viem" is not being ignored. Please add "@nomicfoundation/hardhat-ignition-viem" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition" depends on the ignored package "hardhat", but "@nomicfoundation/hardhat-ignition" is not being ignored. Please add "@nomicfoundation/hardhat-ignition" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition-ethers" depends on the ignored package "@nomicfoundation/hardhat-ethers", but "@nomicfoundation/hardhat-ignition-ethers" is not being ignored. Please add "@nomicfoundation/hardhat-ignition-ethers" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition" depends on the ignored package "@nomicfoundation/hardhat-network-helpers", but "@nomicfoundation/hardhat-ignition" is not being ignored. Please add "@nomicfoundation/hardhat-ignition" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition" depends on the ignored package "@nomicfoundation/hardhat-verify", but "@nomicfoundation/hardhat-ignition" is not being ignored. Please add "@nomicfoundation/hardhat-ignition" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition-viem" depends on the ignored package "@nomicfoundation/hardhat-viem", but "@nomicfoundation/hardhat-ignition-viem" is not being ignored. Please add "@nomicfoundation/hardhat-ignition-viem" to the `ignore` option.
The package "@nomicfoundation/ignition-core" depends on the ignored package "@nomicfoundation/eslint-plugin-hardhat-internal-rules", but "@nomicfoundation/ignition-core" is not being ignored. Please add "@nomicfoundation/ignition-core" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition-ethers" depends on the ignored package "@nomicfoundation/eslint-plugin-hardhat-internal-rules", but "@nomicfoundation/hardhat-ignition-ethers" is not being ignored. Please add "@nomicfoundation/hardhat-ignition-ethers" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition-viem" depends on the ignored package "@nomicfoundation/eslint-plugin-hardhat-internal-rules", but "@nomicfoundation/hardhat-ignition-viem" is not being ignored. Please add "@nomicfoundation/hardhat-ignition-viem" to the `ignore` option.
The package "@nomicfoundation/hardhat-ignition" depends on the ignored package "@nomicfoundation/eslint-plugin-hardhat-internal-rules", but "@nomicfoundation/hardhat-ignition" is not being ignored. Please add "@nomicfoundation/hardhat-ignition" to the `ignore` option.

Copy link

vercel bot commented Jan 31, 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 Feb 3, 2025 2:56pm

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Jan 31, 2025
@alcuadrado alcuadrado linked an issue Jan 31, 2025 that may be closed by this pull request
@alcuadrado
Copy link
Member Author

alcuadrado commented Jan 31, 2025

@galargh as I changed how the solc inputs are generated, some build ids changed, and that broke a test. Can you check if my fix is correct?

Copy link
Member

@schaable schaable left a comment

Choose a reason for hiding this comment

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

Looks good, but left a question regarding performance.

} catch (error) {
assert.ok(error instanceof Error, "Expected an error to be thrown");

assert.ok(
Copy link
Member

Choose a reason for hiding this comment

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

no need to change it, but there's an assert.match that better captures this type of assertion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I looked for something with "includes" semantics and couldn't find any 😅

@@ -204,6 +214,10 @@ export class NetworkManagerImplementation implements NetworkManager {
chainType: resolvedChainType as ChainType,
},
jsonRpcRequestWrapper,
tracingConfig: {
Copy link
Member

Choose a reason for hiding this comment

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

have you seen any performance hit after adding this? I thought it would be disabled by default and enabled through config.

Copy link
Member Author

@alcuadrado alcuadrado Feb 3, 2025

Choose a reason for hiding this comment

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

It's meant to be enabled by default, so if there's any performance issue we should address it.

Right now it will have a small performance problem, which is being address in EDR. Note that we are parsing and transforming the build infos, just to pass it to EDR.

In the near future we'll just pass the Uint8Array read from the files, directly.

Copy link
Member

@galargh galargh left a comment

Choose a reason for hiding this comment

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

Looks good! In 7ebad19 (which is part of #6129), I refactored the build-system.ts as I found it very annoying up to update.

Having said that, we can go ahead with these changes first, and I'll deal with resolving the conflicts.

Base automatically changed from cleanup-artifacts to v-next February 4, 2025 20:04
@alcuadrado alcuadrado added this pull request to the merge queue Feb 4, 2025
Merged via the queue into v-next with commit 43d6557 Feb 4, 2025
60 checks passed
@alcuadrado alcuadrado deleted the pass-build-infos-to-edr branch February 4, 2025 20:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:ready This issue is ready to be worked on
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

EDR not getting compilation results in v3
3 participants