Skip to content

feat(error-trace): parse enriched execute-only failure metadata#233

Merged
fakedev9999 merged 1 commit into
mainfrom
fakedev9999/error-trace-execute-enrich
Jun 23, 2026
Merged

feat(error-trace): parse enriched execute-only failure metadata#233
fakedev9999 merged 1 commit into
mainfrom
fakedev9999/error-trace-execute-enrich

Conversation

@fakedev9999

Copy link
Copy Markdown
Member

Summary

Adds parser support for enriched execute-only extra_data in
ErrorTrace::from_cluster_extra_data.

The parser now understands optional additive keys on the ExecutionResult JSON shape:

  • failure_message improves the trace message/details for Err(ExecutionError) failures.
  • exit_code populates ErrorTrace.exit_code for non-zero halt failures.

Old failure_cause-only payloads continue to parse as before.

Scope

This is parser support only. It does not emit enriched metadata by itself.

This does not capture guest panic message/location. Capturing that requires a separate
SP1 executor change to preserve guest stderr/panic output.

Validation

  • cargo test -p spn-network-types error_trace --lib

Comment thread crates/types/network/src/error_trace.rs Outdated
// improves the message/details when the producer supplies it.
if let Some(er) = parse_execution_result(raw) {
return Self::from_execute_failure_cause(er.failure_cause as i32);
let mut trace = Self::from_execute_failure_cause(er.failure_cause as i32)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This still drops enriched messages when failure_cause is 0. The cluster producer sends failure_message for Err(ExecutionError) paths that map to UnspecifiedExecutionFailureCause, so handle non-empty failure_message before returning None and let finalize() drop generic text.

Read optional additive keys (failure_message, exit_code) from the
ExecutionResult extra_data shape in from_cluster_extra_data:
- failure_message improves message/details (source/kind preserved)
- exit_code populates ErrorTrace.exit_code
- failure_cause-only payloads parse exactly as before
finalize() still redacts + bounds. Keep in sync with network-services copy.
@fakedev9999 fakedev9999 force-pushed the fakedev9999/error-trace-execute-enrich branch from 5fa86e8 to 27b6771 Compare June 23, 2026 09:57
@fakedev9999 fakedev9999 merged commit 8e58693 into main Jun 23, 2026
4 checks passed
@fakedev9999 fakedev9999 deleted the fakedev9999/error-trace-execute-enrich branch June 23, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants