Skip to content

Commit

Permalink
Added alloy-primitives, updated validation logic
Browse files Browse the repository at this point in the history
  • Loading branch information
johntaiko committed Jan 3, 2025
1 parent efda978 commit 2c7b7d7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions crates/rpc/rpc-builder/tests/it/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ where
execution_payload: convert_block_to_payload_input_v2(block),
tx_hash: Default::default(),
withdrawals_hash: Default::default(),
blob_gas_used: Default::default(),
excess_blob_gas: Default::default(),
deposit_requests: Default::default(),
taiko_block: Default::default(),
},
)
.await;
Expand Down
13 changes: 6 additions & 7 deletions crates/taiko/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ use reth_consensus::{
};
use reth_consensus_common::validation::{
validate_4844_header_standalone, validate_against_parent_4844,
validate_against_parent_hash_number, validate_block_pre_execution,
validate_body_against_header, validate_header_base_fee, validate_header_extradata,
validate_against_parent_hash_number, validate_header_base_fee, validate_header_extradata,
validate_header_gas,
};
use reth_ethereum_consensus::validate_block_post_execution;
Expand Down Expand Up @@ -191,16 +190,16 @@ impl<ChainSpec: Send + Sync + EthChainSpec + EthereumHardforks + Debug> HeaderVa
impl<ChainSpec: Send + Sync + EthChainSpec + EthereumHardforks + Debug> Consensus
for TaikoBeaconConsensus<ChainSpec>
{
fn validate_block_pre_execution(&self, block: &SealedBlock) -> Result<(), ConsensusError> {
validate_block_pre_execution(block, &self.chain_spec)
fn validate_block_pre_execution(&self, _block: &SealedBlock) -> Result<(), ConsensusError> {
Ok(())
}

fn validate_body_against_header(
&self,
body: &BlockBody,
header: &SealedHeader,
_body: &BlockBody,
_header: &SealedHeader,
) -> Result<(), ConsensusError> {
validate_body_against_header(body, header.header())
Ok(())
}
}

Expand Down
1 change: 1 addition & 0 deletions crates/taiko/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ reth-taiko-payload-validator.workspace = true

alloy-rpc-types-engine.workspace = true
alloy-consensus.workspace = true
alloy-primitives.workspace = true

reth-evm = { workspace = true, features = ["taiko"] }

Expand Down
3 changes: 2 additions & 1 deletion crates/taiko/node/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use std::sync::Arc;

use alloy_consensus::{BlockHeader, Header};
use alloy_primitives::B256;
use alloy_rpc_types_engine::{ExecutionPayloadSidecar, PayloadError};
use reth_node_builder::{
validate_parent_beacon_block_root_presence, EngineApiMessageVersion,
Expand Down Expand Up @@ -145,7 +146,7 @@ fn validate_withdrawals_presence<T: EthereumHardforks>(
}
}
EngineApiMessageVersion::V2 | EngineApiMessageVersion::V3 | EngineApiMessageVersion::V4 => {
if is_shanghai_active && !hash_withdrawals && withdrawals_hash.is_none() {
if is_shanghai_active && !has_withdrawals && withdrawals_hash.is_none() {
return Err(message_validation_kind
.to_error(VersionSpecificValidationError::NoWithdrawalsPostShanghai))
}
Expand Down

0 comments on commit 2c7b7d7

Please sign in to comment.