Skip to content

Support fee bump transaction envelopes in tx hash - #2791

Open
neimasilk-arch wants to merge 1 commit into
stellar:mainfrom
neimasilk-arch:fix/tx-hash-fee-bump
Open

neimasilk-arch wants to merge 1 commit into
stellar:mainfrom
neimasilk-arch:fix/tx-hash-fee-bump

Conversation

@neimasilk-arch

Copy link
Copy Markdown

What

Make stellar tx hash hash fee bump transaction envelopes, using the fee bump signature payload, instead of rejecting them with only transaction v1 is supported. v0 envelopes still return an error, now with a message that names the supported envelope types.

The command now calls the existing utils::transaction_env_hash, which already handles both v1 and fee bump envelopes.

Closes #2769

Why

tx sign already signs fee bump envelopes, but you couldn't get the hash of one from tx hash. That hash is the one the network reports for the transaction.

Testing

  • New tx::tx_hash_fee_bump test: wraps the existing TX_ENVELOPE fixture in a fee bump. It checks that tx hash matches a SHA-256 of the fee bump TransactionSignaturePayload computed inside the test, and that the result differs from the inner transaction's hash.
  • cargo test -p soroban-test --test it -- tx:: passes.
  • Manual check of the reproduction from the issue. The fee bump hash (240e1aa4…c2d5 on testnet) matches TransactionBuilder.fromXDR(xdr, Networks.TESTNET).hash() from @stellar/stellar-sdk.

Known limitations

v0 envelopes are still unsupported, as before.


I wrote this change with an AI coding assistant. I tested it locally and reviewed it before opening the PR.

🤖 Generated with Claude Code

`tx hash` unwrapped the input as a v1 transaction envelope and rejected
everything else with "only transaction v1 is supported", so the hash of a
fee bump transaction could not be computed even though `tx sign` already
signs fee bump envelopes. Hash the envelope with the existing
`transaction_env_hash`, which uses the fee bump signature payload for fee
bump envelopes, and keep returning an error for v0 envelopes.

Closes stellar#2769

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

tx hash fails on fee-bump transactions

1 participant