Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/compose.anvil-stubs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
eth-stub:
image: ghcr.io/foundry-rs/foundry:nightly-2f4b5dbe7f04d974bf99625325200d214089ee66
image: gaspxyz/foundry:nightly-c2e529786c07ee7069cefcd4fe2db41f0e46cef6
platform: linux/amd64
ports:
- 8545:8545
Expand All @@ -14,7 +14,7 @@ services:
retries: 3

arbitrum-stub:
image: ghcr.io/foundry-rs/foundry:nightly-2f4b5dbe7f04d974bf99625325200d214089ee66
image: gaspxyz/foundry:nightly-c2e529786c07ee7069cefcd4fe2db41f0e46cef6
platform: linux/amd64
ports:
- 8546:8545
Expand All @@ -28,7 +28,7 @@ services:
retries: 3

base-stub:
image: ghcr.io/foundry-rs/foundry:nightly-2f4b5dbe7f04d974bf99625325200d214089ee66
image: gaspxyz/foundry:nightly-c2e529786c07ee7069cefcd4fe2db41f0e46cef6
platform: linux/amd64
ports:
- 8547:8545
Expand Down
4 changes: 2 additions & 2 deletions sequencer/closer/src/batch_subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use tokio::time::{timeout, Duration};

#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("L1 error")]
#[error("L1 error {0:?}")]
L1(#[from] L1Error),
#[error("L2 error")]
#[error("L2 error {0:?}")]
L2(#[from] L2Error),
#[error("Sink send error")]
NoBatchForL2RequestId(#[from] mpsc::error::SendError<Withdrawal>),
Expand Down
3 changes: 3 additions & 0 deletions sequencer/closer/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,7 @@ pub struct Cli {

#[arg(long, default_value_t = false, env = "COLORS")]
pub colors: bool,

#[arg(long, env = "PROMETHEUS_PORT")]
pub prometheus_port: Option<u16>,
}
10 changes: 10 additions & 0 deletions sequencer/closer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ pub async fn main() -> anyhow::Result<()> {
l1api::RolldownContract::new(provider.clone(), args.rolldown_contract_address)
};

let p = provider.clone();
if let Some(port) = args.prometheus_port {
let _balance = tokio::spawn(async move {
common::report_account_balance(p).await;
});
let _metrics = tokio::spawn(async move {
common::serve_metrics(port).await;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The common::serve_metrics function, which starts the Prometheus metrics server, is expected to run indefinitely. If it exits (e.g., warp::serve(...).run(...).await returns), it might indicate an issue like the server failing to bind or another unexpected shutdown. Adding a log message after this call will help in diagnosing such situations, as the task would otherwise terminate silently from the perspective of this main function (though Tokio's panic hook might log panics).

This improves the observability of a critical component for monitoring.

            common::serve_metrics(port).await;
            tracing::warn!("Prometheus metrics server task for port {} has unexpectedly exited.", port);

});
}

let cicka = args
.cicka_address
.map(|addr| l1api::cicka::Cicka::new(provider.clone(), addr));
Expand Down
4 changes: 2 additions & 2 deletions sequencer/l1api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ pub enum L1Error {
InvalidRange,
#[error("Overflow error")]
OverflowError,
#[error("alloy error")]
#[error("alloy error {0:?}")]
Alloy(#[from] alloy::contract::Error),
#[error("alloy error")]
#[error("alloy error {0:?}")]
TransportAlloy(#[from] alloy::transports::TransportError),
#[error("transaction error")]
TxSendError(#[from] PendingTransactionError),
Expand Down
Loading