Analysis of different aggregation functions for EIP-8037 under different elasticity regimes

Thanks for these contributions to resolving the EIP-8037 failure modes and the provided elasticity analysis.

In my earlier work on Two-resource metered-gas equations for EIP-8037, I have explored the different metering functions we can employ in EIP-8037. Some of the ideas from that post can be worthwhile to review. One idea I explore is to apply a transfer function/pre-processing step before metering, to weigh up or down a resource when computing metered gas. Thus, users can consume a lot of state gas, while its contribution to metered gas still is kept moderate. The idea is to make it possible to retain scaling while state gas still has some price setting influence.

One specific example from the post is to apply the function

cumulative_gas_used = regular_gas_used + state_gas_used // DISCOUNT_FACTOR

with DISCOUNT_FACTOR=2. A higher DISCOUNT_FACTOR gives state gas a lower impact on metered gas. As the DISCOUNT_FACTOR approaches infinity, the model approaches the Burst model this post presents.

A transfer function can be applied before any specific metering function, such as average, max or the Euclidean norm. All functions can be deployed in an EIP-8011 setting. Coupling a transfer function with an asymmetric Euclidean norm could be suitable for preserving scaling, while retaining reasonable bounds on state creation. This could serve to make the outcome desirable under likely elasticities, and acceptable under more unlikely elasticities (which is the best we can hope for unless we implement EIP-8075).

A simple change would be to apply a transfer function but retain the (potentially asymmetric) max function under an EIP-8011 application, thus still bounding state creation under more unlikely elasticities. This would involve a very minor modification to the current EIP-8037 specification. I would however still like to stress that all of these solutions are somewhat unfortunate compromises that we are forced to seek out simply because we do not track state creation over time as in EIP-8075.

1 Like