-
Notifications
You must be signed in to change notification settings - Fork 14
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
Transaction structure can be simplified #2
Comments
Thanks for examining the specification! I agree we could be more explicit about the reasons for some of those choices. Both of the choices you're referring to were made to safely handle certain kinds of transaction failure. Since transaction failure causes all operations in that transaction to fail, these operations are separated into separate transactions to ensure that the failure of one of them does not cause the others to fail.
|
Thank you for explaining!
So is this a general problem in Stellar and one should never combine two createAccount operations in one transaction?
|
There's a lot of subtle correctness conditions required for it to work. The stellar documentation and execution semantics are poorly English specified so a lot of this understanding requires reading very closely and checking the code to confirm. If you want to simplify it, I recommend looking at my CAPs on deterministic accounts, relative timeouts, linear accounts, fee bumping, etc. Those will help reduce complexity substantially. Specifically, CAP7-8 address your concerns above. |
Thank you, @JeremyRubin. I coincidentally talked to @bartekn about CAP7 yesterday when discussing the starlight payment channel protocol. @danrobinson feel free to close this issue. I guess that adding some clarifying remarks to the protocol specification would be helpful for other implementers, though. Otherwise, they might have an urge to "optimize" and combine transactions. |
👍 |
After reading the protocol specification (starlight/starlight/doc/Protocol.md) I wonder why the following transactions cannot be combined:
The three
SetupAccountTx
can be combined into one single transaction that creates all the three accounts at once. This would simplify the specification, e.g., the following sentence would not be required anymore: "Specifically, the sequence number on the SetupAccountTx for the EscrowAccount must be higher than the sequence numbers on the other two transactions."The two settlement transactions
PaymentSettleWithGuestTx
andPaymentSettleWithHostTx
can be combined into one transaction that would look precisely likeCooperativeCloseTx
(only with a higher sequence number). This would also simplify the logic about the three transactionsSettleOnlyWithHostTx
,SettleWithGuestTx
,SettleWithHostTx
which can then also be combined into one transaction.The text was updated successfully, but these errors were encountered: