-
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
EIP 6690: EVMMAX implementation #3816
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
Cool! Left three comments with some pointers :)
@@ -210,6 +210,14 @@ const opcodes: OpcodeEntry = { | |||
0xa3: dynamicGasOp('LOG'), | |||
0xa4: dynamicGasOp('LOG'), | |||
|
|||
// '0xf0' range - extended range/width modular arithmetic | |||
0xc0: asyncAndDynamicGasOp('SETMODX'), |
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 will add these opcodes as available from all EVMs at all hardforks (so these opcodes are now available at Frontier / Chainstart)
// arithmetic | ||
0xc3: asyncAndDynamicGasOp('ADDMODX'), | ||
0xc4: asyncAndDynamicGasOp('SUBMODX'), | ||
0xc5: asyncAndDynamicGasOp('MULMODX'), |
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.
Note: for dynamic gas ops, a gas method should be provided in gas.ts
, otherwise the Interpreter will crash (it expects an entry there if the opcode is marked as dynamic)
@@ -171,4 +171,7 @@ export const hardforksDict: HardforksDict = { | |||
verkle: { | |||
eips: [4762, 6800], | |||
}, | |||
evmmax: { | |||
eips: [6690], |
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 don't think we should do an evmmax
hardfork for this: if EVMMAX should be activated then the 6690 EIP should be activated (so instantiate a common and activate 6990 to use EVMMAX). I might have missed something from the EIP though. It seems to me that the EIP introduces new opcodes?
This change is a work in progress implementation of the evmmax opcodes as defined in the latest EIP 6690 spec along with the geth reference implementation.