From 0aa25cdd53b1a1fa7689b94b14f97e6fbf42d41a Mon Sep 17 00:00:00 2001 From: Brecht Devos Date: Thu, 17 Oct 2024 02:37:28 +0200 Subject: [PATCH] slight cleanup --- .../src/live_builder/simulation/sim_worker.rs | 2 +- crates/rbuilder/src/proposing/mod.rs | 29 +++---------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/crates/rbuilder/src/live_builder/simulation/sim_worker.rs b/crates/rbuilder/src/live_builder/simulation/sim_worker.rs index 9aa5bd22..6060a5c4 100644 --- a/crates/rbuilder/src/live_builder/simulation/sim_worker.rs +++ b/crates/rbuilder/src/live_builder/simulation/sim_worker.rs @@ -129,7 +129,7 @@ pub fn run_sim_worker( telemetry::inc_simulation_gas_used(sim_result.gas_used); } Err(err) => { - error!(?err, "Critical error while simulating order Brecht"); + error!(?err, "Critical error while simulating order"); // @Metric break; } diff --git a/crates/rbuilder/src/proposing/mod.rs b/crates/rbuilder/src/proposing/mod.rs index 95b61478..34ce6d30 100644 --- a/crates/rbuilder/src/proposing/mod.rs +++ b/crates/rbuilder/src/proposing/mod.rs @@ -71,7 +71,7 @@ impl BlockProposer { println!("propose_block"); let execution_payload = request.execution_payload(); - + // Create the transaction data let (meta, num_txs) = self.create_propose_block_tx_data(&execution_payload)?; @@ -81,9 +81,6 @@ impl BlockProposer { // return Ok(()); // } - println!("meta: {:?}", meta); - println!("proposing tx_list: {:?}", meta.txList); - let decoded_transactions: Vec = decode_transactions(&meta.txList); println!("decoded_transactions: {:?}", decoded_transactions); @@ -96,7 +93,7 @@ impl BlockProposer { // Sign the transaction let chain_id = provider.get_chain_id().await?; let nonce = provider.get_transaction_count(signer.address()).await.unwrap(); - + //let rollup = Rollup::(Address::from_str(&self.contract_address).unwrap(), provider); let propose_data = Rollup::proposeBlockCall { data: vec![meta] }; let propose_data = propose_data.abi_encode(); @@ -132,7 +129,7 @@ impl BlockProposer { "Transaction included in block {}", receipt.block_number.expect("Failed to get block number") ); - + Ok(()) } @@ -151,9 +148,6 @@ impl BlockProposer { } }; - // Create tx_list from transactions -> Are they RLP encoded alredy ? I guess not so doing now. - //let tx_list = self.rlp_encode_transactions(&execution_payload.transactions); - let mut transactions = Vec::new(); for tx_data in execution_payload.transactions.iter() { transactions.push(TransactionSigned::decode(&mut tx_data.to_vec().as_slice()).unwrap()); @@ -187,25 +181,10 @@ impl BlockProposer { txList: tx_list.into(), }; - println!("meta ok"); + println!("meta: {:?}", meta); Ok((meta, execution_payload.transactions.len())) } - - // This one handles '&[ethers::types::Bytes]' and '&Vec' types - fn rlp_encode_transactions(&self, transactions: &[B]) -> Vec - where - B: AsRef<[u8]>, - { - let mut rlp_stream = rlp::RlpStream::new_list(transactions.len()); - - for tx in transactions { - rlp_stream.append(&tx.as_ref()); - } - - rlp_stream.out().to_vec() - } - } #[derive(Debug, thiserror::Error)]