Skip to content

Commit 94c81f5

Browse files
committed
Simplify sailfish.rs
1 parent f037168 commit 94c81f5

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

timeboost/src/binaries/sailfish.rs

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{iter::repeat_with, path::PathBuf, sync::Arc, time::Duration};
1+
use std::{iter::repeat_with, path::PathBuf, sync::Arc};
22

33
use ::metrics::prometheus::PrometheusMetrics;
44
use anyhow::{Context, Result};
@@ -14,37 +14,27 @@ use sailfish::{
1414
use serde::{Deserialize, Serialize};
1515
use timeboost::{committee::CommitteeInfo, config::NodeConfig};
1616
use timeboost_utils::types::logging;
17-
use tokio::{select, signal, time::sleep};
17+
use tokio::{select, signal};
1818
use tracing::{error, info};
1919

2020
use clap::Parser;
2121

2222
#[derive(Parser, Debug)]
2323
struct Cli {
24-
/// Path to file containing the keyset description.
25-
///
26-
/// The file contains backend urls and public key material.
24+
/// Path to node configuration.
2725
#[clap(long, short)]
2826
config: PathBuf,
2927

30-
/// How many rounds to run.
31-
#[clap(long, default_value_t = 1000)]
32-
until: u64,
33-
34-
/// Max. number of seconds to run.
35-
#[clap(long, default_value_t = 30)]
36-
timeout: u64,
37-
38-
/// Backwards compatibility. This allows for a single region to run (i.e. local)
39-
#[clap(long, default_value_t = false)]
40-
multi_region: bool,
41-
4228
/// Path to a file that this process creates or reads as execution proof.
4329
#[clap(long)]
4430
stamp: PathBuf,
4531

4632
#[clap(long, default_value_t = false)]
4733
ignore_stamp: bool,
34+
35+
/// How many rounds to run.
36+
#[clap(long, default_value_t = 1000)]
37+
until: u64,
4838
}
4939

5040
/// Payload data type is a block of 512 random bytes.
@@ -148,8 +138,6 @@ async fn main() -> Result<()> {
148138
}
149139
}
150140

151-
let mut timeout = Box::pin(sleep(Duration::from_secs(cli.timeout)));
152-
153141
'main: loop {
154142
select! {
155143
result = coordinator.next() => {
@@ -171,10 +159,6 @@ async fn main() -> Result<()> {
171159
},
172160
}
173161
}
174-
_ = &mut timeout => {
175-
error!("timeout");
176-
break;
177-
}
178162
_ = signal::ctrl_c() => {
179163
info!("received ctrl-c; shutting down");
180164
break;

0 commit comments

Comments
 (0)