Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add seq_num as an option for transactions #1702

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

willemneal
Copy link
Member

No description provided.

@willemneal willemneal linked an issue Nov 5, 2024 that may be closed by this pull request
cmd/soroban-cli/src/fee.rs Show resolved Hide resolved
@willemneal willemneal self-assigned this Nov 5, 2024
Copy link
Member

@leighmcculloch leighmcculloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The impl is 💯, but I think we should shift this functionality into another place. See inline for the comment.

@@ -148,6 +148,7 @@ Deploy builtin Soroban Asset Contract
* `--cost` — Output the cost execution to stderr
* `--instructions <INSTRUCTIONS>` — Number of instructions to simulate
* `--build-only` — Build the transaction and only write the base64 xdr to stdout
* `--sequence-number <SEQUENCE_NUMBER>` — Optionally set the sequence number for the transaction; default is the current sequence number of the source account incremented by one
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After playing with this new option, I think we should change the design.

The new option is not really usable where it is in a meaningful way without being coupled with --build-only. The reason being is that any use where the tx will be sent immediately really just needs to use the current sequence number plus one. The only need for setting a different sequence number occurs when building and later sending.

Since the option is only usable in that advanced build-only case, I think we should make this something they can do with the stellar tx ... commands. It will keep the options advertised smaller for each of the subcommands being changed here, and keeps the advanced functionality for tx modifications in the same place. Maybe as a way to simply change a sequence number stellar tx set seq, where those commands could grow to support others like stellar tx set source-account. Or maybe by using the stellar tx edit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think stellar tx edit is a good place for this ^
We can also allow to modify the fee in tx edit

Copy link
Member

@leighmcculloch leighmcculloch Nov 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stellar tx edit was envisioned as a interactive editor, where I think the thing @willemneal is adding here is more of a non-interactive modification of the transaction. Both things have a place, and for the non-interactive modification I think it's helpful to think about the user api being modifying a single thing, similar to how stellar tx op add modifies one thing by adding a single tx and that's why I suggest a stellar tx set, something that is separate to the interactive modification.

@willemneal
Copy link
Member Author

I totally agree!

@leighmcculloch leighmcculloch marked this pull request as draft November 6, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Make seq num an option on tx
3 participants