Support fee bump transaction envelopes in tx hash - #2791
Open
neimasilk-arch wants to merge 1 commit into
Open
neimasilk-arch wants to merge 1 commit into
neimasilk-arch wants to merge 1 commit into
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make
stellar tx hashhash fee bump transaction envelopes, using the fee bump signature payload, instead of rejecting them withonly 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 signalready signs fee bump envelopes, but you couldn't get the hash of one fromtx hash. That hash is the one the network reports for the transaction.Testing
tx::tx_hash_fee_bumptest: wraps the existingTX_ENVELOPEfixture in a fee bump. It checks thattx hashmatches a SHA-256 of the fee bumpTransactionSignaturePayloadcomputed inside the test, and that the result differs from the inner transaction's hash.cargo test -p soroban-test --test it -- tx::passes.240e1aa4…c2d5on testnet) matchesTransactionBuilder.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