From 652a469c8e3d1096e61a7a51da39e4e1d9bb159c Mon Sep 17 00:00:00 2001 From: john xu Date: Tue, 24 Dec 2024 14:26:27 +0800 Subject: [PATCH] feat: remove unused dependencies and enhance taiko engine support --- Cargo.lock | 2 -- bin/reth/Cargo.toml | 1 - crates/consensus/beacon/Cargo.toml | 3 +-- crates/consensus/beacon/src/engine/mod.rs | 10 ++++++++++ crates/taiko/node/Cargo.toml | 1 - crates/taiko/node/src/engine.rs | 2 ++ 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 418cbbf4b3a9..4e7240bd454d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6571,7 +6571,6 @@ dependencies = [ "reth-static-file", "reth-taiko-chainspec", "reth-taiko-cli", - "reth-taiko-forks", "reth-taiko-node", "reth-tasks", "reth-tracing", @@ -9602,7 +9601,6 @@ dependencies = [ "eyre", "reth-basic-payload-builder", "reth-consensus", - "reth-ethereum-payload-builder", "reth-evm", "reth-network", "reth-node-builder", diff --git a/bin/reth/Cargo.toml b/bin/reth/Cargo.toml index 36ba95f95e07..db54ea3bf0fe 100644 --- a/bin/reth/Cargo.toml +++ b/bin/reth/Cargo.toml @@ -69,7 +69,6 @@ reth-prune.workspace = true # taiko reth-taiko-chainspec.workspace = true -reth-taiko-forks.workspace = true reth-taiko-node.workspace = true reth-taiko-cli.workspace = true diff --git a/crates/consensus/beacon/Cargo.toml b/crates/consensus/beacon/Cargo.toml index 9eefdf8d0a8f..1c8cc9443988 100644 --- a/crates/consensus/beacon/Cargo.toml +++ b/crates/consensus/beacon/Cargo.toml @@ -32,7 +32,7 @@ reth-tokio-util.workspace = true reth-engine-primitives.workspace = true reth-network-p2p.workspace = true reth-node-types.workspace = true -reth-chainspec = { workspace = true, optional = true } +reth-chainspec = { workspace = true } # taiko reth-taiko-engine-types.workspace = true @@ -88,7 +88,6 @@ assert_matches.workspace = true optimism = [ "reth-blockchain-tree/optimism", "reth-codecs/op", - "reth-chainspec", "reth-db-api/optimism", "reth-db/optimism", "reth-downloaders/optimism", diff --git a/crates/consensus/beacon/src/engine/mod.rs b/crates/consensus/beacon/src/engine/mod.rs index 0599feaf8caa..8f146cb5d770 100644 --- a/crates/consensus/beacon/src/engine/mod.rs +++ b/crates/consensus/beacon/src/engine/mod.rs @@ -489,6 +489,16 @@ where return true } + if reth_chainspec::EthChainSpec::is_taiko(&self.blockchain.chain_spec()) { + debug!( + target: "consensus::engine", + fcu_head_num=?header.number, + current_head_num=?head.number, + "[Taiko] Allowing beacon reorg to old head" + ); + return true; + } + // 2. Client software MAY skip an update of the forkchoice state and MUST NOT begin a // payload build process if `forkchoiceState.headBlockHash` references a `VALID` ancestor // of the head of canonical chain, i.e. the ancestor passed payload validation process diff --git a/crates/taiko/node/Cargo.toml b/crates/taiko/node/Cargo.toml index ca6c3c9ed097..56a2511d67ab 100644 --- a/crates/taiko/node/Cargo.toml +++ b/crates/taiko/node/Cargo.toml @@ -22,7 +22,6 @@ reth-network.workspace = true reth-consensus.workspace = true reth-trie-db.workspace = true reth-primitives.workspace = true -reth-ethereum-payload-builder.workspace = true reth-node-ethereum.workspace = true reth-rpc.workspace = true reth-payload-primitives.workspace = true diff --git a/crates/taiko/node/src/engine.rs b/crates/taiko/node/src/engine.rs index a19e01f9adf8..80425609d4ca 100644 --- a/crates/taiko/node/src/engine.rs +++ b/crates/taiko/node/src/engine.rs @@ -1,3 +1,5 @@ +//! Engine support + use std::sync::Arc; use alloy_rpc_types_engine::{ExecutionPayloadSidecar, PayloadError};