Skip to content

Conversation

simzzz
Copy link
Contributor

@simzzz simzzz commented Oct 2, 2025

Description

When calling debug_traceBlockByNumber for a block, and some transaction from the block hasn't made any calls, then null would be returned for that transaction. The result should be the root call object with an empty calls array instead of null. We build the root object from the same fields in the transaction object that would back the root call: from, to, value, gas, gasUsed, input, output/error (from transactionsResponse) and calls: [].

  • When actions are present, we use actionsResponse[0].call_type for type. When actions are absent, we infer type as "CALL" if to exists, otherwise "CREATE". Everything else matches the root call data.

Related issue(s)

Fixes #4386

Testing Guide

  1. Call debug_traceBlockByNumber for a block that contains a transaction with no calls
  2. Make sure result is an object with an empty calls array instead of null

Changes from original design (optional)

N/A

Additional work needed (optional)

N/A

Checklist

  • I've assigned an assignee to this PR and related issue(s) (if applicable)
  • I've assigned a label to this PR and related issue(s) (if applicable)
  • I've assigned a milestone to this PR and related issue(s) (if applicable)
  • I've updated documentation (code comments, README, etc. if applicable)
  • I've done sufficient testing (unit, integration, etc.)

@simzzz simzzz added this to the 0.73.0 milestone Oct 2, 2025
@simzzz simzzz self-assigned this Oct 2, 2025
@simzzz simzzz added the bug Something isn't working label Oct 2, 2025
@simzzz simzzz changed the title fix: fixes response to not be null when no calls fix: fixes debug_traceBlockByNumber response to not be null for a transaction with no internal calls Oct 2, 2025
Copy link

github-actions bot commented Oct 2, 2025

Test Results

 20 files  ±0  265 suites  ±0   20m 2s ⏱️ - 7m 41s
761 tests ±0  756 ✅ +1  5 💤 ±0  0 ❌  - 1 
777 runs  ±0  772 ✅ +1  5 💤 ±0  0 ❌  - 1 

Results for commit 07789e2. ± Comparison against base commit 256d146.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Oct 2, 2025

Codecov Report

❌ Patch coverage is 82.35294% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/relay/src/lib/debug.ts 82.35% 6 Missing ⚠️
@@            Coverage Diff             @@
##             main    #4440      +/-   ##
==========================================
+ Coverage   96.13%   96.20%   +0.07%     
==========================================
  Files         121      121              
  Lines       19941    19973      +32     
  Branches     1750     1760      +10     
==========================================
+ Hits        19170    19216      +46     
+ Misses        749      735      -14     
  Partials       22       22              
Flag Coverage Δ
config-service 98.80% <ø> (ø)
relay 91.21% <82.35%> (-0.02%) ⬇️
server 88.82% <ø> (ø)
ws-server 98.27% <ø> (+1.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/relay/src/lib/debug.ts 98.65% <82.35%> (-0.72%) ⬇️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@simzzz simzzz marked this pull request as ready for review October 2, 2025 13:51
@simzzz simzzz requested review from a team as code owners October 2, 2025 13:51
@simzzz simzzz requested a review from Ferparishuertas October 2, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong response when calling debug_traceBlockByNumber and a transaction from the block doesn't contain any calls
1 participant