0xMiden / 0xMiden/protocol

Allow for more fee margin for multisig accounts

未關閉
#3,332 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
fees standards
主要語言
Rust
星號
132
分支
167
平均合併
1 天 23 小時
30 天內合併 PR
110

描述

With #3303, multisig fees are paid in a similar way to singlesig accounts: the tx summary commits to the fee note. We might want to change this in the future as described below:

Note: this is not an issue with flat fees, since the fee committed to in the tx summary will always cover the execution costs.

---

I think here the sequence would need to be different from how it works for single-sig. Specifically, we don't want to pay fees before `exec.multisig::auth_tx` is run. This is because multi-sig coordination may take significant amount of time (i.e., potentially days) and in this timeframe the fees could change.

I think the desired sequence would be:

1. Run a fee estimation procedure. This would give us the fee amount. For this, we'd probably need to split the `pay_fee` procedure into `estimate_fee` (to compute the fee w/o creating the fee note) and `pay_fee` that would internally use `estimate_fee` and then create the note.
2. Make some adjustments to this fee amount (e.g., multiply by 2). The adjustments could be passed in via the auth args.
3. Include the adjusted fee in the `TX_SUMMARY_COMMITMENT` - we can probably just override one of the `salt` values.
4. Collect signatures on this commitment (may take time).

Once the signatures are there, we'd execute the procedure again but this time:

1. We'd need to skip the fee estimation logic - but would still need to make sure we include the previous fee estimate in the `salt` (we should be able to communicate this via auth args)..
2. After `exec.multisig::auth_tx` run `pay_fee`. Would be good if `pay_fee` returned the asset that went into fee payment.
3. Verify that the asset that went into fee payment is not greater than the one we committed to in tx summary.

_Originally posted by @bobbinth in https://github.com/0xMiden/protocol/pull/3303#discussion_r3583173659_

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。