diff --git a/crates/l2/proposer/prover_server.rs b/crates/l2/proposer/prover_server.rs index 8259757a3..7c5d59b46 100644 --- a/crates/l2/proposer/prover_server.rs +++ b/crates/l2/proposer/prover_server.rs @@ -8,7 +8,10 @@ use std::{ net::{IpAddr, Shutdown, TcpListener, TcpStream}, sync::mpsc::{self, Receiver}, }; -use tokio::signal::unix::{signal, SignalKind}; +use tokio::{ + signal::unix::{signal, SignalKind}, + time::sleep, +}; use tracing::{debug, error, info, warn}; use ethereum_rust_core::{ @@ -164,7 +167,7 @@ impl ProverServer { panic!("Failed to handle submit_ack: {e}"); } // Seems to be stopping the prover_server <--> prover_client - //self.handle_proof_submission(block_number, receipt).await?; + self.handle_proof_submission(block_number, receipt).await?; assert!(block_number == (self.latest_proven_block + 1), "Prover Client submitted an invalid block_number: {block_number}. The last_proved_block is: {}", self.latest_proven_block); self.latest_proven_block = block_number; @@ -233,7 +236,15 @@ impl ProverServer { // // The RISC0_DEV_MODE=1 should only be used with DEPLOYER_CONTRACT_VERIFIER=0xAA let seal = match receipt.0.inner.groth16() { - Ok(inner) => hex::encode(inner.clone().seal), + Ok(inner) => { + // The SELECTOR is used to perform an extra check inside the groth16 verifier contract. + let mut selector = + hex::encode(inner.verifier_parameters.as_bytes().get(..4).unwrap()); + info!("SELECTOR(): {selector}"); + let seal = hex::encode(inner.clone().seal); + selector.push_str(&seal); + selector + } Err(_) => hex::encode("00"), }; @@ -349,7 +360,8 @@ impl ProverServer { .await? .is_none() { - std::thread::sleep(std::time::Duration::from_secs(1)); + warn!("WAITING for Tx Receipt"); + sleep(std::time::Duration::from_secs(1)).await; } Ok(verify_tx_hash) diff --git a/crates/l2/utils/eth_client/mod.rs b/crates/l2/utils/eth_client/mod.rs index 5f62761a6..1aea55853 100644 --- a/crates/l2/utils/eth_client/mod.rs +++ b/crates/l2/utils/eth_client/mod.rs @@ -21,6 +21,7 @@ use libsecp256k1::{sign, Message, SecretKey}; use reqwest::Client; use serde::{Deserialize, Serialize}; use serde_json::json; +use tracing::info; use transaction::PayloadRLPEncode; pub mod errors; @@ -95,6 +96,7 @@ impl EthClient { tx: &mut EIP1559Transaction, private_key: SecretKey, ) -> Result { + info!("CALLDATA: {:?}", tx.data); let mut payload = vec![TxType::EIP1559 as u8]; payload.append(tx.encode_payload_to_vec().as_mut());