anoma / namada

Rust implementation of Namada, a Proof-of-Stake L1 for interchain asset-agnostic privacy

Home Page:https://namada.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enforcing fee payment on transactions

grarco opened this issue · comments

After merging #2627 the transactions are now executed in order without the need to split the wrappers from the wasm transactions which poses an issue when it comes to fee payment that wasn't there in the previous execution model. In process_proposal we verify that the signer of a tx has enough balance to pay the fees for that tx: unfortunately though, with the new logic, the fee payment executed by the wrapper txs are now interspersed with the execution of the wasm codes. These could be transactions modifying the balance of the fee payers of the next transactions, meaning that the result of the check performed in process_proposal isn't valid anymore.

A possible solution could be to somewhat mimic the previous execution model by first collecting all the fees due by the transactions in the block and only then execute the wasm codes. This though would require some major changes (once more) in the execution model.

Hmm - could we perhaps just simulate running the transactions in order when preparing the proposal, and drop any for which there is no longer enough balance?