diff --git a/bin/reth/src/main.rs b/bin/reth/src/main.rs index 159dfd041b07..6d475e993067 100644 --- a/bin/reth/src/main.rs +++ b/bin/reth/src/main.rs @@ -37,8 +37,7 @@ fn main() -> eyre::Result<()> { .with_chain(chain_spec.clone()) .with_network(network_config.clone()) .with_unused_ports() - .with_rpc(RpcServerArgs::default().with_unused_ports().with_static_l2_rpc_ip_and_port(chain_spec.chain.id())) - .set_dev(true); + .with_rpc(RpcServerArgs::default().with_unused_ports().with_static_l2_rpc_ip_and_port(chain_spec.chain.id())); let NodeHandle { node: gwyneth_node, node_exit_future: _ } = NodeBuilder::new(node_config.clone()) diff --git a/crates/gwyneth/src/exex.rs b/crates/gwyneth/src/exex.rs index 1bd6bc1a3b18..144f5cc8f25b 100644 --- a/crates/gwyneth/src/exex.rs +++ b/crates/gwyneth/src/exex.rs @@ -122,7 +122,7 @@ impl Rollup { let attrs = GwynethPayloadAttributes { inner: EthPayloadAttributes { - timestamp: INITIAL_TIMESTAMP, + timestamp: block.timestamp, prev_randao: B256::ZERO, suggested_fee_recipient: Address::ZERO, withdrawals: Some(vec![]), @@ -154,10 +154,22 @@ impl Rollup { let mut payload = EthBuiltPayload::new(payload_id, SealedBlock::default(), U256::ZERO); loop { - payload = - self.node.payload_builder.best_payload(payload_id).await.unwrap().unwrap(); - if payload.block().body.is_empty() { - tokio::time::sleep(std::time::Duration::from_millis(20)).await; + let result = self.node.payload_builder.best_payload(payload_id).await; + + // TODO: There seems to be no result when there's an empty tx list + if let Some(result) = result { + if let Ok(new_payload) = result { + payload = new_payload; + if payload.block().body.is_empty() { + tokio::time::sleep(std::time::Duration::from_millis(20)).await; + continue; + } + } else { + println!("Gwyneth: No payload?"); + continue; + } + } else { + println!("Gwyneth: No block?"); continue; } break; @@ -223,7 +235,7 @@ fn decode_chain_into_rollup_events( .collect() } -pub fn decode_transactions(tx_list: &[u8]) -> Vec { +fn decode_transactions(tx_list: &[u8]) -> Vec { #[allow(clippy::useless_asref)] Vec::::decode(&mut tx_list.as_ref()).unwrap_or_else(|e| { // If decoding fails we need to make an empty block