-
Notifications
You must be signed in to change notification settings - Fork 772
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 1283 SSTORE #367
EIP 1283 SSTORE #367
Conversation
aebda60
to
9156243
Compare
If I got this correct I think the latest PR merge on the tests repository ethereum/tests#511 should contain various tests (primarily testing other functionality) implicitly testing the new gas prices. This is just three days old, we'll have to do a new release with an updated submodule of our own proxy testing module ( |
@holgerd77 Ah ok, great. I didn't realize they were just released. I'll update this PR and remove my tests once |
I just verified that #368 fixes many failing Constantinople state tests using this PR. Still many other failing tests that are dependent on the other open Constantinople PRs. |
Ok, I just released a new version of the |
Update: I would update the Side note: I thought of the labels |
@holgerd77 I'm updating ethereumjs-common to 0.6.0 now, but I'm trying to track down an error that I wasn't seeing before when I ran the Constantinople tests:
Will report back once I confirm things are okay to proceed. |
It looks like #369 is causing these errors. If that is expected behavior due to a dependency on other open PRs, then please proceed with the review/merge. |
current: function (cb) { runState.stateManager.getContractStorage(address, key, cb) } | ||
}, cb) | ||
} else { | ||
runState.stateManager.getContractStorage(address, key, cb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-constantinople logic seems to be cleanly separated, ok.
} else if (value.length !== 0 && found.length) { | ||
subGas(runState, new BN(runState._common.param('gasPrices', 'sstoreReset'))) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, clean separation of pre-constantinople SSTORE gas calculations.
// If current value equals new value (this is a no-op), 200 gas is deducted. | ||
subGas(runState, new BN(runState._common.param('gasPrices', 'netSstoreNoopGas'))) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First case of EIP, with return, ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second look, as far as I see it these both versions 1) first subGas() call, then blank return and 2) return subGas() on other occasions doesn't make any difference I assume (?). Won't make this a review blocker, but unless there are reasons for it I am not seeing right now this might be updated to be more consistent if there is the occasion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! This should be return subGas...
like in the rest of the code. This is stylistic and can be fixed later... not critical.
runState.gasRefund = runState.gasRefund.addn(runState._common.param('gasPrices', 'netSstoreResetRefund')) | ||
} | ||
} | ||
return subGas(runState, new BN(runState._common.param('gasPrices', 'netSstoreDirtyGas'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working down the various cases from the EIP and adding to the existing runState.gasRefund
variable. I assume this is correct since tests are passing here on a broad basis.
If there are smaller caveats or edge cases we can do subsequent PRs to correct once we have a clearer picture on the test runs and tests have stabilized more.
Hi Vinay, have now merged, thanks a lot that you took on this so quickly! 😄 Hmm, the new test failure caused by #369 wasn't intended, but we can then probably address this separately in a new PR, if you want you can file a new issue for that. No need to wait here since #369 is already merged anyhow and we will not do an imminent release on the VM. |
Short test result summary (ethereumjs-testing v1.2.3, submodule 9777827): Before:
After:
Really cool! 🏆 🏆 |
Woo hoo! 🙌 |
Depends on ethereumjs/ethereumjs-common#27.
Closes #354
I wasn't sure about the best way to test this PR since there aren't any EIP-1283 tests yet in ethereum/tests, so I created my own tests in
tests/constantinopleSstoreTest.js
until official tests are available. These tests are currently not being run in circleci. Ideas?