Skip to content

Commit 3af5fc3

Browse files
committed
Modify dev logic in prover_server
1 parent 426babc commit 3af5fc3

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

crates/l2/sequencer/prover_server.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -580,28 +580,28 @@ impl ProverServer {
580580

581581
pub async fn main_logic_dev(&self) -> Result<(), ProverServerError> {
582582
loop {
583-
let last_committed_block = EthClient::get_last_committed_batch(
583+
let last_committed_batch = EthClient::get_last_committed_batch(
584584
&self.eth_client,
585585
self.on_chain_proposer_address,
586586
)
587587
.await?;
588588

589-
let last_verified_block = EthClient::get_last_verified_block(
589+
let last_verified_batch = EthClient::get_last_verified_batch(
590590
&self.eth_client,
591591
self.on_chain_proposer_address,
592592
)
593593
.await?;
594594

595-
if last_committed_block == last_verified_block {
595+
if last_committed_batch == last_verified_batch {
596596
debug!("No new blocks to prove");
597597
continue;
598598
}
599599

600-
info!("Last committed: {last_committed_block} - Last verified: {last_verified_block}");
600+
info!("Last committed: {last_committed_batch} - Last verified: {last_verified_batch}");
601601

602602
let calldata_values = vec![
603603
// blockNumber
604-
Value::Uint(U256::from(last_verified_block + 1)),
604+
Value::Uint(U256::from(last_verified_batch + 1)),
605605
// risc0BlockProof
606606
Value::Bytes(vec![].into()),
607607
// risc0ImageId
@@ -661,11 +661,11 @@ impl ProverServer {
661661
.send_tx_bump_gas_exponential_backoff(&mut tx, &self.verifier_private_key)
662662
.await?;
663663

664-
info!("Sent proof for block {last_verified_block}, with transaction hash {verify_tx_hash:#x}");
664+
info!("Sent proof for batch {last_verified_batch}, with transaction hash {verify_tx_hash:#x}");
665665

666666
info!(
667-
"Mocked verify transaction sent for block {}",
668-
last_verified_block + 1
667+
"Mocked verify transaction sent for batch {}",
668+
last_verified_batch + 1
669669
);
670670

671671
sleep_random(self.dev_interval_ms).await;

crates/networking/rpc/clients/eth/mod.rs

+12
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,18 @@ impl EthClient {
913913
.await
914914
}
915915

916+
pub async fn get_last_verified_batch(
917+
eth_client: &EthClient,
918+
on_chain_proposer_address: Address,
919+
) -> Result<u64, EthClientError> {
920+
Self::_call_block_variable(
921+
eth_client,
922+
b"lastVerifiedBatch()",
923+
on_chain_proposer_address,
924+
)
925+
.await
926+
}
927+
916928
pub async fn get_verifier_contracts(
917929
eth_client: &EthClient,
918930
verifier_selectors: &[&str],

0 commit comments

Comments
 (0)