-
Notifications
You must be signed in to change notification settings - Fork 826
EIP 6690: EVMMAX implementation #3816
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
base: master
Are you sure you want to change the base?
Changes from 3 commits
4f24ab4
7c85448
f830abc
3595599
6b5f895
58c2dae
553272e
40561c3
d827327
f76f420
d546bfb
70f3562
bb4fd1b
d432767
0074f51
006b104
164a358
00896bf
d0445a2
82a64c3
9e0f864
3685202
e93d62e
75eb7c8
cb042d3
ab5dbb2
cdab157
897f710
d3fe18e
278e800
38e2bad
91ee64f
12e83bb
c4e7198
88305d7
8f1c864
00e2930
135dceb
af34eae
89265bf
9d87011
cd88d03
e92a597
44decd3
1096460
64d4668
f2404b1
7ead43b
2d40d54
2517715
8bddbb4
47410f1
fe4646c
9c978c4
03336d1
40ed073
3503335
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -171,4 +171,7 @@ export const hardforksDict: HardforksDict = { | |
verkle: { | ||
eips: [4762, 6800], | ||
}, | ||
evmmax: { | ||
eips: [6690], | ||
}, | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,6 +210,14 @@ | |
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 commentThe 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) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed the declarations here and only left the ones in |
||
0xc1: asyncAndDynamicGasOp('LOADX'), | ||
0xc2: asyncAndDynamicGasOp('STOREX'), | ||
0xc3: asyncAndDynamicGasOp('ADDMODX'), | ||
0xc4: asyncAndDynamicGasOp('SUBMODX'), | ||
0xc5: asyncAndDynamicGasOp('MULMODX'), | ||
|
||
// '0xf0' range - closures | ||
0xf0: asyncAndDynamicGasOp('CREATE'), | ||
0xf1: asyncAndDynamicGasOp('CALL'), | ||
|
@@ -372,6 +380,19 @@ | |
0xee: asyncAndDynamicGasOp('RETURNCONTRACT'), | ||
}, | ||
}, | ||
{ | ||
eip: 6690, | ||
opcodes: { | ||
// control & i/o | ||
0xc0: asyncAndDynamicGasOp('SETMODX'), | ||
0xc1: asyncAndDynamicGasOp('LOADX'), | ||
0xc2: asyncAndDynamicGasOp('STOREX'), | ||
// arithmetic | ||
0xc3: asyncAndDynamicGasOp('ADDMODX'), | ||
0xc4: asyncAndDynamicGasOp('SUBMODX'), | ||
0xc5: asyncAndDynamicGasOp('MULMODX'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: for dynamic gas ops, a gas method should be provided in |
||
}, | ||
}, | ||
] | ||
|
||
/** | ||
|
@@ -436,7 +457,7 @@ | |
} | ||
|
||
for (const key in opcodeBuilder) { | ||
const baseFee = Number(common.param(`${opcodeBuilder[key].name.toLowerCase()}Gas`)) | ||
Check failure on line 460 in packages/evm/src/opcodes/codes.ts
|
||
// explicitly verify that we have defined a base fee | ||
if (baseFee === undefined) { | ||
throw new Error(`base fee not defined for: ${opcodeBuilder[key].name}`) | ||
|
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?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, currently 6 new opcodes are added upon evmmax activation.