Skip to content

Wrap large fee transactions with fee bump transaction#2382

Merged
mootz12 merged 12 commits into
mainfrom
add-fee-wrap
Feb 20, 2026
Merged

Wrap large fee transactions with fee bump transaction#2382
mootz12 merged 12 commits into
mainfrom
add-fee-wrap

Conversation

@mootz12
Copy link
Copy Markdown
Contributor

@mootz12 mootz12 commented Feb 10, 2026

What

  • Create a helper method for transaction simulation, signing, and sending logic
  • Wrap transaction in fee bump transaction if fee is larger than u32::MAX
    • Minor integration test organization for fee related tests
  • Add warning during tx simulate if transaction needs a fee bump transaction
  • Make logging more consistent across TX types

Output for fee bump transaction during invoke and other Soroban commands:

$ stellar contract invoke --inclusion-fee 2000 --resource-fee 4294967195 --id TEST -- set_data --value 2                                                                                                                               
ℹ️  Simulating transaction…
ℹ️  Signing transaction: b81bec30c4ea3769724b305926dd0eca4297f51c8af4bd32971f8f7f410706b5
⚠️  Wrapping transaction with a fee bump transaction due to a fee of 429.4971195 XLM.
ℹ️  Signing fee bump transaction: 878f3da8a9578f10fd6e786c74ddf408ccdf9056b753aa37f59df7898f030672
🌎 Sending transaction…
✅ Transaction submitted successfully!
🔗 https://stellar.expert/explorer/testnet/tx/878f3da8a9578f10fd6e786c74ddf408ccdf9056b753aa37f59df7898f030672
📅 CDT3IOTFNVCFL7UGBULSNPQF7HWZ4ISCO5YSZNOC76YL4UDZJQNG7PNG - Success - Event: TestEvent (test_event), topic: "data", data: 2

Output for simulation that exceeds u32::MAX:

$ stellar tx simulate AAAAAgAAAADnzmJ1TfL9/vrRDswUSxrxwnqYiElhLU1AHL9VkxpDvf///5sAAZqUAAAAHAAAAAAAAAAAAAAAAQAAAAAAAAAYAAAAAAAAAAHntDplbURV/oYNFya+BfntniJCd3EstcL/sL5QeUwabwAAAAhzZXRfZGF0YQAAAAEAAAADAAAAAgAAAAAAAAAAAAAAAA==
⚠️  The transaction fee of 858.9950377 is too large and needs to be wrapped in a fee bump transaction.
AAAAAgAAAADnzmJ1TfL9/vrRDswUSxrxwnqYiElhLU1AHL9VkxpDvQAAAAAAAZqUAAAAHAAAAAAAAAAAAAAAAQAAAAAAAAAYAAAAAAAAAAHntDplbURV/oYNFya+BfntniJCd3EstcL/sL5QeUwabwAAAAhzZXRfZGF0YQAAAAEAAAADAAAAAgAAAAAAAAABAAAAAAAAAAIAAAAGAAAAAee0OmVtRFX+hg0XJr4F+e2eIkJ3cSy1wv+wvlB5TBpvAAAAFAAAAAEAAAAHu0IxLmH9Swk39i9/ueSRuTbCBvufPF4Y2iwLm5y2ijsAAAABAAAABgAAAAHntDplbURV/oYNFya+BfntniJCd3EstcL/sL5QeUwabwAAAA4AAAAFa2V5XzEAAAAAAAABAAYjtgAAAAAAAABQAAAAAAAAPnMAAAAA

For the logging update, here is a standard invoke command:

$ stellar contract invoke --id P25 -- set_data --value 2                 
ℹ️  Simulating transaction…
ℹ️  Signing transaction: 161c6c55abe7000894c76d5288c8bfaaa4c8551e3892b422c794abc25d8a42e6
🌎 Sending transaction…
✅ Transaction submitted successfully!
🔗 https://stellar.expert/explorer/testnet/tx/161c6c55abe7000894c76d5288c8bfaaa4c8551e3892b422c794abc25d8a42e6
📅 CDT3IOTFNVCFL7UGBULSNPQF7HWZ4ISCO5YSZNOC76YL4UDZJQNG7PNG - Success - Event: TestEvent (test_event), topic: "data", data: 2

And the deploy from WASM file command:

$ stellar contract deploy --wasm ./target/wasm32v1-none/test-wasms/test_custom_account.wasm
ℹ️  Uploading contract WASM…
ℹ️  Simulating transaction…
ℹ️  Signing transaction: a9257b088a8b25921e38d1e64af90893020899b62ff7a6077beeb205a9d8163c
🌎 Sending transaction…
✅ Transaction submitted successfully!
🔗 https://stellar.expert/explorer/testnet/tx/a9257b088a8b25921e38d1e64af90893020899b62ff7a6077beeb205a9d8163c
ℹ️  Deploying contract using wasm hash 876a6321fa231cff3d760995cfb5a8947188dd6c49967baa5ef9f095870af9be
ℹ️  Simulating transaction…
ℹ️  Signing transaction: a881b41064c96c097d5d0f3723673ae0673642e5ab74fe38579d4880693a0bbe
🌎 Sending transaction…
✅ Transaction submitted successfully!
🔗 https://stellar.expert/explorer/testnet/tx/a881b41064c96c097d5d0f3723673ae0673642e5ab74fe38579d4880693a0bbe
🔗 https://lab.stellar.org/r/testnet/contract/CA6OERGEHWPN4OHLS7L2XDJGVSFE5Y24H2DAFEHX37GGFBOXY3G2LM62
✅ Deployed!
CA6OERGEHWPN4OHLS7L2XDJGVSFE5Y24H2DAFEHX37GGFBOXY3G2LM62

Why

Closes #2314

Known limitations

  • We currently have no way to notify user of transaction fees (or potentially have them acknowledge them). If the fees are high and they have the XLM, it will submit
  • The combined logic for transaction submission is likely doing some unnecessary work for commands like upload when attempting to sign soroban auth entries. Going to address this is a follow-up PR, but I think it is OK as is.

Copilot AI review requested due to automatic review settings February 10, 2026 14:20
@github-project-automation github-project-automation Bot moved this to Backlog (Not Ready) in DevX Feb 10, 2026
Comment thread cmd/soroban-cli/src/assembled.rs
@mootz12 mootz12 changed the title Add fee wrap Wrap large fee transactions with fee bump transaction Feb 10, 2026
Copy link
Copy Markdown
Contributor

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

Adds automatic fee-bump wrapping support to Soroban transaction submission flows so transactions with total fees exceeding u32::MAX can still be signed and sent, and surfaces a user warning during tx simulate when a fee bump would be required.

Changes:

  • Introduces a shared sim_sign_and_send_tx helper to centralize simulate → assemble → sign → send logic across multiple commands.
  • Updates assembly/signing to support fee-bump envelopes when required (fee > u32::MAX), including hashing/signing fee-bump transactions.
  • Reorganizes and extends integration tests around fee behavior, including validating fee-bump usage.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmd/soroban-cli/src/utils.rs Adds fee bump transaction hashing helper for signing.
cmd/soroban-cli/src/tx.rs Adds sim_sign_and_send_tx helper; wraps signed tx in fee bump when needed.
cmd/soroban-cli/src/signer/mod.rs Adds signing support for fee bump envelopes and refactors signing logic.
cmd/soroban-cli/src/resources.rs Expands allowable --resource-fee range to i64-scale values.
cmd/soroban-cli/src/config/mod.rs Adds sign_fee_bump for fee bump envelope signing.
cmd/soroban-cli/src/commands/tx/simulate.rs Emits warning when simulation indicates a fee bump is needed.
cmd/soroban-cli/src/commands/contract/{upload,restore,invoke,extend}.rs Switches to shared sim/sign/send helper.
cmd/soroban-cli/src/commands/contract/deploy/{asset,wasm}.rs Switches to shared sim/sign/send helper.
cmd/soroban-cli/src/assembled.rs Tracks required fee-bump fee and sets inner tx fee to 0 when overflow; updates unit tests accordingly.
cmd/crates/soroban-test/tests/it/integration/fees.rs Consolidates fee-related integration tests and adds fee bump coverage.
cmd/crates/soroban-test/tests/it/integration/fee_stats.rs Removes standalone fee stats integration test file (moved into fees.rs).
cmd/crates/soroban-test/tests/it/integration.rs Updates integration module list to use consolidated fees module.

Comment thread cmd/soroban-cli/src/resources.rs
Comment thread cmd/soroban-cli/src/assembled.rs Outdated
mootz12 and others added 2 commits February 10, 2026 09:29
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mootz12 mootz12 requested a review from a team February 10, 2026 14:56
Comment thread cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
Comment thread cmd/soroban-cli/src/commands/contract/upload.rs
Comment thread cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
@mootz12 mootz12 requested a review from fnando February 11, 2026 20:17
Comment thread cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
Comment thread cmd/soroban-cli/src/print.rs
Comment thread cmd/soroban-cli/src/commands/contract/deploy/wasm.rs
Comment thread cmd/soroban-cli/src/tx.rs Outdated
@mootz12 mootz12 requested a review from fnando February 12, 2026 21:52
Comment thread cmd/soroban-cli/src/assembled.rs Outdated
mootz12 and others added 2 commits February 20, 2026 09:26
@fnando fnando moved this from Backlog (Not Ready) to Needs Review in DevX Feb 20, 2026
@mootz12 mootz12 merged commit d5ea72b into main Feb 20, 2026
32 checks passed
@mootz12 mootz12 deleted the add-fee-wrap branch February 20, 2026 19:25
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in DevX Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow resource fees exceeding u32::MAX

3 participants