Skip to content

Commit

Permalink
Removed taiko_reorg and related calls; fixed ARM64 build comments
Browse files Browse the repository at this point in the history
  • Loading branch information
johntaiko committed Dec 31, 2024
1 parent 5cb7565 commit 65c004a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ where
if self.externals.provider_factory.provider()?.block_number(block.hash)?.is_some() {
return Ok(Some(BlockStatus::Valid(BlockAttachment::Canonical)));
}
return Ok(None);
return Err(BlockchainTreeError::PendingBlockIsFinalized {
last_finalized: last_finalized_block,
}
.into());
}

// is block inside chain
Expand Down
26 changes: 0 additions & 26 deletions crates/consensus/beacon/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,28 +935,6 @@ where
Ok(())
}

/// Sets the head of the canon chain without any additional checks.
fn taiko_reorg(&self, max_block: BlockNumber) -> RethResult<()> {
let max_header = self.blockchain.sealed_header(max_block)
.inspect_err(|error| {
error!(target: "consensus::engine", %error, "Error getting canonical header for continuous sync");
})?
.ok_or_else(|| ProviderError::HeaderNotFound(max_block.into()))?;
let max_hash = max_header.hash();
self.update_canon_chain(
max_header,
&ForkchoiceState {
head_block_hash: max_hash,
finalized_block_hash: max_hash,
safe_block_hash: max_hash,
},
)?;
self.blockchain.update_block_hashes_and_clear_buffered()?;
self.blockchain.connect_buffered_blocks_to_canonical_hashes()?;
// We are on an optimistic syncing process, better to wait for the next FCU to handle
Ok(())
}

/// Updates the state of the canon chain tracker based on the given head.
///
/// This expects the given head to be the new canonical head.
Expand Down Expand Up @@ -1519,10 +1497,6 @@ where
}
};

trace!(target: "consensus::engine", ?sync_target_state, "Check sync target state");
// ignore the finalized block hash if we are in taiko mode
return self.taiko_reorg(ctrl.block_number().unwrap_or_default());

if sync_target_state.finalized_block_hash.is_zero() {
self.set_canonical_head(ctrl.block_number().unwrap_or_default())?;
self.blockchain.update_block_hashes_and_clear_buffered()?;
Expand Down
1 change: 0 additions & 1 deletion crates/taiko/payload/validator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ workspace = true
# reth
reth-chainspec.workspace = true
reth-primitives = { workspace = true, features = ["taiko"] }
reth-payload-validator.workspace = true
reth-rpc-types-compat.workspace = true

# ethereum
Expand Down
1 change: 0 additions & 1 deletion crates/taiko/payload/validator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use alloy_primitives::B256;
use alloy_rpc_types_engine::{ExecutionPayloadSidecar, MaybeCancunPayloadFields, PayloadError};
use reth_chainspec::EthereumHardforks;

use reth_payload_validator::ExecutionPayloadValidator;
use reth_primitives::{Block, BlockExt, Header, SealedBlock};
use reth_rpc_types_compat::engine::payload::try_into_block;
use reth_taiko_engine_types::TaikoExecutionPayload;
Expand Down

0 comments on commit 65c004a

Please sign in to comment.