-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIP-60][Discussion] Improve fairness of shared computation resources #298
Comments
@thepomeranian I understand that this AIP is meant to limit computation time per txn, however this limitation is enforced by gas amounts. I assume that the gas costs per operation do not correlate one-to-one with the execution time, so how do divergences from the mean play out? E.g. as I understand it some operation are priced at a discount to incentivize good programming practice (events, asserts), so does that mean that loop of event emissions (compared with a no-op loop) could actually exploit the divergence between time and cost? |
@thepomeranian How often does the problem occur? |
@alnoki In principle, (execution & IO) gas should be a faithful reflection of the execution time. In fact, it can be seen as a deterministic replacement of time measurement. In practice, such correlation cannot be perfect due to a few reasons
You are correct that such discrepancy can be exploited by an attacker, and we are working very hard on reducing it with better calibrations this quarter, so stay tuned. |
@vgao1996 thank you for the detailed responses here. I favor the approach of IO gas mapping generally to hardware costs on a "generic machine", and understand that the current gas calibration initiatives will be geared toward correlating costs to execution time as accurately as possible. |
@meetrick : for the just recently applied reduction in limits, it was rarely hit, and majority of times it was caused by inefficiency in the implementation. From analyzing mainnet transactions, further reduction will currently additionally affect aggressive batching some projects are doing. Reducing batch size should allow folks in general to keep below the limits. Overall, a lot of work can still be executed within these limits, and they shouldn't preclude complicated applications. If you have concrete examples where useful work becomes tight with new limits - it would be great it you can share it - and we can take a look, and together figure out how low the limits should go - so that useful work can always be comfortably executed. |
@alnoki Yes, this is exactly what we are planning to do with gas. |
AIP Discussion
Summary
Currently per-transaction max_execution_gas and max_io_gas limits allow single transaction to unfairly hog resources, and take ~1s to execute. Proposal is to reduce the limits to ~100ms short term, with target of 10ms mid-term.
Read more about it here: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-60.md
The text was updated successfully, but these errors were encountered: