fix(edr_solidity): resolve declaration-attributed locations in solx stack traces - #1553
Merged
nebasuke merged 1 commit intoJul 20, 2026
Conversation
nebasuke
temporarily deployed
to
github-action-benchmark
July 10, 2026 15:16 — with
GitHub Actions
Inactive
🦋 Changeset detectedLatest commit: 905c238 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 |
nebasuke
temporarily deployed
to
github-action-benchmark
July 10, 2026 15:21 — with
GitHub Actions
Inactive
nebasuke
temporarily deployed
to
github-action-benchmark
July 10, 2026 15:21 — with
GitHub Actions
Inactive
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/solx-stack-trace-provider-coverage #1553 +/- ##
===========================================================================
- Coverage 79.86% 79.85% -0.01%
===========================================================================
Files 452 452
Lines 78600 78642 +42
Branches 78600 78642 +42
===========================================================================
+ Hits 62770 62803 +33
- Misses 13666 13669 +3
- Partials 2164 2170 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…tack traces solx attributes compiler-generated helper code (calldata decoding, shared revert builders) to the *declaration* of the enclosing function or contract, where solc leaves such code unmapped. Two inference paths broke on that difference: 1. fails_right_after_call / is_call_failed_error compared every post-CALL step location to the call site by strict equality, so declaration-level padding (whose range merely contains the statement) made the heuristics bail and reverts degraded to OtherExecutionError at the contract declaration line. New TraceStrategy::locations_equivalent treats a containing (declaration-level) location as "still at the statement" for solx; solc keeps strict equality. 2. A shared revert helper flattened out of a modifier is attributed to the modified function's declaration line. SolxTraceStrategy:: revert_source_reference now walks the executed steps back from a declaration-line revert to the statement that led there (the require's message-building code keeps its own line), matching solc. Provider-path effects (goldens flipped in solx_stack_trace.rs): - ReturndataSizeError now surfaces at the call site for both a returndata-size mismatch and a typed call to a codeless account (parity with solc >= 0.8.10, which emits no EXTCODESIZE probe for returndata-expecting calls), replacing OtherExecutionError at the contract declaration. - A multi-statement modifier revert reports the failing require's line (415) instead of the function declaration line (420), removing the provider-level twin of the sweep's NestedModifierRevertTest divergence. The solc strategy is behavior-identical; edr_solidity unit tests (77) and the edr_provider integration harness (198) pass.
nebasuke
force-pushed
the
feat/solx-stack-trace-provider-coverage
branch
from
July 20, 2026 14:47
e7c64db to
dc3c75e
Compare
nebasuke
force-pushed
the
fix/solx-declaration-attributed-inference
branch
from
July 20, 2026 14:47
9bcf71e to
905c238
Compare
nebasuke
temporarily deployed
to
github-action-benchmark
July 20, 2026 14:47 — with
GitHub Actions
Inactive
nebasuke
temporarily deployed
to
github-action-benchmark
July 20, 2026 15:28 — with
GitHub Actions
Inactive
nebasuke
temporarily deployed
to
github-action-benchmark
July 20, 2026 15:28 — with
GitHub Actions
Inactive
nebasuke
marked this pull request as ready for review
July 20, 2026 15:46
nebasuke
merged commit Jul 20, 2026
e09dae7
into
feat/solx-stack-trace-provider-coverage
62 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note: For now these are quick AI written fixes/tests to try and validate the solx trace integration.
Claude Summary
Fixes the two inference gaps found by #1552's provider-path tests (stacked: #1425 ← #1552 ← this).
Root cause
solx attributes compiler-generated helper code — calldata decoding, shared revert builders — to the declaration of the enclosing function or contract in its DWARF line table, where solc leaves the same code unmapped in source maps. Two location-anchored inference paths broke on that difference:
fails_right_after_call/is_call_failed_errorcompare every post-CALL step location to the call site by strict equality. Under solc, unmapped helper instructions are skipped; under solx, the same instructions carry declaration-level locations (whose range merely contains the statement), so the heuristics bailed and the revert degraded toOtherExecutionErrorat the contract-declaration line.require(line 415 in the scenarios fixture) was reported at the function signature (line 420). Diagnosis showed the statement's real line is present in the line table — on the message-building instructions executed just before the revert — so this is recoverable EDR-side.Fix
Both fixes live in the solx strategy;
SolcTraceStrategyis behavior-identical (strict equality kept, new parameter ignored).TraceStrategy::locations_equivalent(step, reference): solx treats a step location that contains the reference (declaration-level padding) as "still at the statement"; solc keeps==. Used byis_last_location.TraceStrategy::revert_source_referencenow receives a lazystep_pcsthunk (same pattern asPanicHelperContext). When the reverting instruction sits on the function's declaration line,SolxTraceStrategywalks the executed steps back to the last statement-level location — therequire's message-building code keeps its own line.Effect (goldens flipped in
solx_stack_trace.rs)ReturndataSizeErrornow surfaces at the call site (LongTail.sol:47,ExpectsWord.callGet) for both the returndata-size mismatch and the typed call to a codeless account, replacingOtherExecutionErrorat the contract declaration. This is parity with the solc route: solc ≥ 0.8.10 emits no EXTCODESIZE probe for returndata-expecting calls either, so both routes classify the EOA case as a returndata failure. (A trueNoncontractAccountCalledErrorwould need a void-returning call scenario — future coverage.)require's line (415) instead of the declaration line (420) — removing the provider-level twin of the sweep's pinnedNestedModifierRevertTestdivergence. The sweep golden for that scenario will need updating when the sweep next runs against a linked plugin (its pinned line should move accordingly).Verification
solx_stack_trace.rs: 31/31 pass (the three flipped goldens broke in the improvement direction before the assertions were updated, everything else unchanged).edr_solidityunit tests: 77/77; fulledr_providerintegration harness: 198/198.No changeset: this is a pre-release fix to the solx DWARF feature introduced in #1425, covered by its changeset.
Also: the hardhat-tests CI failure on the feature branch
Second commit fixes the
Error: missing field 'remainder'failures in the "Run Hardhat tests" job (seen on both #1425's and #1552's CI): the solx routing inadd_compilation_resultdeserialized the compiler output into a struct with a literalremainderfield, so every existing caller — HH2/HH3 pass a bare standard-JSON output — crashed onhardhat_addCompilationResult. Replaced withedr_solidity::artifacts::parse_compiler_output, which peeks an optional top-levelcompilerTypefield on the same value (mirroring the build-info path'sPeekableCompilerType) and deserializes the whole output accordingly; absent/unknown → solc. Unit-tested against both fixture outputs. This commit is self-contained if it's preferred cherry-picked into #1425 directly, since it fixes that branch's red CI.