This EIP introduces the EOF container. This includes an EOF header and several EOF sections (code, data, types). This sets up the scene to allow for EVM interpreters to interpret EOF contracts differently than legacy contracts.
EIP-3670: Code validation
This is the first EIP that uses the EOF container. It constricts code by validating certain properties such as (some come from later EOF EIPs):
* no deprecated/undefined op
* code ends in "terminating" op
* jumps are valid
* function calls are valid
EIP-4200: Static relative jumps
New control flow operations are added, RJUMP + RJUMPI. These ops take an operand (like PUSH) which points to a code location relative to the op to jump to. It costs less than its JUMP counterpart, because validation only needs to happen once.
EIP-4750: Functions
More control flow operations are added, CALLF and RETF. This introduces the concept of EVM functions aka subroutines. With this + 4200, we can fully remove dynamic jumps (JUMP/JUMPI).
It also introduces type sections which essentially define the function signature. Since there is only 1 type in the EVM (uint256), the signature is just a tuple of inputs and outputs.
A big win from this EIP is better static analysis + no more JUMPDEST analysis (expensive).
EIP-5450: Stack validation
The last EIP of EOF introduces a static validation requirement for the stack. Currently, each loop of the interpreter must determine if the op it is about to execute will underflow/overflow.
With 5450, the code will be analyzed at deployment to determine the "maximum stack size" (MSS) for each code section and determine if any underflows occur. The contract deployment would fail if an underflow is encountered.
The MSS for each function is later used to extricate the interpreter of checking overflows at each op. Instead, the potential for overflow is only checked when changing code sections with CALLF. This will marginally improve the speed of the interpreter loop.
Generally speaking- the stricter requirements of validation are expected to improve the performance of interpreter-based EVMs and make the EVM more amenable to JIT compilation of bytecode.
Not only will it bring substantial improvements to the EVM on introduction; it also finally adds versioning to EVM code.
Although it is just the beginning of EOF, I am excited to see what an "upgradable" EVM will allow us to do. I can already imagine that it can improve the experience of working with L2s that aren't perfectly EVM-compatible.
There could be some reserved "L2 versions" of EOF where L2s can experiment - but at the same time provide an L1 EVM version with identical semantics.
If you are able to, please review the EOF EIPs and share any feedback on their respective eth magicians threads. The exact set of EIPs in Shanghai is still being determined, but community support of EOF can go a long way.
There is an EOF breakout room with core developers tomorrow where we'll discuss a few open questions: github.com/ethereum/pm/is…
After the merge, there will be a much larger faction of "at home" block producers than we've seen under proof-of-work. In order for these independent stakers to extract MEV, we need to think differently about our approach to block production (thread).
First, let's recap how MEV is extracted today.
There are many actors in this game, but we can roughly distill the interaction down to three: searchers, builders, and miners.
The searcher's goal is to extract MEV from txs. When they find a vulnerable tx, they package it with their own tx that does the extraction. This bundle is often referred to as a "fragment". The searcher sends their fragments to the builder to be aggregated.
The design space for protocol upgrades that improve the user experience on Ethereum is large, however, there are two categories that I believe deserve most of our attention (thread).
These categories can be deduced by working backwards from the types of accounts available today, and the functionality each of them provide.
It's also important to note _why_ UX in Ethereum tends to be so poor:
Authentication is a critical building block for smart contracts. There needs to be a secure way to know "account X is okay with Y happening". Developers have turned to `msg.sender` for this functionality.
Ethereum clients currently store 275 GB of historical data that is unnecessary to validate the chain. That number is growing at a rate of around 140 GB per year. EIP-4444 proposes clients prune data older than 1 y/o.
So why don't we just prune the data already?
To understand why the data has yet to be pruned and why this is even a discussion, it's important to understand how historical data is used today. There are two main categories of usage: syncing and user requests over JSON-RPC.
In the world of syncing, there are two main approaches:
- Full sync - from genesis, download every block & execute it until tip of chain is reached.
- State sync - many schemes here, but essentially header sync using PoW checks and then download the state for the latest block.
How much does the storage refund need to decrease before you start using a different value to represent 0?
The London hard fork in July will almost certainly modify the behavior of refunds. There have been several iterations, but the latest is EIP-3529: Reduction in refunds.
I recommend reading the EIP as it is very thorough and explains the past proposals, however the main case we care about for this thread is setting a nonzero storage element to zero and the refund that incurs.
In the last month, users spent $23,830,482 on ERC-20 approvals. EIP-3074 would reduce that number by at least 30%, saving users millions while freeing up block space (thread).
Anyone whose nonce is greater than ten has likely experienced the approve+transfer flow that defi applications use to interact with ERC-20 tokens. The approve method is a relic of the original ERC-20 design.
There have been many attempts to alleviate the burden of token approvals, but none have succeeded. We believe EIP-3074 will resolve the issue because it addresses the two problems that have beleaguered other approaches.
Ethereum wallets may be getting a significant upgrade soon. With the proposed change, EOAs will immediately be able to send batch txs, expiring txs, unordered txs, and more. (thread)
My colleagues, @_SamWilsn_ and @adietrichs, and I have been working on improving the UX of interacting with Ethereum. After many iterations, we've come up with EIP-3074: AUTH and AUTHCALL opcodes.
To use these opcodes, an EOA signs a message off-chain, provides the message to a relayer, the relayer passes the signature and calldata to a contract on-chain (called an invoker), the contract verifies the signature using AUTH, and then relays the EOA's call with AUTHCALL.