Skip to content

Commit aa22c3f

Browse files
committed
chore: misc improvements
1 parent e3af81d commit aa22c3f

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

src/tasks/block/sim.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl Simulator {
221221
// We have the timepoint in seconds into the slot. To find out what's
222222
// remaining, we need to subtract it from the slot duration
223223
// we also subtract 3 seconds to account for the sequencer stopping signing.
224-
let remaining = (self.slot_calculator().slot_duration() - timepoint).saturating_sub(3);
224+
let remaining = (self.slot_calculator().slot_duration() - timepoint).saturating_sub(4);
225225

226226
let deadline = Instant::now() + Duration::from_secs(remaining);
227227
deadline.max(Instant::now())

src/tasks/cache/bundle.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ use tokio::{
1212
time::{self, Duration},
1313
};
1414

15+
/// Poll interval for the bundle poller in milliseconds.
16+
const POLL_INTERVAL_MS: u64 = 500;
17+
1518
/// The BundlePoller polls the tx-pool for bundles.
1619
#[derive(Debug)]
1720
pub struct BundlePoller {
@@ -29,7 +32,12 @@ pub struct BundlePoller {
2932
impl BundlePoller {
3033
/// Creates a new BundlePoller from the provided builder config.
3134
pub fn new(config: &BuilderConfig, token: SharedToken) -> Self {
32-
Self { config: config.clone(), token, client: Client::new(), poll_interval_ms: 1000 }
35+
Self {
36+
config: config.clone(),
37+
token,
38+
client: Client::new(),
39+
poll_interval_ms: POLL_INTERVAL_MS,
40+
}
3341
}
3442

3543
/// Creates a new BundlePoller from the provided builder config and with the specified poll interval in ms.

src/tasks/cache/tx.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use serde::{Deserialize, Serialize};
88
use std::time::Duration;
99
use tokio::{sync::mpsc, task::JoinHandle, time};
1010

11+
/// Poll interval for the transaction poller in milliseconds.
12+
const POLL_INTERVAL_MS: u64 = 500;
13+
1114
/// Models a response from the transaction pool.
1215
#[derive(Debug, Clone, Serialize, Deserialize)]
1316
struct TxPoolResponse {
@@ -32,7 +35,7 @@ impl TxPoller {
3235
/// Returns a new [`TxPoller`] with the given config.
3336
/// * Defaults to 1000ms poll interval (1s).
3437
pub fn new(config: &BuilderConfig) -> Self {
35-
Self { config: config.clone(), client: Client::new(), poll_interval_ms: 1000 }
38+
Self { config: config.clone(), client: Client::new(), poll_interval_ms: POLL_INTERVAL_MS }
3639
}
3740

3841
/// Returns a new [`TxPoller`] with the given config and cache polling interval in milliseconds.

src/tasks/env.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl EnvTask {
9090
Some(value) => value,
9191
None => {
9292
// If we failed to get the rollup header, we skip this iteration.
93-
debug!(%block_hash, "failed to get rollup header - continuint to next block");
93+
debug!(%block_hash, "failed to get rollup header - continuing to next block");
9494
continue;
9595
}
9696
};

src/tasks/metrics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ impl MetricsTask {
5353

5454
// log whether the transaction reverted
5555
if receipt.status() {
56-
counter!("metrics.tx_reverted").increment(1);
57-
debug!("tx reverted");
58-
} else {
5956
counter!("metrics.tx_succeeded").increment(1);
6057
debug!("tx succeeded");
58+
} else {
59+
counter!("metrics.tx_reverted").increment(1);
60+
debug!("tx reverted");
6161
}
6262
}
6363
Err(PendingTransactionError::TxWatcher(WatchTxError::Timeout)) => {

0 commit comments

Comments
 (0)