Repository navigation
fix: recognise console calls by the Hardhat console address - #1821
Conversation
The nested trace conversion defined its own copy of the Hardhat console address. That copy held the `ecrecover` precompile address instead. Console calls therefore got a placeholder instead of their address as code. Reuse the console and cheatcode addresses from foundry-evm-core.
🦋 Changeset detectedLatest commit: fc09b82 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The correction is narrowly scoped, includes targeted regression tests, and has no identified blocking issues.
Review effort: Balanced
Findings: None
What changed in this PR
Corrects Hardhat console address recognition in Solidity nested-trace conversion by replacing local addresses with shared Foundry constants.
Changes:
- Reuses console and cheatcode address constants.
- Adds regression tests for both address-as-code paths.
- Updates dependency metadata and adds a patch release note.
| File | Description |
|---|---|
| crates/edr_solidity/src/nested_trace/conversion.rs | Uses shared addresses and adds regression tests. |
| crates/edr_solidity/Cargo.toml | Adds the direct foundry-evm-core dependency. |
| Cargo.lock | Records the direct dependency. |
| .changeset/fix-stack-trace-console-address.md | Documents the console-address fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1821 +/- ##
==========================================
- Coverage 80.57% 80.56% -0.01%
==========================================
Files 469 469
Lines 82311 82327 +16
Branches 82311 82327 +16
==========================================
+ Hits 66320 66329 +9
- Misses 13742 13747 +5
- Partials 2249 2251 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The nested trace conversion in
crates/edr_solidity/src/nested_trace/conversion.rsuses the address as code for calls to the Hardhat console and the cheatcode contract, because neither has deployed bytecode. Since c938af2 it compared against a local copy of the console address that held0x…01, theecrecoverprecompile, instead of0x000000000000000000636F6e736F6c652e6c6f67.This PR reuses the console and cheatcode addresses from
foundry_evm_core::constantsinstead of local copies.What changes
convert_nodeimportsHARDHAT_CONSOLE_ADDRESSandCHEATCODE_ADDRESSfromfoundry-evm-core, now a direct dependency ofedr_solidity. It was already a transitive dependency throughfoundry-evm-traces, so the crate graph does not change.console_call_uses_address_as_codeandcheatcode_call_uses_address_as_codeconvert a one-node arena with no known code.Behaviour changes
console.logcalls never fail, so they are never the frame the stack-trace heuristics inspect. The existing0_5/console-logs/multiple-messages/revertingfixture passes onmainand on this branch.Validation
console_call_uses_address_as_codefails onmain(code0x00instead of the 20 console address bytes) and passes here.Notes for review
Response::traces#1301. Calls toecrecoverreceived the address-as-code treatment in the modes that record precompile calls; feat: add backwards compatibility forResponse::traces#1301 marks those as precompile calls, which takes precedence.