When working on contracts that are doing a lot of hashes (checking Merkle Tree Proofs), quite often I had to add “padding” to the program itself to avoid having an error that says that execution cost exceeded budget. I also recently added a check to Simplicity that would return an error before an “underpaid” transaction would reach a node:
I relied on the rust-simplicity’s functionality to get and check program’s budget:
The follow-up problem is how to automatically “grow” the tx size, so the tx fee would cover the execution cost. It is not possible to have a separate UTXO that would pay for the execution cost of another, because the budget is calculated per currently executed UTXO basis:
Before the annex padding is introduced, would be nice to have some other automatic mechanism. Though I am not sure whether it is better to leave as is, and have a guide that would help, or try to solve the problem in a different way.
Fundamentally, I cannot see a solution that is flexible and generic without it being implemented on the level of rust-simplicity.