Skip to content

Transaction Dashboard: Call stack trace tab#1821

Open
quietbits wants to merge 13 commits intomainfrom
tx-dash-call-stack
Open

Transaction Dashboard: Call stack trace tab#1821
quietbits wants to merge 13 commits intomainfrom
tx-dash-call-stack

Conversation

@quietbits
Copy link
Contributor

@quietbits quietbits commented Jan 21, 2026

  • Call stack trace view for transaction diagnostic events.
    • You can test by using any recent transaction ID on any network, then use the test sections to select the data source to view. This is for testing only and will be removed before the PR is merged.
image
  • Reusing some styles and pieces from PrettyJson because the use case here is slightly different (everything needs to work inline).
  • Params collapsing: we’re using the max params count (4), which is the only performant way to handle it. We can’t dynamically set them to fit on a single line because that would create too many size listeners on the page, making everything feel sluggish. This is not ideal, because for long params they would still wrap to the second line, but this is a compromise we need to make to keep the page snappy.
image

Copilot AI review requested due to automatic review settings January 21, 2026 19:57
@github-project-automation github-project-automation bot moved this to Backlog (Not Ready) in DevX Jan 21, 2026
@stellar-jenkins
Copy link

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new "Call Stack Trace" tab to the Transaction Dashboard that displays diagnostic events from Stellar transaction execution in a hierarchical, interactive view. The feature allows users to inspect contract function calls, events, parameters, and return values in chronological order with support for nested calls and error highlighting.

Changes:

  • Added new CallStackTrace component with collapsible view toggle and error state handling
  • Updated type definitions to support flexible diagnostic event formats
  • Added tab8, tab9, tab10 support to TabView component for future extensibility
  • Updated network limit configuration data for mainnet, testnet, and futurenet

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/types/types.ts Updated diagnosticEventsJson type to support DiagnosticEventJson array, AnyObject, or undefined
src/helpers/getTxResourceBreakdown.ts Added type assertion for diagnostic event data access
src/constants/networkLimits.ts Updated live_soroban_state_size_window values for all networks
src/components/TabView/index.tsx Extended TabView to support up to 10 tabs
src/app/(sidebar)/transaction-dashboard/styles.scss Added comprehensive styling for CallStackTrace component
src/app/(sidebar)/transaction-dashboard/page.tsx Integrated CallStackTrace tab into transaction dashboard
src/app/(sidebar)/transaction-dashboard/components/CallStackTrace.tsx New component for displaying call stack trace with test data

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 42 to 53
const [testDataId, setTestDataId] = useState<string>("");

const TEST_DATA: { [key: string]: DiagnosticEventJson[] } = {
soroSwap: TEMP_SS,
kale: TEMP_KALE,
longParams: TEMP_LONG_PARAMS,
someFailed: TEMP_MIXED,
allFailed: TEMP_FAILED,
};

const data = diagnosticEvents
? formatDiagnosticEvents(TEST_DATA[testDataId] || diagnosticEvents)
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Test data state and logic must be removed before merging. The testDataId state, TEST_DATA object, and the logic that overrides diagnosticEvents with test data (line 53) are for testing purposes only and should not be present in production code.

Copilot uses AI. Check for mistakes.
Comment on lines 361 to 429
{/* TODO: remove before merge */}
<div
style={{
border: "2px solid #c00",
display: "flex",
gap: "8px",
flexWrap: "wrap",
padding: 10,
alignItems: "center",
fontWeight: "bold",
color: "#c00",
}}
>
<span>FOR TESTING:</span>

<Button
variant="destructive"
size="sm"
onClick={() => setTestDataId("soroSwap")}
disabled={testDataId === "soroSwap"}
>
SoroSwap
</Button>

<Button
variant="destructive"
size="sm"
onClick={() => setTestDataId("kale")}
disabled={testDataId === "kale"}
>
Kale
</Button>

<Button
variant="destructive"
size="sm"
onClick={() => setTestDataId("longParams")}
disabled={testDataId === "longParams"}
>
Long params
</Button>

<Button
variant="destructive"
size="sm"
onClick={() => setTestDataId("someFailed")}
disabled={testDataId === "someFailed"}
>
Some failed
</Button>

<Button
variant="destructive"
size="sm"
onClick={() => setTestDataId("allFailed")}
disabled={testDataId === "allFailed"}
>
All failed
</Button>

<Button
variant="destructive"
size="sm"
onClick={() => setTestDataId("")}
disabled={testDataId === ""}
>
Clear
</Button>
</div>
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Test data and debugging UI must be removed before merging. This includes:

  • The entire test data section (lines 361-429) with the red border and test buttons
  • The TEMP_ constant imports (lines 20-24)
  • The TEST_DATA object and testDataId state (lines 42-50)
  • The logic that uses TEST_DATA to override diagnosticEvents (line 53)

These test utilities should not be present in production code.

Copilot uses AI. Check for mistakes.
Comment on lines 20 to 24
TEMP_FAILED,
TEMP_KALE,
TEMP_LONG_PARAMS,
TEMP_MIXED,
TEMP_SS,
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

Test data imports must be removed before merging. These TEMP_ constants (lines 20-24) are imported for testing purposes only and should not be present in production code. They are used in the test data section that needs to be removed.

Copilot uses AI. Check for mistakes.
@quietbits quietbits linked an issue Jan 21, 2026 that may be closed by this pull request
@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

@quietbits quietbits requested a review from jeesunikim January 21, 2026 22:11
| { type: "map"; value: FormattedMapEntry[] }
| { type: "literal"; value: string }
| { type: "ellipsis"; value: string }
| { type: undefined; value: unknown };
Copy link
Contributor

Choose a reason for hiding this comment

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

we can have an undefined formatted event data?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used in formatEventData function when we can't find the type. Should we set a different value? We can't make it optional, because the type prop is required.

// line 245
return { value: data, type: undefined };

@jeesunikim
Copy link
Contributor

jeesunikim commented Jan 27, 2026

I noticed that contract_id of fn_return doesn't appear in the UI. Showing which contract executed the function is informative. Any thoughts on this? I added a message in slack. The hash for this is 8d97067ae3595c100cd977a68f6980b0a43b4865e9b912ceac82d3b9c6528e1e on TESTNET

Screenshot 2026-01-26 at 4 02 37 PM

@leighmcculloch
Copy link
Member

One piece of feedback is that when I loaded up the page, the first place I went was the transaction subsection to look for the dashboard. But then after clicking around for a bit I realised that the dashboard was a separate page outside that section.

@leighmcculloch
Copy link
Member

The label for the transaction hash is Transaction Info, could we name it Transaction Hash?

@leighmcculloch
Copy link
Member

Couple things of note looking at the event view:

  1. It's not obvious that the first few items are topics. Could we introduce the word "topics" somewhere into that UI so that a developer looking at code and seeing "topics" and "data" will look at this and see a 1-1 vocab.
  2. The topic that shows "USDC" G... obfuscates that the string is not just the "USDC" or that the quotes aren't part of the string. I like that it linkifies the address. I'm wondering, given it is an asset address, maybe we could link directly to the asset page on stellar.expert, and retain the USDC:G... form and truncate that full form differently rather than separating the asset code from the issuer and truncating the issuer separately. Wdyt?
Screenshot 2026-01-27 at 10 51 28 am

@leighmcculloch
Copy link
Member

The state change view is AMAZING.

@leighmcculloch
Copy link
Member

The events view looks really nice.

One thing where my eyes start to lose focus and I get confused is where there are contract events at one level, and events at a sub-fn level in close proximity. They are not the easiest to differiate. I think because we're relying purely on narrow indenting to create the tree effect, it starts to lose effect once things get deeper.

From a design perspective do you think having connecting lines for sections or something like that would help for more complex graphs?

Screenshot 2026-01-27 at 10 55 49 am

@leighmcculloch
Copy link
Member

Do auth signatures also appear here, or on another tab when an auth signature (not tx signature) is present?

Screenshot 2026-01-27 at 11 03 12 am

@leighmcculloch
Copy link
Member

The fee breakdown is really nice. I love that it parallels the language used in the stellar-cli too and there's a consistency here that's so helpful for developers.
Screenshot 2026-01-27 at 11 04 29 am

* Adjust Tabs styling

* Call stack trace tabs text
@stellar-jenkins
Copy link

@janewang
Copy link
Contributor

@leighmcculloch I'm going to move some of your comments into tickets so that this PR can be cleaned up and merge.
#1835

@quietbits Could we link contract ID internally to Lab's contract explorer with contract ID already prepopulated?

@stellar-jenkins
Copy link


return {
callStack,
coreMetrics,
Copy link
Contributor

Choose a reason for hiding this comment

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

coreMetrics isn't being used in CallStackTrace. Does this need to be returned?

};
}

const { callStack, coreMetrics } = processEvents(dEvents);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here with coreMetrics. Where does this being used?

@jeesunikim
Copy link
Contributor

for all failed state, the first one isn't rendering in red
Screenshot 2026-02-04 at 5 57 49 PM

@jeesunikim
Copy link
Contributor

on some failed, the last failure state isn't highlighted
Screenshot 2026-02-04 at 7 28 08 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog (Not Ready)

Development

Successfully merging this pull request may close these issues.

Create visual rendering of diagnostic events

5 participants