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

feat: implement EIP-4844 #668

Merged
merged 34 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
aefca60
feat: point evaluation precompile
DaniPopes Aug 30, 2023
3342e99
feat: BLOBHASH opcode
DaniPopes Aug 30, 2023
92e627b
refactor: revme runner
DaniPopes Aug 30, 2023
37feea7
renames
DaniPopes Aug 30, 2023
9c048b4
export global kzg settings
DaniPopes Aug 31, 2023
bb0a0e6
feat: include kzg settings bytes with `include_bytes!`
DaniPopes Aug 31, 2023
f4dbaf9
build.rs: remove second option, update docs
DaniPopes Aug 31, 2023
7792a91
revme: remove unused files and dead code
DaniPopes Aug 31, 2023
71a29cb
feat: implement remaining block and tx env fields
DaniPopes Aug 31, 2023
16ff92c
Add tests for helper functions, update constants
DaniPopes Sep 1, 2023
8d94cc5
Add EIP-4844 EF tests to CI, skip outdated ones
DaniPopes Sep 1, 2023
44e5bea
chore: make skip_test more readable
DaniPopes Sep 1, 2023
25f0b83
Merge branch 'main' into eip-4844
DaniPopes Sep 1, 2023
85d25bc
Fix tests
DaniPopes Sep 1, 2023
8c02e4a
Fix fmt
DaniPopes Sep 1, 2023
9bda498
Fix lints, review
DaniPopes Sep 1, 2023
8efe07d
fix: validate new tx, block fields; add to balance check
DaniPopes Sep 1, 2023
9f046d7
Restore `load_access_list`
DaniPopes Sep 1, 2023
5b76449
chore: drop c-kzg fork
DaniPopes Sep 5, 2023
1aea2a4
test: update tests from Geth
DaniPopes Sep 5, 2023
a27a6b8
chore: revert `is_create` change
DaniPopes Sep 5, 2023
a82da3f
chore: fmt toml
DaniPopes Sep 6, 2023
9b8d3c0
chore: unnecessary import
DaniPopes Sep 6, 2023
7bf0578
Merge branch 'main' into eip-4844
DaniPopes Sep 11, 2023
31807d2
Merge remote-tracking branch 'origin/main' into eip4844
rakita Sep 14, 2023
ea2321f
remove unsafe from fake_exponential
rakita Sep 14, 2023
ce19006
Remove kzg global settings, and move it to CfgEnv
rakita Sep 14, 2023
3e6bf70
enable kzg only in std. main README updated
rakita Sep 14, 2023
798bc90
fmt and clippy
rakita Sep 14, 2023
bbfa7de
Merge remote-tracking branch 'origin/main' into eip4844
rakita Sep 14, 2023
54aad80
Update README.md
rakita Sep 14, 2023
8820a34
nits and docs
rakita Sep 15, 2023
ffda4fd
disable exception eip4844 tests, small refactor
rakita Sep 15, 2023
eb8b223
revert back last commit refactor
rakita Sep 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ethereum-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ jobs:

- name: Run Ethereum tests
run: |
cargo run --profile ${{ matrix.profile }} -p revme -- \
statetest \
ethtests/GeneralStateTests/ \
ethtests/LegacyTests/Constantinople/GeneralStateTests/ \
tests/EIPTests/StateTests/stEIP5656-MCOPY/ \
tests/EIPTests/StateTests/stEIP1153-transientStorage/
cargo run --profile ${{ matrix.profile }} -p revme -- statetest \
ethtests/GeneralStateTests/ \
ethtests/LegacyTests/Constantinople/GeneralStateTests/ \
ethtests/EIPTests/StateTests/stEIP1153-transientStorage/ \
ethtests/EIPTests/StateTests/stEIP4844-blobtransactions/ \
ethtests/EIPTests/StateTests/stEIP5656-MCOPY/
157 changes: 157 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ Here is a list of things that I would like to use as guide in this project:

# Project

structure:
Structure:
* crates
* revm -> main EVM library.
* revm-primitives -> Primitive data types.
* revm-interpreter -> Execution loop with instructions
* revm-precompile -> EVM precompiles
* bins:
* revme: cli binary, used for running state test json
* revm-test: test binaries with contracts, used mostly to check performance
* revme: cli binary, used for running state test jsons

Last checked revm requires rust v1.65 or higher for `core::error::Error`
Project tend to use the newest rust, so if there is a build error try first to run `rustup update`.
rakita marked this conversation as resolved.
Show resolved Hide resolved

There were some big efforts on optimization of revm:
* Optimizing interpreter loop: https://github.com/bluealloy/revm/issues/7
Expand All @@ -40,6 +39,8 @@ run tests with command: `cargo run --release -- statetest tests/GeneralStateTest

## Running benchmarks

TODO needs to be updated. Benches can now be found inside `crates/revm/benches`

```shell
cargo run --package revm-test --release --bin snailtracer
```
Expand All @@ -56,18 +57,23 @@ cargo run -p revm --features ethersdb --example fork_ref_transact

# Used by:

* Foundry: https://github.com/foundry-rs/foundry
* Helios: https://github.com/a16z/helios
* Hardhat (transitioning to it): https://github.com/NomicFoundation/hardhat/tree/rethnet/main
* Reth: https://github.com/paradigmxyz/reth
* Arbiter: https://github.com/primitivefinance/arbiter
* [Foundry](https://github.com/foundry-rs/foundry) is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
* [Helios](https://github.com/a16z/helios) is a fully trustless, efficient, and portable Ethereum light client written in Rust.
* [Reth](https://github.com/paradigmxyz/reth) Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol
* [Arbiter](https://github.com/primitivefinance/arbiter) is a framework for stateful Ethereum smart-contract simulation
* [Zeth](https://github.com/risc0/zeth) is an open-source ZK block prover for Ethereum built on the RISC Zero zkVM.
* ...

(If you want to add your project to the list, ping me or open the PR)
(If you want to add project to the list, ping me or open the PR)


# Documentation

To serve the mdbook documentation, ensure you have mdbook installed (if not install it with cargo) and then run:
The book can be found at github page here: https://bluealloy.github.io/revm/

The documentation (alas needs some love) can be found here: https://bluealloy.github.io/revm/docs/

To serve the mdbook documentation in a local environment, ensure you have mdbook installed (if not install it with cargo) and then run:

```shell
mdbook serve documentation
Expand Down
16 changes: 5 additions & 11 deletions bins/revme/src/cmd.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
use crate::{runner, statetest};
use crate::statetest;
use structopt::{clap::AppSettings, StructOpt};

#[derive(StructOpt, Debug)]
#[structopt(setting = AppSettings::InferSubcommands)]
#[allow(clippy::large_enum_variant)]
pub enum MainCmd {
Statetest(statetest::Cmd),
Run(runner::Cmd),
}

use thiserror::Error as ThisError;

#[derive(Debug, ThisError)]
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Statetest: {0}")]
Statetest(statetest::Error),
#[error("Generic system error")]
SystemError,
#[error(transparent)]
Statetest(#[from] statetest::Error),
}

impl MainCmd {
pub fn run(&self) -> Result<(), Error> {
match self {
Self::Statetest(cmd) => cmd.run().map_err(Error::Statetest),
_ => Ok(()),
Self::Statetest(cmd) => cmd.run().map_err(Into::into),
}
}
}
Loading