Fantom-foundation / Norma

Integration project of Carmen and Tosca
GNU Lesser General Public License v3.0
2 stars 9 forks source link

Make gas costs of counter increments uniform #291

Closed HerbertJordan closed 3 days ago

HerbertJordan commented 3 days ago

This PR updates the Counter app such that each transaction has exactly the same gas-costs.

Before this change, the first increment from 0 to 1 cost 43.426 units of gas. Subsequent updates have been much cheaper, only consuming roughly 28.000 units of gas, since they do not have to pay extra for the allocation of a new storage location. However, each of those transactions was endowed with 50.000 units of gas.

Since Sonic's gas metering is based on the gas limits reported by transactions, not the actual gas consumption, running transaction mixes with counters introduced more than 40% unusable capacity. This made it difficult to build load cases targeting a specific throughput rate in Gas/s. With this change, this problem is resolved.