Wrap large fee transactions with fee bump transaction#2382
Wrap large fee transactions with fee bump transaction#2382
Conversation
| /// Create a transaction for restoring any data in the `restore_preamble` field of the `SimulateTransactionResponse`. | ||
| /// | ||
| /// # Errors | ||
| pub fn restore_txn(&self) -> Result<Option<Transaction>, Error> { | ||
| if let Some(restore_preamble) = &self.sim_res.restore_preamble { | ||
| restore(self.transaction(), restore_preamble).map(Option::Some) | ||
| } else { | ||
| Ok(None) | ||
| } | ||
| } |
There was a problem hiding this comment.
restore flow was dead code, so removed. Not necessary after P23
There was a problem hiding this comment.
we may need to reconsider this, and make sure we're trying restoring data: #2029 (comment)
There was a problem hiding this comment.
are we OK adding this back in that issue if it's needed? The code was unused.
There was a problem hiding this comment.
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_txhelper 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. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| } | ||
|
|
||
| if let Some(url) = utils::lab_url_for_contract(&network, &contract_id) { | ||
| print.linkln(url); |
There was a problem hiding this comment.
The generic sim_sign_and_send_tx only logs the block explorer transaction URL and "Transaction submitted successfully!". The contract-specific Lab URL is lost.
There was a problem hiding this comment.
Ah, misread this originally, thought this was just the stellar expert link.
Per comment on print.checkln("Deployed!");, updating both wasm and asset logs to do the following:
ℹ️ Deploying contract using wasm hash 47cc4c626c7a08aea93d4ee5287735bb8a218c46a6497831ac15d8539b4b6434
ℹ️ Simulating transaction…
ℹ️ Signing transaction: df074c8fbd3b5b3344fedb04f69b0a6d22fe4a100c272a42a7447425ec6a9449
🌎 Sending transaction…
✅ Transaction submitted successfully!
🔗 https://stellar.expert/explorer/testnet/tx/df074c8fbd3b5b3344fedb04f69b0a6d22fe4a100c272a42a7447425ec6a9449
🔗 https://lab.stellar.org/r/testnet/contract/CCOJXK5ASRFN6TU3EBTMVN4I6T4DLYNSPSNNOZ7RDWYLOGK6J7GXNIKT
✅ Deployed!
CCOJXK5ASRFN6TU3EBTMVN4I6T4DLYNSPSNNOZ7RDWYLOGK6J7GXNIKT
What
u32::MAXtx simulateif transaction needs a fee bump transactionOutput for fee bump transaction during
invokeand other Soroban commands:Output for simulation that exceeds
u32::MAX:For the logging update, here is a standard
invokecommand:And the
deployfrom WASM file command:Why
Closes #2314
Known limitations
uploadwhen attempting to sign soroban auth entries. Going to address this is a follow-up PR, but I think it is OK as is.