-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
test(vm): Test EVM emulator in multivm
crate
#3232
base: main
Are you sure you want to change the base?
Conversation
uint gasMultiplier = _isEvmTester ? 1 : 5; | ||
uint currentGas = gasleft(); | ||
if (_isEvmTester) { | ||
// FIXME: doesn't work for EraVM tester (~115k less gas is passed) |
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.
It should be the decommit cost
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.
I've thought about it as well. Is this cost emulated by the EVM emulator? My confusion with this explanation is that it doesn't match how decommits are priced in EraVM; the amount of the subtracted gas doesn't depend on whether the called contact is "cold" or "hot" (i.e., was previously decommitted; IIUC, in the latter case, the decommit cost should be 0). Note that both calls with default gas passed must be switched off; the second one calls a hot contract.
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.
Yes, this was implemented to somehow charge for decommits when we have EVM stipend (charge from the callee frame). So it was supposed to charge even if we are calling already "hot" contract, because EVM doesn't know about hot/cold accounts in EraVM context.
But if we remove EVM stipend, we can remove this as well, I guess. Decommit cost will be charged from the caller frame
What ❔
Adds basic low-level tests for the real EVM emulator.
Why ❔
EVM emulator functionality should be covered by tests.
Checklist
zkstack dev fmt
andzkstack dev lint
.