diff --git a/core/src/preflight/util.rs b/core/src/preflight/util.rs index 10fb6394c..4cd22f715 100644 --- a/core/src/preflight/util.rs +++ b/core/src/preflight/util.rs @@ -142,8 +142,19 @@ pub async fn prepare_taiko_chain_input( // Fetch the tx data from either calldata or blobdata let (tx_data, blob_commitment, blob_proof) = if block_proposed.blob_used() { + let expected_blob_hash = block_proposed.blob_hash(); + let blob_hashes = proposal_tx.blob_versioned_hashes.unwrap_or_default(); + // Get the blob hashes attached to the propose tx and make sure the expected blob hash is in there + require( + blob_hashes.contains(&expected_blob_hash), + &format!( + "Proposal blobs hash mismatch: {:?} not in {:?}", + expected_blob_hash, blob_hashes + ), + )?; + get_tx_data( - proposal_tx.blob_versioned_hashes, + expected_blob_hash, l1_inclusion_header.timestamp, l1_chain_spec, &blob_proof_type, @@ -187,17 +198,12 @@ pub async fn prepare_taiko_chain_input( } pub async fn get_tx_data( - blob_versioned_hashes: Option>, + blob_hash: B256, timestamp: u64, chain_spec: &ChainSpec, blob_proof_type: &BlobProofType, ) -> RaikoResult<(Vec, Option>, Option>)> { - debug!("blob active"); - // Get the blob hashes attached to the propose tx - let blob_hashes = blob_versioned_hashes.unwrap_or_default(); - require(!blob_hashes.is_empty(), "blob hashes are empty")?; - // Currently the protocol enforces the first blob hash to be used - let blob_hash = blob_hashes[0]; + debug!("get tx from hash blob: {blob_hash:?}"); // Get the blob data for this block let slot_id = block_time_to_block_slot( timestamp, diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 8cc872b32..2033b16c3 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -83,6 +83,7 @@ services: - L1_NETWORK=${L1_NETWORK} - NETWORK=${NETWORK} - REDIS_URL=${REDIS_URL:-redis://redis:6379} + - RUST_LOG=${RUST_LOG:-info} # you can use your own PCCS host #- PCCS_HOST=host.docker.internal:8081 # use the host's network to connect to the PCCS diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 5fc5d82b8..4958f4a2f 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +exec 2>&1 set -xeo pipefail export IN_CONTAINER=1 diff --git a/host/src/bin/main.rs b/host/src/bin/main.rs index ebc2c1ae3..1fff82387 100644 --- a/host/src/bin/main.rs +++ b/host/src/bin/main.rs @@ -11,7 +11,9 @@ use tracing_subscriber::FmtSubscriber; #[tokio::main] async fn main() -> HostResult<()> { dotenv::dotenv().ok(); - env_logger::init(); + env_logger::Builder::from_default_env() + .target(env_logger::Target::Stdout) + .init(); let state = ProverState::init()?; let _guard = subscribe_log( &state.opts.log_path, diff --git a/lib/src/input.rs b/lib/src/input.rs index d6f4b3438..30e586cdc 100644 --- a/lib/src/input.rs +++ b/lib/src/input.rs @@ -149,6 +149,14 @@ impl BlockProposedFork { _ => None, } } + + pub fn blob_hash(&self) -> B256 { + match self { + BlockProposedFork::Hekla(block) => block.meta.blobHash, + BlockProposedFork::Ontake(block) => block.meta.blobHash, + _ => B256::default(), + } + } } #[serde_as] diff --git a/lib/src/protocol_instance.rs b/lib/src/protocol_instance.rs index 3f6271ef9..c779735d6 100644 --- a/lib/src/protocol_instance.rs +++ b/lib/src/protocol_instance.rs @@ -18,8 +18,8 @@ use crate::{ }, CycleTracker, }; -use log::{debug, info}; use reth_evm_ethereum::taiko::ANCHOR_GAS_LIMIT; +use tracing::{debug, info}; #[derive(Debug, Clone)] pub enum BlockMetaDataFork { diff --git a/lib/src/utils.rs b/lib/src/utils.rs index 5a9ec9fc8..3adefa77b 100644 --- a/lib/src/utils.rs +++ b/lib/src/utils.rs @@ -4,7 +4,7 @@ use alloy_rlp::Decodable; use anyhow::Result; use libflate::zlib::{Decoder as zlibDecoder, Encoder as zlibEncoder}; use reth_primitives::TransactionSigned; -use tracing::{error, warn}; +use tracing::{debug, error, warn}; use crate::consts::{ChainSpec, Network}; use crate::input::BlockProposedFork; @@ -31,6 +31,10 @@ fn unzip_tx_list_from_data_buf( blob_slice_param: Option<(usize, usize)>, tx_list_data_buf: &[u8], ) -> Vec { + debug!( + "unzip_tx_list_from_data_buf(is_blob_data: {is_blob_data}, tx_list_data_buf.len: {:?}, blob_slice_param: {blob_slice_param:?})", + tx_list_data_buf.len() + ); #[allow(clippy::collapsible_else_if)] if chain_spec.is_taiko() { // taiko has some limitations to be aligned with taiko-client