diff --git a/Makefile b/Makefile index 885b7ac02d..e39e62a08f 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ help: ## ๐Ÿ“š Show help for each of the Makefile recipes build: ## ๐Ÿ”จ Build the client cargo build --workspace +build-revm: ## ๐Ÿ”จ Build the client with revm as EVM + cargo build --workspace --features revm --no-default-features + lint: ## ๐Ÿงน Linter check cargo clippy --all-targets --all-features --workspace --exclude ethrex-prover -- -D warnings @@ -25,11 +28,18 @@ clean: clean-vectors ## ๐Ÿงน Remove build artifacts STAMP_FILE := .docker_build_stamp $(STAMP_FILE): $(shell find crates cmd -type f -name '*.rs') Cargo.toml Dockerfile - docker build -t ethrex . + docker build -t ethrex --build-arg "BUILD_FLAGS=${--features levm}" . + touch $(STAMP_FILE) + +STAMP_FILE_REVM := .docker_build_stamp_revm +$(STAMP_FILE_REVM): $(shell find crates cmd -type f -name '*.rs') Cargo.toml Dockerfile + docker build -t ethrex --build-arg "BUILD_FLAGS=--features revm" . touch $(STAMP_FILE) build-image: $(STAMP_FILE) ## ๐Ÿณ Build the Docker image +build-image-revm: $(STAMP_FILE_REVM) + run-image: build-image ## ๐Ÿƒ Run the Docker image docker run --rm -p 127.0.0.1:8545:8545 ethrex --http.addr 0.0.0.0 diff --git a/README.md b/README.md index cddfaf5676..c032ff7de1 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,11 @@ You now should be able to build the client: ```bash make build ``` +Disclaimer: We're using LEVM as the default EVM for Ethrex, if you wish to +build it with REVM support instead, you can use: +```bash +make build-revm +``` ### Database Currently, the database is `libmdbx`, it will be set up when you start the client. The location of the db's files will depend on your OS: diff --git a/cmd/ethrex/Cargo.toml b/cmd/ethrex/Cargo.toml index 05f707e54a..3959ba8b54 100644 --- a/cmd/ethrex/Cargo.toml +++ b/cmd/ethrex/Cargo.toml @@ -42,7 +42,8 @@ name = "ethrex" path = "./ethrex.rs" [features] -default = ["dep:ethrex-storage", "libmdbx"] +default = ["dep:ethrex-storage", "libmdbx", "levm"] +revm = [ "dep:ethrex-storage", "libmdbx" ] dev = ["dep:ethrex-dev"] metrics = ["ethrex-blockchain/metrics", "ethrex-l2/metrics"] libmdbx = ["dep:libmdbx", "ethrex-storage/libmdbx"] diff --git a/cmd/ethrex/ethrex.rs b/cmd/ethrex/ethrex.rs index 10dec719b6..0c96732b65 100644 --- a/cmd/ethrex/ethrex.rs +++ b/cmd/ethrex/ethrex.rs @@ -385,12 +385,11 @@ fn import_blocks(store: &Store, blocks: &Vec) { if let Some(last_block) = blocks.last() { let hash = last_block.hash(); cfg_if::cfg_if! { - if #[cfg(feature = "levm")] { - // We are allowing this not to unwrap so that tests can run even if block execution results in the wrong root hash with LEVM. - let _ = apply_fork_choice(store, hash, hash, hash); + if #[cfg(feature = "revm")] { + apply_fork_choice(store, hash, hash, hash).unwrap(); } else { - apply_fork_choice(store, hash, hash, hash).unwrap(); + let _ = apply_fork_choice(store, hash, hash, hash); } } } diff --git a/crates/vm/levm/Makefile b/crates/vm/levm/Makefile index 02c7f2a73a..d6758bcc60 100644 --- a/crates/vm/levm/Makefile +++ b/crates/vm/levm/Makefile @@ -115,11 +115,9 @@ build-revm-comparison: ###### Build Client with LEVM ###### -FLAGS := "--features ethrex-blockchain/levm,ethrex-vm/levm,ethrex/levm" - build-image-levm: ## ๐Ÿณ Build the Docker image with LEVM features cd ../../../ && \ - docker build -t ethrex --build-arg BUILD_FLAGS=$(FLAGS) . + docker build -t ethrex . run-hive-debug-levm: build-image-levm ## ๐Ÿ Run Hive with LEVM in debug mode $(MAKE) -C ../../../ setup-hive