-
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
EIP-2200: Structured Definitions for Net Gas Metering #2200
Conversation
@sorpaas do you plan to make the clarifications @nicksavers requested? |
Will do. Sorry for the delay. |
I re-ran test cases from 1283 with these new prices, here are the results sorpaas#1 (comment) |
I haven't got time to update this. I'm on vacation and got caught on some other stuff I'm working on. If people feel it's not ready, I'm okay to postpone this. However, personally I think there's only documentation work remain and everything else is already finished. |
@AlexeyAkhunov's proposalhttps://gitter.im/ethereum/AllCoreDevs?at=5d31988ae2d1aa6688d09f39
@sorpaas @AlexeyAkhunov I did quick analysis of @AlexeyAkhunov alternative proposal to charge min 2300 for SSTORE but add 1500 refund more. None of the EIPs list use cases for it, so I took a simple lock/mutex which is
@AlexeyAkhunov's proposal (let's call it variant 2) looks pretty solid because SSTORE / SLOAD will cost 800 now (I still have 200 in my mind). https://docs.google.com/spreadsheets/d/1l6HHVAEcmJyb76J-trNQQFD1lipjkBkl5-QYx3ME2mc/edit?usp=sharing This was previously sent to official discussion place for this EIP: sorpaas#1 (comment), but has received no feedback. |
I personally think that @AlexeyAkhunov 's proposal is the most elegant. So the variants are
All in all, I prefer the latter one, mainly since it's self-contained and does not cause new abstractions or quirks to be added in other places. |
I don't think anyone want to go with this one any more. As the original author I propose to cross it out for clarity. Others can always object and bring it back. |
Where is this proposal from @AlexeyAkhunov? Everyone's mentioning it, but I have no clue what it is. |
There is no formal spec. But summary is this:
I dug up the original message from gitter and put it in #2200 (comment). |
@chfast The original text of the EIP is |
Because you also need other instructions to provide arguments for SSTORE, you still will not be able to squeeze SSTORE in a call providing only 2300 gas. Just to keep the set of magic numbers in EVM small, I believe the value 2300 is ok this case. |
That proposal makes things quite funky. I've tried to integrate it into the EIP, someone please double check everything. We'll end up duplicating quite a few constants because now we need to take that +1500 gas into consideration on all code paths and compensate. My attempt(!) at updating the specDefinitions of constants are as below:
Replace SSTORE opcode gas cost calculation (including refunds) with the following logic:
|
Someone would really need to reproduce the entire test matrix for all the variations, otherwise we might end up with some path not being in line with the others. The +1500 addition to SSTORE means we need to compensate all the refunds and refund revertals properly.
|
cc @Arachnid Some feedback? ^ |
Hmm... Are you sure? I don't think so |
ช่วยตรวจสอบและแก้ไขในส่วนนี้ให้ผมที |
ping @nicksavers Are your comments addressed? |
This needs to be merged ASAP for Istanbul (already in progress) Edit: without this being merged, the EIP is not available at eips.ethereum.org |
Someone needs to tell me what I still need to fix at this moment. Otherwise I believe it's good to merge! |
@karalabe I don't think your version at #2200 (comment) is the same as the current spec. The current spec is basically EIP-1283 where all Please make sure Parity and Geth are implementing the same thing. |
@karalabe Looks like I misred. That comment you gave was based on another proposal and not related to the current spec. |
* Rebalance net-metered SSTORE gas cost with consideration of SLOAD gas cost change * Rename to EIP-2200 * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Copy sections from EIP-1283 and EIP-1706 to EIP-2200 * Fix spelling * Escape the "SSTORE" word * Make EIP1283/1706/1884 a link (as customary) * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md
* Rebalance net-metered SSTORE gas cost with consideration of SLOAD gas cost change * Rename to EIP-2200 * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Copy sections from EIP-1283 and EIP-1706 to EIP-2200 * Fix spelling * Escape the "SSTORE" word * Make EIP1283/1706/1884 a link (as customary) * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md
* Rebalance net-metered SSTORE gas cost with consideration of SLOAD gas cost change * Rename to EIP-2200 * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Copy sections from EIP-1283 and EIP-1706 to EIP-2200 * Fix spelling * Escape the "SSTORE" word * Make EIP1283/1706/1884 a link (as customary) * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md
* Rebalance net-metered SSTORE gas cost with consideration of SLOAD gas cost change * Rename to EIP-2200 * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Copy sections from EIP-1283 and EIP-1706 to EIP-2200 * Fix spelling * Escape the "SSTORE" word * Make EIP1283/1706/1884 a link (as customary) * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md * Update eip-2200.md
A repricing efforts for several trie-size-dependent opcodes are being carried out at EIP-1884. This EIP also reprices net-metered SSTORE opcode for EIP-1283.