- EELS is a reference implementation of Python’s execution layer.
- It is up to date with the mainnet.
- Fills out tests and passes existing tests.
- An example of an EIP implemented in EELS is given below.
introduction
After over a year of development, we’re excited to publicly present it
Ethereum implementation layer specifications (Commonly known as EELS.) EELS is a Python reference implementation of the core components of the Ethereum implementation client that focuses on readability and clarity. It is intended to be a spiritual successor to Yellow paper This is more convenient for programmers and updated with post-merge forks, EELS can populate and execute state tests, and keep track of the mainnet.1which is a great place for new EIPs.
EELS provides complete snapshots of the protocol at every fork – including upcoming ones – making it much easier to follow Easy investment plans (which only suggest changes) and production clients (which often mix multiple forks in the same code path.)
date
Starting in 2021, as a project of ConsenSys’ Quilt team and the Ethereum Foundation,
eth1.0-spec (as it was then known) was inspired by the intense frustration of having to decipher the obscure notation of yellow paper (Figure 1) to understand the specific behavior of EVM instructions.
Relying on success Consensus layer specifications,We set out to create a similar executable specification for the ,execution layer.
Present
Today, EELS can be consumed as Traditional Python repository And as Documents submitted. It’s still a bit rough around the edges, and doesn’t offer a lot of captions or English explanations of what the different pieces do, but that will come with time.
It’s just Python
Hopefully a side-by-side comparison of the yellow paper and the equivalent code from EELS will illustrate why EELS is a valuable complement to it:
while Figure 2 It may be easy to digest for academics, Figure 3 It is undoubtedly more natural for programmers.
Here is a video A detailed explanation of adding simple EVM instructions If that’s your kind of thing.
Writing tests
It’s worth repeating: EELS is just plain Python. It can be tested like any other Python library! In addition to full ether/tests Suite, we also have a selection of pytest the exams.
With a little help from Implementation specification testsAny tests written for EELS can also be applied to production clients!2
Show the differences
Having snapshots at every fork is great for smart contract developers showing up to learn the details of how EVM instructions work, but it’s not very useful for client developers themselves. For them, EELS can display the differences between forks:
Example EIP
EIP-6780 It is the first EIP to obtain Implementation of EELS Provided by the author, Ballet clouds! lets take alook.
First, we present A create_contracts Variant to EVM with transaction level scope:
@dataclass
class Environment:
caller: Address
block_hashes: List[Hash32]
origin: Address
coinbase: Address
number: Uint
base_fee_per_gas: Uint
gas_limit: Uint
gas_price: Uint
time: U256
prev_randao: Bytes32
state: State
chain_id: U64
+ created_contracts: Set[Address]
Second, we note the contracts created in each transaction:
+ evm.env.created_contracts.add(contract_address)
Finally, we adjust Self-destruction So it only works with the contracts mentioned in create_contracts:
- # register account for deletion
- evm.accounts_to_delete.add(originator)
-
+ # Only continue if the contract has been created in the same tx
+ if originator in evm.env.created_contracts:
+
+ # register account for deletion
+ evm.accounts_to_delete.add(originator)
+
future
We want EELS to become the default way to define core EIPs, the first place EIP authors go to prototype their proposals, and the best possible reference for how Ethereum works.
If you are interested in contributing or creating a prototype of your own EIP, join us on #to set Channel or grab an issue from our Store.
Footnotes
-
EELS does not implement peer-to-peer networking and therefore requires the production client to synchronize blocks.
-
he ran Implementation specification tests Against EELS it is still unstable. YMMV.
Get the latest news and announcements from the Ethereum Foundation. Ethereum can be used to codify, decentralize, secure and trade just about anything: voting, domain names, financial exchanges, crowdfunding, company governance, contracts and agreements of most kind, intellectual property, and even smart property thanks to hardware integration.
GIPHY App Key not set. Please check settings