feat: preserve the signed envelope in the action log when a send fails - #2697
Open
Galmanus wants to merge 1 commit into
Open
feat: preserve the signed envelope in the action log when a send fails#2697Galmanus wants to merge 1 commit into
Galmanus wants to merge 1 commit into
Conversation
A failed `send_transaction_polling` returned early and lost the signed
(and possibly fee-bumped) envelope: the action-log write only ran after a
successful submit. For anything signed interactively — hardware wallet,
multisig — that means collecting every signature again just to retry.
On a send failure, both send paths now save the envelope as a new
`Action::SendFailed { envelope_xdr }` action-log entry (reusing the
existing hardened-file write with the RPC URL redacted) and print the
exact pipeline to resubmit it without re-signing via `stellar tx send`.
Saving is best-effort: a cache-write failure is logged at debug level and
never masks the original RPC error.
Fixes stellar#2609
Contributor
There was a problem hiding this comment.
Pull request overview
Preserves signed transaction envelopes after failed submissions so users can retry without re-signing.
Changes:
- Adds best-effort failed-envelope caching and recovery guidance.
- Introduces
SendFailedaction-log entries with distinct rendering. - Adds serialization and display coverage for the new action type.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cmd/soroban-cli/src/tx.rs |
Saves failed signed envelopes and prints retry instructions. |
cmd/soroban-cli/src/config/data.rs |
Adds and tests the SendFailed action type. |
cmd/soroban-cli/src/commands/tx/args.rs |
Preserves envelopes for failed transaction-operation sends. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Ok(id) => print.warnln(format!( | ||
| "The transaction failed to send, but the signed envelope was saved to the \ | ||
| action log and can be resubmitted without re-signing:\n \ | ||
| stellar cache actionlog read --id {id} | jq -r .action.send_failed.envelope_xdr | stellar tx send" |
|
|
||
| #[test] | ||
| #[serial] | ||
| fn test_send_failed_round_trips_and_renders_as_failed() { |
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
When
send_transaction_pollingfails, both send paths (tx.rs::sendandtx/args.rs::handle_tx) now save the signed envelope to the action log as a newAction::SendFailed { envelope_xdr }entry and print the exact pipeline to resubmit without re-signing:Why
Fixes #2609, following the direction in the issue discussion of extending the existing action-log machinery rather than adding a retry command. Previously the action-log write only ran after a successful submit, so a network hiccup after interactive signing (hardware wallet, multisig) lost the envelope and every signature had to be collected again.
Notes for review:
data::writepath — hardened file permissions, RPC URL redacted — the same guarantees the current action log provides.--no-cacheskips it entirely.Testing
test_send_failed_round_trips_and_renders_as_failed: the variant round-trips throughwrite/readunchanged andactionlog lsrenders a distinctSendFail/FAILEDrow. Uses the existingSTELLAR_DATA_HOME+#[serial]harness.cargo test -p soroban-cli --lib config::data::: 4 passed.cargo clippyandcargo fmt --checkclean.