-
Notifications
You must be signed in to change notification settings - Fork 124
Description
We should enable users to set a tip on the transaction. Either an absolute value or a value relative to the fee computed in the epilogue.
I think we have the following pros and cons:
- A relative value may make it simpler for clients because they don't have to come up with an absolute tip value.
- A relative value would have to be taken out of the vault together with the computed fee (because we can only compute the absolute value when
compute_feehas calculated the fee), which means after the auth procedure has been invoked and so it won't be committed to by the standardTransactionSummary- in the current model. This might allow a malicious remote prover to modify this value (assuming it is provided via the advice provider). We could fix that by adding the relative value to the summary and therefore the commitment the user signs. - An absolute value doesn't require changes to the summary because we could remove it from the vault before the auth procedure is invoked and so its change would be part of the account vault delta by the time the tx summary is constructed.
- An argument in favor of absolute values is that in EIP-1559 it is possible to calculate the minimum tip that would incentivize miners to include transactions and so we should be able to calculate this as well, which would give clients a default value.
- An absolute value is (obviously) independent of the computed fee, which may be a good thing if the reference block is rather old and its base fees are outdated. If for whatever reason a newer ref block cannot be chosen, but a newer block header is known nonetheless, then an absolute value allows compensating for an outdated ref block.
Also for reference from #1673:
My initial thoughts that there would be a pay_tip (or something similar) procedure that would take an absolute amount (or, probably, a TIP_ASSET). The tip would be provided non-deterministically, and pay_tip would be called in the auth procedure before we generate a transaction summary (and so, it would be covered by the signature).
@bobbinth
Overall, I think I would agree and go with an absolute value, provided via the advice provider.
As mentioned by @bobbinth:
For network transactions, we'll need to come up with something else. Maybe here the tip could be proportional to the base fee, or maybe based on some other parameters (not sure what yet). In either case, there probably should be a mechanism for a network account to specify something like max_fee beyond which it is not willing to go.
Perhaps network accounts should be able to specify a relative value in their "configuration" (e.g. next to note script roots it is willing to accept). That would automate the interaction away for network accounts.
It would be nice if we had a single mechanism covering both local and network transactions. If we had only an absolute value mechanism in the tx kernel, then a way to automate this for the network transaction builder would be by dry-running the transaction, but that seems undesirable for efficiency reasons. cc @Mirko-von-Leipzig in case you have any thoughts.
Broken out of #1673