Skip to content
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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

EIP 6690: EVMMAX implementation #3816

wants to merge 13 commits into from

Conversation

scorbajio
Copy link
Contributor

@scorbajio scorbajio commented Dec 18, 2024

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.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.70%. Comparing base (4da1f03) to head (f830abc).

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 73.74% <ø> (ø)
blockchain 83.23% <ø> (ø)
client ?
common 89.98% <100.00%> (+0.05%) ⬆️
devp2p 71.95% <ø> (ø)
evm ?
genesis 100.00% <ø> (ø)
mpt 52.09% <ø> (-0.04%) ⬇️
rlp 95.11% <ø> (ø)
statemanager ?
tx 76.56% <ø> (ø)
util 72.81% <ø> (ø)
vm ?
wallet 79.67% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Member

@jochem-brouwer jochem-brouwer left a 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'),
Copy link
Member

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'),
Copy link
Member

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],
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants