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: release taiko reth v1.0.0 #12

Draft
wants to merge 144 commits into
base: v1.0.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
8ee7b80
init commit
johntaiko Mar 12, 2024
2209fb4
Update t8n command arguments and parsers
johntaiko Mar 13, 2024
2195995
Refactor t8n command arguments and execution
johntaiko Mar 13, 2024
d139b4d
Refactor t8n command and provider module
johntaiko Mar 13, 2024
7ec3960
Refactor t8n command and update visibility of utility functions
johntaiko Mar 13, 2024
f9c6c8c
feat: Add is_anchor field and functions
petarvujovic98 Mar 13, 2024
04f026d
feat: Add taiko block attributes builder
petarvujovic98 Mar 13, 2024
9009c5a
[WIP]: Start work on Taiko block builder
petarvujovic98 Mar 13, 2024
8fe5634
Add thiserror crate to dependencies
johntaiko Mar 14, 2024
b5624c2
Add rlp crate and implement StateAccount struct
johntaiko Mar 14, 2024
0062b0d
Merge branch 'feat/support_t8n_and_taikop' of gh_work:taikoxyz/reth i…
johntaiko Mar 14, 2024
138e603
Remove unused dependencies and dead code
johntaiko Mar 14, 2024
ab178d6
[WIP]: Make progress on block building
petarvujovic98 Mar 14, 2024
d3da37b
Fix serialization issue and update dependencies
johntaiko Mar 14, 2024
955f5e9
Merge branch 'feat/support_t8n_and_taikop' of gh_work:taikoxyz/reth i…
johntaiko Mar 14, 2024
dd15fd2
[WIP]: Configure payload builder for Taiko node
petarvujovic98 Mar 14, 2024
72c2e52
feat: Add TaikoExecutionPayload export
petarvujovic98 Mar 15, 2024
f78b1e5
feat: Add anchor validation after block building
petarvujovic98 Mar 15, 2024
c57446a
feat: Add TaikoExecutionPayload as payload for on_new_payload handler
petarvujovic98 Mar 15, 2024
dbcfc28
feat: Allow same timestamp as parent
petarvujovic98 Mar 15, 2024
c925049
fix: Fix compiler errors
petarvujovic98 Mar 19, 2024
54a9783
chore: Rename node
petarvujovic98 Mar 20, 2024
4b6a2bc
refactor: Move block metadata and l1 origin structs into primitives
petarvujovic98 Mar 20, 2024
fc73efa
feat: Add stub implementations for taiko extended API
petarvujovic98 Mar 20, 2024
3a67414
fix: Enhance the EthApi trait with Taiko APIs
petarvujovic98 Mar 20, 2024
8cd32bc
feat: Add TxPoolContent API handler
petarvujovic98 Mar 20, 2024
382010d
feat: Add Taiko genesis and chain spec
petarvujovic98 Mar 20, 2024
3564fd1
fix: Put taiko features behind compilation flags
petarvujovic98 Mar 20, 2024
8197581
chore: Rename structs and update export from payload builder
petarvujovic98 Mar 21, 2024
a9ca112
feat: Add consts to finalize anchor validation
petarvujovic98 Mar 22, 2024
a5692d1
refactor: Update transaction iteration
petarvujovic98 Mar 22, 2024
6e0abb2
fix: Fix compile errors
petarvujovic98 Mar 22, 2024
b5928a9
feat: Update attributes definition
petarvujovic98 Mar 27, 2024
02c6277
feat: Add taiko related tables to database
petarvujovic98 Mar 27, 2024
1cbc438
feat: Add L1 Origin writing and reading
petarvujovic98 Mar 27, 2024
cf82cce
feat: Implement L1 origin related API handlers
petarvujovic98 Mar 27, 2024
060538d
feat: Handle L1 origin tables
petarvujovic98 Mar 28, 2024
b352771
chore: Remove unused imports
petarvujovic98 Mar 28, 2024
847e1eb
feat: Use bytes to store L1 origin
petarvujovic98 Mar 28, 2024
b6a8954
feat: Implement L1 origin traits for tests
petarvujovic98 Mar 28, 2024
b449c18
fix: Map errors to correct type
petarvujovic98 Mar 28, 2024
153a80f
chore: Remove contractName field from json
petarvujovic98 Mar 29, 2024
d100cfd
feat: Expose chain specs
petarvujovic98 Mar 29, 2024
a6eef4c
feat: Add taiko payload and taiko-reth binary
petarvujovic98 Mar 29, 2024
60073ef
chore: Remove tx_pool_content function until clear
petarvujovic98 Apr 2, 2024
9037ef4
refactor: Add get_txs closure
petarvujovic98 Apr 2, 2024
c4517c0
Merge branch 'taiko' into feat/support_t8n_and_taikop
petarvujovic98 Jun 11, 2024
b485e2e
chore: Update code based on upstream changes
petarvujovic98 Jun 12, 2024
04096c8
Merge branch 'taiko' into feat/support_t8n_and_taikop
petarvujovic98 Jun 12, 2024
41823f0
feat: Move taiko features to separate rpc module
petarvujovic98 Jun 12, 2024
786c58b
Merge branch 'v1.0.0' of gh_work:taikoxyz/taiko-reth into HEAD
johntaiko Jul 3, 2024
eb55ad2
fix: taiko features
johntaiko Jul 3, 2024
191e810
feat: Add reth-chainspec and reth-rpc-types-compat as optional depend…
johntaiko Jul 3, 2024
816207f
chore: add a taiko specify crate
johntaiko Jul 4, 2024
d34e437
feat: Add reth-chainspec and reth-rpc-types-compat as optional depend…
johntaiko Jul 4, 2024
1a6f6c1
feat: add taiko feature in revm crate
johntaiko Jul 5, 2024
272cf6e
feat: support taiko evm executor
johntaiko Jul 5, 2024
c0e85e3
improve: relocate the L1Origin codes
johntaiko Jul 5, 2024
b8c1cd0
feat(chainspec): add mainnet and hekla
johntaiko Jul 5, 2024
6c825b0
improve: relocate taiko payload codes
johntaiko Jul 5, 2024
0f58177
improve(primitives): relocate taiko codes
johntaiko Jul 5, 2024
4e22b21
fix: add missing dependencies
johntaiko Jul 5, 2024
1e843a4
improve(storage): relocate l1 origin database codes
johntaiko Jul 5, 2024
7362cab
fix: remove optimistic mode in taiko executor
johntaiko Jul 6, 2024
77bcd40
Relocate taiko payload codes
johntaiko Jul 6, 2024
fbcdcfd
Relocate taiko payload codes
johntaiko Jul 6, 2024
29148d2
Relocate taiko payload codes
johntaiko Jul 6, 2024
775ef32
Relocate taiko payload codes
johntaiko Jul 6, 2024
112e21e
Relocate taiko payload codes
johntaiko Jul 8, 2024
9cb3c13
Relocate taiko payload codes
johntaiko Jul 8, 2024
0588b68
Relocate taiko payload codes
johntaiko Jul 8, 2024
e4f0def
Relocate taiko payload codes
johntaiko Jul 8, 2024
a40de63
chore: Update imports in blockchain_test.rs
johntaiko Jul 8, 2024
82299e7
Refactor execution payload validator to improve code readability and …
johntaiko Jul 8, 2024
e637753
chore: Remove unused dependencies in Cargo.toml
johntaiko Jul 8, 2024
0b9a76d
chore: Remove unused dependencies and update imports
johntaiko Jul 8, 2024
8fa22e9
Remove reth-payload-builder from dependencies
johntaiko Jul 8, 2024
050dfd9
chore: Refactor execution payload validator for improved readability …
johntaiko Jul 8, 2024
84f3b78
Refactor ProviderError to remove unused Serde variant
johntaiko Jul 8, 2024
7b132ea
chore: Update dependencies and remove unused dependencies in Cargo.toml
johntaiko Jul 8, 2024
e3973e6
Refactor TransactionsProvider for improved code readability and maint…
johntaiko Jul 8, 2024
0074414
Refactor transaction module for improved code readability and maintai…
johntaiko Jul 8, 2024
9af48a3
Refactor Taiko specific re-exports for improved code readability and …
johntaiko Jul 8, 2024
6f1219b
Refactor Taiko specific re-exports for improved code readability and …
johntaiko Jul 8, 2024
cad6c53
Refactor Taiko specific re-exports for improved code readability and …
johntaiko Jul 8, 2024
a93d974
chore: Remove taiko-reth-payload-builder from dependencies
johntaiko Jul 8, 2024
920038e
Refactor anchor transaction handling for improved code readability an…
johntaiko Jul 8, 2024
2a6691f
Refactor taiko-reth-consensus to taiko-reth-beacon-consensus for impr…
johntaiko Jul 22, 2024
fe717fd
Refactor l2_contract field to treasury method for improved code reada…
johntaiko Jul 22, 2024
f59a239
Refactor txpool_content method parameters for improved code readabili…
johntaiko Jul 22, 2024
8e44ea2
Refactor hardfork conditions for Taiko chains to include Paris and Lo…
johntaiko Jul 22, 2024
1973dd4
fix: consensus
johntaiko Jul 22, 2024
77d64ae
Refactor Taiko specific re-exports for improved code readability and …
johntaiko Aug 12, 2024
9122142
chore: Add flate2 dependency for compression
johntaiko Aug 12, 2024
966cbf9
chore: Add alloy-rlp and reth-rpc-types-compat dependencies
johntaiko Aug 14, 2024
95bb990
Refactor Taiko specific re-exports for improved code readability and …
johntaiko Aug 14, 2024
e882225
feat: add taiko and taikoAuth apis
johntaiko Aug 14, 2024
fb9ad3c
chore: Add reth-rpc-builder/taiko to taiko feature in Cargo.toml
johntaiko Aug 14, 2024
53db9f1
fix: move taiko auth api into auth_module
johntaiko Aug 14, 2024
4169bee
chore: Remove taiko-reth-evm dependency and update Cargo.toml
johntaiko Aug 14, 2024
abfae26
feat: Add EthExecutorProvider for mainnet block execution
johntaiko Aug 14, 2024
c1111d6
chore: Update L1Origin module documentation and naming conventions
johntaiko Aug 14, 2024
14e8741
feat: support ontake
johntaiko Aug 19, 2024
c863702
feat: add docker build into makefile
johntaiko Aug 19, 2024
a41b92c
Update DockerfileTaiko.cross and Makefile for taiko-reth image name
johntaiko Aug 19, 2024
223c3b4
feat: Add support for Taiko binary installation
johntaiko Aug 20, 2024
d261a6b
feat: Update parse_duration_from_secs function to remove explicit typ…
johntaiko Aug 20, 2024
60b0cbd
fix: return error when not found in L1Origin
johntaiko Aug 26, 2024
207bda5
feat: update genesis
johntaiko Aug 26, 2024
be27561
fix: APIs
johntaiko Aug 26, 2024
91d9a39
feat: Add tracing dependency and enable tracing in payload validator
johntaiko Aug 26, 2024
3a953ab
feat: Add debug logging for payload in TaikoExecutionPayloadValidator
johntaiko Aug 28, 2024
fb9b55d
feat: Add support for Taiko binary installation
johntaiko Aug 29, 2024
e394540
feat: Add support for Taiko binary installation
johntaiko Aug 30, 2024
0b50f02
fix: set api version in payload id and validate it
johntaiko Aug 30, 2024
925df67
chore: Update engine_handle.fork_choice_updated() function signature
johntaiko Aug 30, 2024
6a7ad00
chore: Update dependencies and add tracing for payload validation
johntaiko Aug 30, 2024
f0abe0d
fix: commit after put into db
johntaiko Sep 2, 2024
5c696a6
feat: Refactor Taiko payload builder and improve error handling
johntaiko Sep 2, 2024
0f937d6
chore: Update dependencies and add tracing for payload validation
johntaiko Sep 2, 2024
1e03aba
feat: Add reth-chainspec dependency and enable Taiko support
johntaiko Sep 2, 2024
924c5a5
feat: Refactor Taiko payload builder and improve error handling
johntaiko Sep 2, 2024
a78f951
feat: Refactor Taiko payload builder and improve error handling
johntaiko Sep 2, 2024
68edbc3
fix: enable requests when in prague
johntaiko Sep 3, 2024
02508c0
fix: remove txs after miner
johntaiko Sep 3, 2024
8f0967f
fix: pascal case of tx list
johntaiko Sep 3, 2024
7221b7a
Refactor Taiko payload builder and improve error handling
johntaiko Sep 3, 2024
29eabd2
fix: optimistic syncing in taiko without run pipeline again
johntaiko Sep 4, 2024
69c1f4a
feat: introduce debug_setHead
johntaiko Sep 4, 2024
5eb4cb1
feat: support insert older blocks
johntaiko Sep 4, 2024
0de96ab
feat: Add debug flag to fork choice update message
johntaiko Sep 4, 2024
358923a
feat: enable ARM64 build and push for Taiko Docker image
johntaiko Sep 5, 2024
3e30766
feat: Update Taiko chain configuration
johntaiko Sep 9, 2024
1a0aafb
refactor: Remove unused dependencies and update Taiko chain configura…
johntaiko Sep 9, 2024
50df8b0
fix: use bootnodes argument into discv4&discv5
johntaiko Sep 10, 2024
8e7be73
fix: default value for default optional parser
johntaiko Sep 10, 2024
7f6ff7b
refactor: Enable anchor and skip options in BlockExecutionInput
johntaiko Sep 12, 2024
7a33374
fix: makefile build-taiko
johntaiko Oct 8, 2024
8d23543
fix bug about txPoolContentWithMinTip api
mask-pp Oct 23, 2024
05cadb7
format code
mask-pp Oct 23, 2024
f8f1f3d
small change
mask-pp Oct 24, 2024
8458b33
send Result
mask-pp Oct 25, 2024
09a492f
revert changes
mask-pp Oct 25, 2024
fb6e4cf
Merge pull request #52 from taikoxyz/fix_bug_getPoolContent_
mask-pp Oct 29, 2024
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
272 changes: 232 additions & 40 deletions Cargo.lock

Large diffs are not rendered by default.

41 changes: 39 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ members = [
"crates/optimism/primitives/",
"crates/payload/basic/",
"crates/payload/builder/",
"crates/payload/primitives/",
"crates/payload/primitives",
"crates/ethereum/payload",
"crates/optimism/payload",
"crates/payload/validator/",
"crates/primitives/",
"crates/primitives-traits/",
Expand Down Expand Up @@ -125,6 +127,16 @@ members = [
"examples/txpool-tracing/",
"testing/ef-tests/",
"testing/testing-utils",
# Taiko additional crates
"crates/taiko/consensus/consensus",
"crates/taiko/consensus/proposer",
"crates/taiko/engine-primitives/",
"crates/taiko/evm",
"crates/taiko/node",
"crates/taiko/payload/builder",
"crates/taiko/payload/validator",
"crates/taiko/primitives/",
"crates/taiko/storage/",
]
default-members = ["bin/reth"]

Expand Down Expand Up @@ -342,6 +354,16 @@ reth-trie = { path = "crates/trie/trie" }
reth-trie-common = { path = "crates/trie/common" }
reth-trie-parallel = { path = "crates/trie/parallel" }

taiko-reth-beacon-consensus = { path = "crates/taiko/consensus/consensus" }
taiko-reth-proposer-consensus = { path = "crates/taiko/consensus/proposer" }
taiko-reth-primitives = { path = "crates/taiko/primitives" }
taiko-reth-provider = { path = "crates/taiko/storage" }
taiko-reth-evm = { path = "crates/taiko/evm" }
taiko-reth-payload-builder = { path = "crates/taiko/payload/builder" }
taiko-reth-payload-validator = { path = "crates/taiko/payload/validator" }
taiko-reth-engine-primitives = { path = "crates/taiko/engine-primitives" }
taiko-reth-node = { path = "crates/taiko/node" }

# revm
revm = { version = "10.0.0", features = [
"std",
Expand Down Expand Up @@ -409,7 +431,7 @@ thiserror = "1.0"
thiserror-no-std = { version = "2.0.2", default-features = false }
serde_json = "1.0.94"
serde = { version = "1.0", default-features = false }
serde_with = "3.3.0"
serde_with = { version = "3.3.0", features = ["base64"] }
humantime = "2.1"
humantime-serde = "1.1"
rand = "0.8.5"
Expand All @@ -429,6 +451,8 @@ sha2 = { version = "0.10", default-features = false }
paste = "1.0"
url = "2.3"
backon = "0.4"
anyhow = "1.0.86"
lazy_static = "1.5.0"

# metrics
metrics = "0.23.0"
Expand Down Expand Up @@ -480,6 +504,7 @@ secp256k1 = { version = "0.29", default-features = false, features = [
"recovery",
] }
enr = { version = "0.12.1", default-features = false }
flate2 = "1.0"

# for eip-4844
c-kzg = "1.0.0"
Expand All @@ -500,3 +525,15 @@ serial_test = "3"
similar-asserts = "1.5.0"
test-fuzz = "5"
iai-callgrind = "0.11"


[patch.crates-io]
revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v37-taiko" }
revm-interpreter = { git = "https://github.com/taikoxyz/revm.git", branch = "v37-taiko" }
revm-precompile = { git = "https://github.com/taikoxyz/revm.git", branch = "v37-taiko" }
revm-primitives = { git = "https://github.com/taikoxyz/revm.git", branch = "v37-taiko" }
c-kzg = { git = "https://github.com/brechtpd/c-kzg-4844", branch = "for-alpha7" }
secp256k1 = { git = "https://github.com/CeciliaZ030/rust-secp256k1", branch = "sp1-patch" }

[patch.'https://github.com/bluealloy/revm.git']
revm = { git = "https://github.com/taikoxyz/revm.git", branch = "v37-taiko" }
15 changes: 15 additions & 0 deletions DockerfileTaiko.cross
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This image is meant to enable cross-architecture builds.
# It assumes the reth binary has already been compiled for `$TARGETPLATFORM` and is
# locatable in `./dist/bin/$TARGETARCH`
FROM --platform=$TARGETPLATFORM ubuntu:22.04

LABEL org.opencontainers.image.source=https://github.com/taikoxyz/taiko-reth
LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0"

# Filled by docker buildx
ARG TARGETARCH

COPY ./dist/bin/$TARGETARCH/taiko-reth /usr/local/bin/taiko-reth

EXPOSE 30303 30303/udp 9001 8545 8546
ENTRYPOINT ["/usr/local/bin/taiko-reth"]
115 changes: 115 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ EF_TESTS_DIR := ./testing/ef-tests/ethereum-tests

# The docker image name
DOCKER_IMAGE_NAME ?= ghcr.io/paradigmxyz/reth
TAIKO_DOCKER_IMAGE_NAME ?= us-docker.pkg.dev/evmchain/images/taiko-reth

# Features in reth/op-reth binary crate other than "ethereum" and "optimism"
BIN_OTHER_FEATURES := asm-keccak jemalloc jemalloc-prof min-error-logs min-warn-logs min-info-logs min-debug-logs min-trace-logs
Expand All @@ -57,6 +58,14 @@ install-op: ## Build and install the op-reth binary under `~/.cargo/bin`.
--profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS)


.PHONY: install-taiko
install-taiko: ## Build and install the op-reth binary under `~/.cargo/bin`.
cargo install --path bin/reth --bin taiko-reth --force --locked \
--features "taiko,$(FEATURES)" \
--profile "$(PROFILE)" \
$(CARGO_INSTALL_EXTRA_FLAGS)

.PHONY: build
build: ## Build the reth binary into `target` directory.
cargo build --bin reth --features "$(FEATURES)" --profile "$(PROFILE)"
Expand All @@ -65,13 +74,20 @@ build: ## Build the reth binary into `target` directory.
build-op: ## Build the op-reth binary into `target` directory.
cargo build --bin op-reth --features "optimism,$(FEATURES)" --profile "$(PROFILE)"

.PHONY: build-taiko
build-taiko: ## Build the op-reth binary into `target` directory.
cargo build --bin taiko-reth --features "taiko,$(FEATURES)" --profile "$(PROFILE)"

# Builds the reth binary natively.
build-native-%:
cargo build --bin reth --target $* --features "$(FEATURES)" --profile "$(PROFILE)"

op-build-native-%:
cargo build --bin op-reth --target $* --features "optimism,$(FEATURES)" --profile "$(PROFILE)"

taiko-build-native-%:
cargo build --bin op-reth --target $* --features "taiko,$(FEATURES)" --profile "$(PROFILE)"

# The following commands use `cross` to build a cross-compile.
#
# These commands require that:
Expand All @@ -93,9 +109,13 @@ build-aarch64-unknown-linux-gnu: export JEMALLOC_SYS_WITH_LG_PAGE=16
op-build-aarch64-unknown-linux-gnu: FEATURES := $(filter-out asm-keccak,$(FEATURES))
op-build-aarch64-unknown-linux-gnu: export JEMALLOC_SYS_WITH_LG_PAGE=16

taiko-build-aarch64-unknown-linux-gnu: FEATURES := $(filter-out asm-keccak,$(FEATURES))
taiko-build-aarch64-unknown-linux-gnu: export JEMALLOC_SYS_WITH_LG_PAGE=16

# No jemalloc on Windows
build-x86_64-pc-windows-gnu: FEATURES := $(filter-out jemalloc jemalloc-prof,$(FEATURES))
op-build-x86_64-pc-windows-gnu: FEATURES := $(filter-out jemalloc jemalloc-prof,$(FEATURES))
taiko-build-x86_64-pc-windows-gnu: FEATURES := $(filter-out jemalloc jemalloc-prof,$(FEATURES))

# Note: The additional rustc compiler flags are for intrinsics needed by MDBX.
# See: https://github.com/cross-rs/cross/wiki/FAQ#undefined-reference-with-build-std
Expand All @@ -107,6 +127,10 @@ op-build-%:
RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \
cross build --bin op-reth --target $* --features "optimism,$(FEATURES)" --profile "$(PROFILE)"

taiko-build-%:
RUSTFLAGS="-C link-arg=-lgcc -Clink-arg=-static-libgcc" \
cross build --bin taiko-reth --target $* --features "taiko,$(FEATURES)" --profile "$(PROFILE)"

# Unfortunately we can't easily use cross to build for Darwin because of licensing issues.
# If we wanted to, we would need to build a custom Docker image with the SDK available.
#
Expand All @@ -122,6 +146,11 @@ op-build-x86_64-apple-darwin:
op-build-aarch64-apple-darwin:
$(MAKE) op-build-native-aarch64-apple-darwin

taiko-build-x86_64-apple-darwin:
$(MAKE) taiko-build-native-x86_64-apple-darwin
taiko-build-aarch64-apple-darwin:
$(MAKE) taiko-build-native-aarch64-apple-darwin

# Create a `.tar.gz` containing a binary for a specific target.
define tarball_release_binary
cp $(BUILD_PATH)/$(1)/$(PROFILE)/$(2) $(BIN_DIR)/$(2)
Expand Down Expand Up @@ -278,6 +307,53 @@ endef

##@ Other


##@ Taiko docker

# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder`
.PHONY: taiko-docker-build-push
taiko-docker-build-push: ## Build and push a cross-arch Docker image tagged with the latest git tag.
$(call taiko_docker_build_push,$(GIT_TAG),$(GIT_TAG))

# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --driver docker-container --name cross-builder`
.PHONY: taiko-docker-build-push-latest
taiko-docker-build-push-latest: ## Build and push a cross-arch Docker image tagged with the latest git tag and `latest`.
$(call taiko_docker_build_push,$(GIT_TAG),latest)

# Note: This requires a buildx builder with emulation support. For example:
#
# `docker run --privileged --rm tonistiigi/binfmt --install amd64,arm64`
# `docker buildx create --use --name cross-builder`
.PHONY: taiko-docker-build-push-nightly
taiko-docker-build-push-nightly: ## Build and push cross-arch Docker image tagged with the latest git tag with a `-nightly` suffix, and `latest-nightly`.
$(call taiko_docker_build_push,$(GIT_TAG)-nightly,latest-nightly)

# Create a cross-arch Docker image with the given tags and push it
define taiko_docker_build_push
$(MAKE) taiko-build-x86_64-unknown-linux-gnu
mkdir -p $(BIN_DIR)/amd64
cp $(BUILD_PATH)/x86_64-unknown-linux-gnu/$(PROFILE)/taiko-reth $(BIN_DIR)/amd64/taiko-reth

$(MAKE) taiko-build-aarch64-unknown-linux-gnu
mkdir -p $(BIN_DIR)/arm64
cp $(BUILD_PATH)/aarch64-unknown-linux-gnu/$(PROFILE)/taiko-reth $(BIN_DIR)/arm64/taiko-reth

docker buildx build --file ./DockerfileTaiko.cross . \
--platform linux/amd64,linux/arm64 \
--tag $(TAIKO_DOCKER_IMAGE_NAME):$(1) \
--tag $(TAIKO_DOCKER_IMAGE_NAME):$(2) \
--provenance=false \
--push
endef

##@ Other

.PHONY: clean
clean: ## Perform a `cargo` clean and remove the binary and test vectors directories.
cargo clean
Expand Down Expand Up @@ -345,6 +421,18 @@ lint-op-reth:
--features "optimism $(BIN_OTHER_FEATURES)" \
-- -D warnings


lint-taiko-reth:
cargo +nightly clippy \
--workspace \
--bin "taiko-reth" \
--lib \
--examples \
--tests \
--benches \
--features "taiko $(BIN_OTHER_FEATURES)" \
-- -D warnings

lint-other-targets:
cargo +nightly clippy \
--workspace \
Expand All @@ -368,6 +456,7 @@ lint:
make fmt && \
make lint-reth && \
make lint-op-reth && \
make lint-taiko-reth && \
make lint-other-targets && \
make lint-codespell

Expand Down Expand Up @@ -399,6 +488,21 @@ fix-lint-op-reth:
--allow-dirty \
-- -D warnings


fix-lint-taiko-reth:
cargo +nightly clippy \
--workspace \
--bin "taiko-reth" \
--lib \
--examples \
--tests \
--benches \
--features "taiko $(BIN_OTHER_FEATURES)" \
--fix \
--allow-staged \
--allow-dirty \
-- -D warnings

fix-lint-other-targets:
cargo +nightly clippy \
--workspace \
Expand All @@ -415,6 +519,7 @@ fix-lint-other-targets:
fix-lint:
make fix-lint-reth && \
make fix-lint-op-reth && \
make fix-lint-taiko-reth && \
make fix-lint-other-targets && \
make fmt

Expand Down Expand Up @@ -447,6 +552,15 @@ test-op-reth:
--benches \
--features "optimism $(BIN_OTHER_FEATURES)"

test-taiko-reth:
cargo test \
--workspace \
--bin "taiko-reth" \
--lib --examples \
--tests \
--benches \
--features "taiko $(BIN_OTHER_FEATURES)"

test-other-targets:
cargo test \
--workspace \
Expand All @@ -463,6 +577,7 @@ test-doc:
test:
make test-reth && \
make test-op-reth && \
make test-taiko-reth && \
make test-doc && \
make test-other-targets

Expand Down
23 changes: 23 additions & 0 deletions bin/reth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,16 @@ reth-consensus.workspace = true
reth-optimism-primitives.workspace = true
reth-prune-types.workspace = true

# taiko
taiko-reth-payload-builder = { workspace = true, optional = true }
taiko-reth-payload-validator = { workspace = true, optional = true }
taiko-reth-node = { workspace = true, optional = true }

# crypto
alloy-rlp.workspace = true
rlp = "0.5"
alloy-chains.workspace = true
secp256k1.workspace = true

# tracing
tracing.workspace = true
Expand Down Expand Up @@ -113,6 +121,7 @@ eyre.workspace = true
clap = { workspace = true, features = ["derive", "env"] }
tempfile.workspace = true
backon.workspace = true
thiserror.workspace = true
similar-asserts.workspace = true
itertools.workspace = true
rayon.workspace = true
Expand Down Expand Up @@ -154,6 +163,15 @@ optimism = [
"reth-node-core/optimism",
]

taiko = [
"dep:taiko-reth-payload-validator",
"reth-primitives/taiko",
"reth-revm/taiko",
"reth-node-builder/taiko",
"dep:taiko-reth-node",
"reth-blockchain-tree/taiko",
]

# no-op feature flag for switching between the `optimism` and default functionality in CI matrices
ethereum = []

Expand All @@ -165,3 +183,8 @@ path = "src/main.rs"
name = "op-reth"
path = "src/optimism.rs"
required-features = ["optimism"]

[[bin]]
name = "taiko-reth"
path = "src/taiko.rs"
required-features = ["taiko"]
7 changes: 7 additions & 0 deletions bin/reth/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ impl<Ext: clap::Args + fmt::Debug> Cli<Ext> {
Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute()),
Commands::Stage(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Commands::P2P(command) => runner.run_until_ctrl_c(command.execute()),
// Commands::T8n(command) => runner.run_until_ctrl_c(command.execute()),
Commands::TestVectors(command) => runner.run_until_ctrl_c(command.execute()),
Commands::Config(command) => runner.run_until_ctrl_c(command.execute()),
Commands::Debug(command) => runner.run_command_until_exit(|ctx| command.execute(ctx)),
Expand Down Expand Up @@ -211,6 +212,12 @@ pub enum Commands<Ext: clap::Args + fmt::Debug = NoArgs> {
/// P2P Debugging utilities
#[command(name = "p2p")]
P2P(p2p::Command),
/// Runs an EVM state transition using the provided JSON pre-state files.
///
/// Equivalent of Geth's `./evm t8n` utility, and should be used to confirm
/// equivalence of behavior between Geth and Reth executors.
// #[command(name = "t8n")]
// T8n(t8n::Command),
/// Generate Test Vectors
#[command(name = "test-vectors")]
TestVectors(test_vectors::Command),
Expand Down
Loading
Loading