Skip to content

feat/add multi-operation transaction decoding - #416

Merged
codeZe-us merged 1 commit into
Toolbox-Lab:mainfrom
EmmyKay0026:decode_multi_operation_transaction
Aug 24, 2026
Merged

feat/add multi-operation transaction decoding#416
codeZe-us merged 1 commit into
Toolbox-Lab:mainfrom
EmmyKay0026:decode_multi_operation_transaction

Conversation

@EmmyKay0026

Copy link
Copy Markdown

Description

This PR adds full multi-operation transaction decoding support.

Grat now processes every operation in a transaction envelope instead of assuming the transaction contains a single InvokeHostFunction operation. Transactions containing classic Stellar operations and multiple Soroban operations now produce a separate diagnostic report for each operation.

How It Was Done

  • Added envelope-wide operation iteration for V0, V1, and fee-bump transactions.
  • Preserved the original operation index and order in all generated reports.
  • Added operation-specific decoding:
    • Soroban contract calls use FunctionCallDecoder.
    • Classic Stellar and other Soroban operations use structured XDR extraction.
  • Matched each operation with its corresponding XDR result.
  • Added support for transaction-level failures and operations that were not executed.
  • Distinguished operation failures from successful operations rolled back by atomic transaction failure.
  • Associated diagnostic and contract events with their relevant Soroban operation where possible.
  • Added clear Operation N/Total labels and operation metadata to diagnostic reports.
  • Added validation for out-of-range operation filters.
  • Added regression tests for classic operation success, missing results, and result-type mismatches.

Issues Encountered (If Any)

The local Rust compilation environment did not include gcc.exe, which is required to build the ring dependency under the configured GNU toolchain.

The implementation was kept strictly within the requested decoder files.

Related Issue

Closes #392

How It Was Tested

  • Added focused unit tests for:

    • Successful classic Stellar operations.
    • Missing operation results.
    • Mismatched operation and result types.
  • Ran cargo fmt --all -- --check successfully.

  • Ran git diff --check successfully.

  • Confirmed that only the requested decoder files were modified.

  • Full Cargo tests should be rerun in an environment with MinGW/GCC installed:

    cargo test -p grat-core --lib

Screenshots / Video (If Applicable)

Not applicable. This PR only changes core transaction decoding behavior.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 382372b7-d1f9-434f-b3b4-b2e8dda64904


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeZe-us
codeZe-us self-requested a review August 24, 2026 12:09
@codeZe-us

Copy link
Copy Markdown
Contributor

PR reviewed and merged

@codeZe-us
codeZe-us merged commit 34d3023 into Toolbox-Lab:main Aug 24, 2026
3 checks passed
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.

Grat Only Decodes the First Operation in Multi Operation Transactions

2 participants