-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
EVM: SSTORE/SLOAD gas costs split into processing and storage costs #142
Comments
The figures above are given as a starting point for discussion. The specification on trie complexity might be entirely off and that invalidates the above. Based on the Yellow Paper, the processing fee is 5000 gas for SSTORE, because:
|
-15000 = -15050 + 50 |
@chfast thanks, updated! |
The 5000 cost for a value-changing SSTORE is meant to represent the cost to history growth and the Merkle tree recalculations. So it should definitely be much larger than an SLOAD. |
@chfast @vbuterin updated description to map the YP 1:1. Is there a sensible way to split up the 5000 to processing and storage costs?
|
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
Overview
Split the specified gas cost of
SSTORE
andSLOAD
to processing and storage cost elements.Specification
SSTORE
to have the following gas costs:i.e. setting to non-zero from zero is a total of 20000, while setting to zero is a refund of 10000. (No change here to current behaviour)
Rationale
Based on the Merkle Patricia Tree Specification, inserts and lookups should be the same complexity.
As
SLOAD
currently takes 50 gas to load (lookup), we can assume that is the processing cost for traversing the trie.SSTORE
should have the same cost for processing.Making this split now will be beneficial when blockchain rent needs to define the rent figures as opposed to the processing costs.
The text was updated successfully, but these errors were encountered: