-
Notifications
You must be signed in to change notification settings - Fork 499
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
txnbuild: Make txnbuild create V1 transactions #2640
txnbuild: Make txnbuild create V1 transactions #2640
Conversation
7fa04a4
to
5f9cbba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Question: what's the reason that we use SourceAccount as MuxedAccount in V1 and SourceAccountEd25519 in V0? And what exactly is a MuxedAccount?
feeBumpTx, err := txnbuild.NewFeeBumpTransaction(txnbuild.FeeBumpTransactionParams{ | ||
Inner: tx, | ||
FeeAccount: feeBumpKP.Address(), | ||
BaseFee: txnbuild.MinBaseFee * 2, | ||
}) | ||
feeBumpTx, err = feeBumpTx.Sign(network.TestNetworkPassphrase, feeBumpKP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you skip checking these two errors on purpose? Same question to the below example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is mistake, I'll push a fix
The XDR definition for v1 transaction envelopes and v0 transaction envelopes have different source account types. The source account field is represented as a
This is another feature that is partially introduced in protocol 13. https://github.com/stellar/stellar-protocol/blob/master/core/cap-0027.md has the full explanation |
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
Currently,
txnbuild
creates v0 transaction envelopes which are accepted by both protocol 12 and protocol 13. In this PR, I have configuredtxnbuild
to only create v1 transactions which will only be accepted once protocol 13 is enabled.This release should only be published after pubnet transitions to protocol 13. However, developers who would like to try out protocol 13 features in testnet such as fee bump transactions can use the txnbuild package from this PR to generate v1 transactions.
Why
It is not possible to create fee bump transactions using v0 transaction envelopes.
Known limitations
Once this PR is merged there will be no way to generate v0 transaction envelopes anymore. However, I don't think this is a big concern because we will only publish this release once protocol 13 is enabled.