-
Notifications
You must be signed in to change notification settings - Fork 773
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
Switching hardfork in VM overwrites the opcodes codes variable #591
Comments
Ah right. I should have checked the other issues first. For every VM it is indeed much cleaner if the opcode list is part of the VM =) I will close this issue. |
Actually it looks like the referenced PR does not create a new opcode list for every VM, so I will keep the issue open. |
Sorry for the confusion. I didn't mean that PR creates a new opcode list for every VM. I was just pointing to the PR that introduced this Now created #592 to address this issue. |
If you create a VM using
istanbul
and then create a VM usingpetersburg
you will get in thepetersburg
VM a VM which has (this is what I tested) set theSLOAD
gas cost 800 while it should be 200 (the original value). I suspect this also means that you can accessSELFBALANCE
andCHAINID
in the petersburg VM and that theEXTCODEHASH
andBALANCE
opcodes are gas priced the wrong way.The (clean) solution would be to give every VM their own
codes
list instead of pointing it to the "global" variablecodes
inlib/evm/opcodes.ts
.I quickly fixed this myself by adding this to
lib/evm/opcodes.ts
: (which is obviously a dirty solution)The text was updated successfully, but these errors were encountered: