Closed jayz22 closed 4 months ago
The cost to make a charge is quite small and this happens on a very expensive codepath; I'm not concerned about the cost. I agree such an interface might make for a bit of a correctness check (making sure that all the charges happen and none get left out) but .. it seems like it might be quite a bit of plumbing to accomplish, and even then wouldn't necessarily work long term since if we ever add an extension we'd need to runtime protocol-gate it, breaking the static (type-based) grouping.
Closing as not planned.
https://github.com/stellar/rs-soroban-env/pull/1359 introduced a pattern where several cost types have to be charged in group. Specifically those
ParseWasm*
andInstantiateWasm*
types (10 of them each) must always be charged together. In fact, only the first member in the each group contains the constant cost term that are shared by the group. A new method inBudget
that accepts an array ofCostType
s and inputs provides the following benefits:[ContractCostType; 10]
.