Skip to content

Commit

Permalink
Merge branch 'main' of github.com:lambdaclass/lambda_ethereum_rust in…
Browse files Browse the repository at this point in the history
…to fix_ef_test_parsing
  • Loading branch information
ilitteri committed Nov 21, 2024
2 parents 3e7ece3 + 29bda30 commit 50cf7af
Show file tree
Hide file tree
Showing 218 changed files with 3,214 additions and 1,311 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Run cargo clippy
run: |
cargo clippy --all-targets --all-features --workspace --exclude ethereum_rust-prover -- -D warnings
cargo clippy --all-targets --all-features --workspace --exclude ethrex-prover -- -D warnings
- name: Run cargo fmt
run: |
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Docker build

on:
workflow_call:

jobs:
docker-build:
name: Docker Build image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
load: true
tags: ethrex
outputs: type=docker,dest=/tmp/ethrex_image.tar

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ethrex_image
path: /tmp/ethrex_image.tar

41 changes: 10 additions & 31 deletions .github/workflows/hive_and_assertoor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,12 @@ env:
RUST_VERSION: 1.80.1

jobs:
docker-build:
name: Docker Build image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
load: true
tags: ethereum_rust
outputs: type=docker,dest=/tmp/ethereum_rust_image.tar

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ethereum_rust_image
path: /tmp/ethereum_rust_image.tar
build:
uses: ./.github/workflows/docker-build.yaml

run-hive:
name: Hive - ${{ matrix.name }}
needs: [docker-build]
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -67,7 +46,7 @@ jobs:
run_command: make run-hive-on-latest SIMULATION=devp2p TEST_PATTERN="/AccountRange|StorageRanges|ByteCodes|TrieNodes"
- simulation: eth
name: "Devp2p eth tests"
run_command: make run-hive SIMULATION=devp2p TEST_PATTERN="eth/getblockheaders|getblockbodies|transaction"
run_command: make run-hive SIMULATION=devp2p TEST_PATTERN="eth/status|getblockheaders|getblockbodies|transaction"
- simulation: engine
name: "Engine tests"
run_command: make run-hive-on-latest SIMULATION=ethereum/engine TEST_PATTERN="/Blob Transactions On Block 1, Cancun Genesis|Blob Transactions On Block 1, Shanghai Genesis|Blob Transaction Ordering, Single Account, Single Blob|Blob Transaction Ordering, Single Account, Dual Blob|Blob Transaction Ordering, Multiple Accounts|Replace Blob Transactions|Parallel Blob Transactions|ForkchoiceUpdatedV3 Modifies Payload ID on Different Beacon Root|NewPayloadV3 After Cancun|NewPayloadV3 Versioned Hashes|ForkchoiceUpdated Version on Payload Request"
Expand All @@ -78,12 +57,12 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ethereum_rust_image
name: ethrex_image
path: /tmp

- name: Load image
run: |
docker load --input /tmp/ethereum_rust_image.tar
docker load --input /tmp/ethrex_image.tar
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -102,24 +81,24 @@ jobs:
run-assertoor:
name: Assertoor - Stability Check
runs-on: ubuntu-latest
needs: [docker-build]
needs: [build]
steps:
- uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ethereum_rust_image
name: ethrex_image
path: /tmp

- name: Load image
run: |
docker load --input /tmp/ethereum_rust_image.tar
docker load --input /tmp/ethrex_image.tar
- name: Setup kurtosis testnet and run assertoor tests
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
kurtosis_version: '1.3.1'
ethereum_package_url: 'github.com/lambdaclass/ethereum-package'
ethereum_package_branch: 'ethereum-rust-integration'
ethereum_package_branch: 'ethrex-integration'
ethereum_package_args: './test_data/network_params.yaml'
51 changes: 51 additions & 0 deletions .github/workflows/hive_coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Daily Hive Coverage

on:
schedule:
# Every day at UTC midnight
- cron: '0 0 * * *'
workflow_dispatch:

env:
RUST_VERSION: 1.80.1

jobs:
build:
uses: ./.github/workflows/docker-build.yaml

hive-coverage:
name: Run engine hive simulator to gather coverage information.
runs-on: ubuntu-latest
needs: [build]
steps:
# TODO: Maybe this can be reused as well.
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: ethrex_image
path: /tmp

- name: Load image
run: |
docker load --input /tmp/ethrex_image.tar
- name: Checkout sources
uses: actions/checkout@v3

- name: Rustup toolchain install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}

- name: Setup Go
uses: actions/setup-go@v3

- name: Run Hive Simulation
run: make run-hive-on-latest SIMULATION=ethereum/engine
continue-on-error: true

- name: Caching
uses: Swatinem/rust-cache@v2

- name: Generate the hive report
run: cargo run -p hive_report
11 changes: 3 additions & 8 deletions .github/workflows/l2_prover_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
name: L2 Prover CI
on:
push:
branches: ["main"]
paths:
- "crates/l2/prover/**"
merge_group:
pull_request:
branches: ["**"]
paths:
- "crates/l2/prover/**"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -22,9 +17,9 @@ jobs:
matrix:
action:
- command: check
args: -p ethereum_rust-prover
args: -p ethrex-prover
- command: clippy
args: -p ethereum_rust-prover --all-targets --no-default-features
args: -p ethrex-prover --all-targets --no-default-features
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/loc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Weekly LoC

on:
schedule:
# Every Friday at midnight
- cron: "0 0 * * 5"
workflow_dispatch:

env:
RUST_VERSION: 1.80.1

jobs:
loc:
name: Count ethrex loc and generate report
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Rustup toolchain install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}

- name: Add Rust Cache
uses: Swatinem/rust-cache@v2

- name: Generate the loc report
run: make loc
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Cargo.lock
# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

cmd/ef_tests/ethereum_rust/vectors
cmd/ef_tests/ethrex/vectors
cmd/ef_tests/levm/vectors

# Repos checked out by make target
Expand All @@ -36,7 +36,7 @@ crates/levm_mlir/output
crates/levm_mlir/ethtests
crates/levm_mlir/*.tar.gz

# Ethereum Rust L2 stuff
# ethrex L2 stuff
volumes
jwt.hex

Expand Down
35 changes: 17 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,38 @@ members = [
"crates/vm",
"crates/storage/trie",
"crates/common/rlp",
"cmd/ethereum_rust",
"cmd/ef_tests/ethereum_rust",
"cmd/ethrex",
"cmd/ef_tests/ethrex",
"cmd/ef_tests/levm",
"cmd/ethereum_rust_l2",
"cmd/ethrex_l2",
"cmd/hive_report",
"crates/vm/levm",
"crates/vm/levm/bench/revm_comparison",
"crates/l2/",
"crates/l2/prover",
"crates/l2/contracts",
"crates/l2/sdk",
"cmd/loc",
]
resolver = "2"

default-members = [
"cmd/ethereum_rust",
"cmd/ethereum_rust_l2",
"crates/l2/prover",
]
default-members = ["cmd/ethrex", "cmd/ethrex_l2", "crates/l2/prover", "cmd/loc"]

[workspace.package]
version = "0.1.0"
edition = "2021"

[workspace.dependencies]
ethereum_rust-blockchain = { path = "./crates/blockchain" }
ethereum_rust-core = { path = "./crates/common" }
ethereum_rust-net = { path = "./crates/networking/p2p" }
ethereum_rust-rpc = { path = "./crates/networking/rpc" }
ethereum_rust-storage = { path = "./crates/storage/store" }
ethereum_rust-vm = { path = "./crates/vm" }
ethereum_rust-trie = { path = "./crates/storage/trie" }
ethereum_rust-rlp = { path = "./crates/common/rlp" }
ethereum_rust-l2 = { path = "./crates/l2" }
ethereum_rust-prover = { path = "./crates/l2/prover" }
ethrex-blockchain = { path = "./crates/blockchain" }
ethrex-core = { path = "./crates/common" }
ethrex-net = { path = "./crates/networking/p2p" }
ethrex-rpc = { path = "./crates/networking/rpc" }
ethrex-storage = { path = "./crates/storage/store" }
ethrex-vm = { path = "./crates/vm" }
ethrex-trie = { path = "./crates/storage/trie" }
ethrex-rlp = { path = "./crates/common/rlp" }
ethrex-l2 = { path = "./crates/l2" }
ethrex-prover = { path = "./crates/l2/prover" }

tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = "0.3.0"
Expand All @@ -65,6 +63,7 @@ rand = "0.8.5"
cfg-if = "1.0.0"
reqwest = { version = "0.12.7", features = ["json"] }
snap = "1.1.1"
k256 = { version = "0.13.3", features = ["ecdh"] }
secp256k1 = { version = "0.29", default-features = false, features = [
"global-context",
"recovery",
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
RUN cargo install cargo-chef

WORKDIR /ethereum_rust
WORKDIR /ethrex

FROM chef AS planner
COPY . .
# Determine the crates that need to be built from dependencies
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
COPY --from=planner /ethereum_rust/recipe.json recipe.json
COPY --from=planner /ethrex/recipe.json recipe.json
# Build dependencies only, these remained cached
RUN cargo chef cook --release --recipe-path recipe.json

Expand All @@ -27,7 +27,6 @@ RUN cargo build --release
FROM ubuntu:24.04
WORKDIR /usr/local/bin

COPY --from=builder ethereum_rust/target/release/ethereum_rust .
COPY --from=builder ethrex/target/release/ethrex .
EXPOSE 8545
ENTRYPOINT [ "./ethereum_rust" ]

ENTRYPOINT [ "./ethrex" ]
Loading

0 comments on commit 50cf7af

Please sign in to comment.