Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit fa778e9

Browse files
authored
fix: use current block height (#54)
1 parent c10c603 commit fa778e9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

crates/builder/src/tasks/submit.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use alloy::signers::Signer;
1111
use alloy::sol_types::SolCall;
1212
use alloy::transports::TransportError;
1313
use alloy_primitives::{FixedBytes, U256};
14-
use eyre::{bail, eyre};
14+
use eyre::bail;
1515
use oauth2::{
1616
basic::BasicClient, basic::BasicTokenType, reqwest::http_client, AuthUrl, ClientId,
1717
ClientSecret, EmptyExtraTokenFields, StandardTokenResponse, TokenResponse, TokenUrl,
@@ -89,10 +89,10 @@ impl SubmitTask {
8989
#[instrument(skip_all)]
9090
async fn construct_sig_request(&self, contents: &InProgressBlock) -> eyre::Result<SignRequest> {
9191
let ru_chain_id = U256::from(self.config.ru_chain_id);
92-
let next_block_height = self.next_host_block_height().await?;
92+
let block_height = self.host_block_height().await?;
9393

9494
Ok(SignRequest {
95-
host_block_number: U256::from(next_block_height),
95+
host_block_number: U256::from(block_height),
9696
host_chain_id: U256::from(self.config.host_chain_id),
9797
ru_chain_id,
9898
gas_limit: U256::from(self.config.rollup_block_gas_limit),
@@ -114,10 +114,9 @@ impl SubmitTask {
114114
Ok(TransactionRequest::default().with_blob_sidecar(sidecar).with_input(data))
115115
}
116116

117-
async fn next_host_block_height(&self) -> eyre::Result<u64> {
117+
async fn host_block_height(&self) -> eyre::Result<u64> {
118118
let result = self.provider.get_block_number().await?;
119-
let next = result.checked_add(1).ok_or_else(|| eyre!("next host block height overflow"))?;
120-
Ok(next)
119+
Ok(result)
121120
}
122121

123122
async fn submit_transaction(

0 commit comments

Comments
 (0)