--
You received this message because you are subscribed to the Google Groups "Stellar Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stellar-dev...@googlegroups.com.
To post to this group, send email to stell...@googlegroups.com.
Visit this group at https://groups.google.com/group/stellar-dev.
To view this discussion on the web visit https://groups.google.com/d/msgid/stellar-dev/87munlyy6s.fsf%40ta.scs.stanford.edu.
For more options, visit https://groups.google.com/d/optout.
David's proposal on "feeSource and feeMultipler" made me rethink the whole approach of applying fees in CAP-15. The main reason why we need CAP10/15 is that the fee is a part of the transaction itself, and it's impossible to update fee, as tx signatures automatically become invalid. But what if we could move the bump fee instruction to the tx envelope level?
struct TransactionEnvelope
{
Transaction tx;
DecoratedSignature signatures<20>;
union switch (int v)
{
case 0:
void;
case 1:
struct
{
// Account ID to charge fees
AccountID replaceFeeSourceAccount;
// the max fee the replaceFeeSourceAccount will pay
uint32 replaceFee;
// signatures from replaceFeeSourceAccount signers
DecoratedSignature replaceFeeSignatures<20>;
union switch (int v)
{
case 0:
void;
} ext;
} v1;
}
ext;
};
The signers of replaceFeeSourceAccount
sign a structure containing
replaceFee
valuereplaceFeeSourceAccount
itself.This approach is better than original CAP-15 as it eliminates the need to create and submit one more "bump-fee" transaction. Any user can update the original TransactionEnvelope
and submit it without modifying the transaction itself and its signatures. If the transaction stuck as a result of the insufficient fee specified on the transaction level or fee auction surge, it can be easily re-submitted by a user herself or some third-party service.
Comparing to the CAP-10 and latest David's proposal, managing fees on TransactionEnvelope
level rather than account level gives more flexibility and does not require additional account fields or separate entities.
The proposed approach doesn't require cardinal SDK changes. It appears to me like the simplest and extendable solution.
Drawbacks
The replace fee envelopes will contain up to 2x signatures and may require loading one more account (replaceFeeSourceAccount
), but comparing to CAP-15 it is more lightweight and potentially easier to implement.