mds1 / evm-diff

Diff EVM-compatible chains in a friendly format
https://evmdiff.com
MIT License
278 stars 27 forks source link

feat: add remaining mainnet opcodes and L2 diffs #19

Closed leovct closed 1 year ago

leovct commented 1 year ago

Edits

edit 1: just a few more opcodes... 🫠 edit 2: all mainnet opcodes have been added! it's time to add L2 opcodes now πŸ”₯ edit 3: all mainnet opcodes and diffs with arbitrum/optimism have been added πŸŽ‰

Description

Resolves #6 Resolves #16

This PR adds the remaining mainnet opcodes as well as L2 diffs for Optimism and Arbitrum.

It also makes a few changes:

Mainnet Opcode Tracker

Note: If no hard fork is specified next to an opcode, it means the opcode was added in the Frontier hard fork.

Arithmetic

Bitwise

Block

Comparison

Control Flow

Environment

Keccak

Log

Memory

Stack

Storage

System

L2 Opcode Tracker

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
evm-diff βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Jul 19, 2023 0:11am
leovct commented 1 year ago

The PR isn't ready yet but just to confirm I'm going in the right direction with these additional changes, wdyt @mds1?

leovct commented 1 year ago

Should we reference the opcode INVALID (0xFE) mentioned here https://www.evm.codes/#fe?fork=shanghai? It's not mentioned in https://github.com/ethereum/execution-specs.

mds1 commented 1 year ago

@leovct Yea let's include it. It looks that that opcode is here: https://github.com/ethereum/execution-specs/blob/03f0204e39ec98e456086407189f0ca3af277f68/src/ethereum/shanghai/vm/exceptions.py#L61-L66

But you're right I can't find the 0xfe reference for it, though I did find it in geth here: https://github.com/ethereum/go-ethereum/blob/c7b099b2ea58b3c2b594ae77b607142451ae9129/core/vm/opcodes.go#L221

0xfe is equivalent in functionality to any other undefined opcode, but the difference is 0xfe is guaranteed to remain undefined. I think this is mainly an off-chain consensus guarantee, which is probably why the execution-specs reason doesn't have it specified

leovct commented 1 year ago

@mds1 I've added the latest opcodes missing and the diffs between Arbitrum and Optimism so you can start reviewing if you want :)

I'm also doing a review on my side to make sure I didn't forget anything and that all the fields are properly formatted.