Skip to content

Commit

Permalink
chore(core): change ethereum_rust to ethrex in code (lambdaclass#1215)
Browse files Browse the repository at this point in the history
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves lambdaclass#111, Resolves lambdaclass#222 -->
  • Loading branch information
jrchatruc authored Nov 20, 2024
1 parent 020e518 commit aefb130
Show file tree
Hide file tree
Showing 194 changed files with 743 additions and 757 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
18 changes: 9 additions & 9 deletions .github/workflows/hive_and_assertoor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
context: .
file: ./Dockerfile
load: true
tags: ethereum_rust
outputs: type=docker,dest=/tmp/ethereum_rust_image.tar
tags: ethrex
outputs: type=docker,dest=/tmp/ethrex_image.tar

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

run-hive:
name: Hive - ${{ matrix.name }}
Expand Down Expand Up @@ -78,12 +78,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 @@ -109,17 +109,17 @@ 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: 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'
4 changes: 2 additions & 2 deletions .github/workflows/l2_prover_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,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
2 changes: 1 addition & 1 deletion .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 Down
30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ 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",
"crates/vm/levm",
"crates/vm/levm/bench/revm_comparison",
"crates/l2/",
Expand All @@ -23,8 +23,8 @@ members = [
resolver = "2"

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

Expand All @@ -33,16 +33,16 @@ 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 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" ]
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ build: ## πŸ”¨ Build the client
cargo build --workspace

lint: ## 🧹 Linter check
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

SPECTEST_VERSION := v3.0.0
SPECTEST_ARTIFACT := tests_$(SPECTEST_VERSION).tar.gz
SPECTEST_VECTORS_DIR := cmd/ef_tests/ethereum_rust/vectors
SPECTEST_VECTORS_DIR := cmd/ef_tests/ethrex/vectors

CRATE ?= *
test: $(SPECTEST_VECTORS_DIR) ## πŸ§ͺ Run each crate's tests
cargo test -p '$(CRATE)' --workspace --exclude ethereum_rust-prover --exclude ethereum_rust-levm --exclude ef_tests-levm -- --skip test_contract_compilation --skip testito
cargo test -p '$(CRATE)' --workspace --exclude ethrex-prover --exclude ethrex-levm --exclude ef_tests-levm -- --skip test_contract_compilation --skip testito

clean: clean-vectors ## 🧹 Remove build artifacts
cargo clean
rm -rf hive

STAMP_FILE := .docker_build_stamp
$(STAMP_FILE): $(shell find crates cmd -type f -name '*.rs') Cargo.toml Dockerfile
docker build -t ethereum_rust .
docker build -t ethrex .
touch $(STAMP_FILE)

build-image: $(STAMP_FILE) ## 🐳 Build the Docker image

run-image: build-image ## πŸƒ Run the Docker image
docker run --rm -p 127.0.0.1:8545:8545 ethereum_rust --http.addr 0.0.0.0
docker run --rm -p 127.0.0.1:8545:8545 ethrex --http.addr 0.0.0.0

$(SPECTEST_ARTIFACT):
rm -f tests_*.tar.gz # Delete older versions
Expand All @@ -46,12 +46,12 @@ download-test-vectors: $(SPECTEST_VECTORS_DIR) ## πŸ“₯ Download test vectors
clean-vectors: ## πŸ—‘οΈ Clean test vectors
rm -rf $(SPECTEST_VECTORS_DIR)

ETHEREUM_PACKAGE_REVISION := c7952d75d72159d03aec423b46797df2ded11f99
ETHEREUM_PACKAGE_REVISION := 5b49d02ee556232a73ea1e28000ec5b3fca1073f
# Shallow clones can't specify a single revision, but at least we avoid working
# the whole history by making it shallow since a given date (one day before our
# target revision).
ethereum-package:
git clone --single-branch --branch ethereum-rust-integration https://github.com/lambdaclass/ethereum-package
git clone --single-branch --branch ethrex-integration https://github.com/lambdaclass/ethereum-package

checkout-ethereum-package: ethereum-package ## πŸ“¦ Checkout specific Ethereum package revision
cd ethereum-package && \
Expand All @@ -60,7 +60,7 @@ checkout-ethereum-package: ethereum-package ## πŸ“¦ Checkout specific Ethereum p

localnet: stop-localnet-silent build-image checkout-ethereum-package ## 🌐 Start local network
kurtosis run --enclave lambdanet ethereum-package --args-file test_data/network_params.yaml
docker logs -f $$(docker ps -q --filter ancestor=ethereum_rust)
docker logs -f $$(docker ps -q --filter ancestor=ethrex)

stop-localnet: ## πŸ›‘ Stop local network
kurtosis enclave stop lambdanet
Expand All @@ -71,7 +71,7 @@ stop-localnet-silent:
@kurtosis enclave stop lambdanet >/dev/null 2>&1 || true
@kurtosis enclave rm lambdanet --force >/dev/null 2>&1 || true

HIVE_REVISION := 421852ec25e4e608fe5460656f4bf0637649619e
HIVE_REVISION := fc6ddec210095e2369019e7f4ab2f9f38e35a8e8
# Shallow clones can't specify a single revision, but at least we avoid working
# the whole history by making it shallow since a given date (one day before our
# target revision).
Expand All @@ -95,13 +95,13 @@ TEST_PATTERN ?= /
# For example, to run the rpc-compat suites for eth_chainId & eth_blockNumber you should run:
# `make run-hive SIMULATION=ethereum/rpc-compat TEST_PATTERN="/eth_chainId|eth_blockNumber"`
run-hive: build-image setup-hive ## πŸ§ͺ Run Hive testing suite
cd hive && ./hive --sim $(SIMULATION) --client ethereumrust --sim.limit "$(TEST_PATTERN)"
cd hive && ./hive --sim $(SIMULATION) --client ethrex --sim.limit "$(TEST_PATTERN)"

run-hive-on-latest: setup-hive ## πŸ§ͺ Run Hive testing suite with the latest docker image
cd hive && ./hive --sim $(SIMULATION) --client ethereumrust --sim.limit "$(TEST_PATTERN)"
cd hive && ./hive --sim $(SIMULATION) --client ethrex --sim.limit "$(TEST_PATTERN)"

run-hive-debug: build-image setup-hive ## 🐞 Run Hive testing suite in debug mode
cd hive && ./hive --sim $(SIMULATION) --client ethereumrust --sim.limit "$(TEST_PATTERN)" --docker.output
cd hive && ./hive --sim $(SIMULATION) --client ethrex --sim.limit "$(TEST_PATTERN)" --docker.output

clean-hive-logs: ## 🧹 Clean Hive logs
rm -rf ./hive/workspace/logs
Loading

0 comments on commit aefb130

Please sign in to comment.