Skip to content

Commit 084021f

Browse files
committed
Some fixes.
1 parent 012d30a commit 084021f

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ netsim: build_release build-test-utils
200200
set -eo pipefail
201201
function run_as_root {
202202
if [ "$CI" == "true" ]; then
203-
sudo "$@"
203+
sudo --preserve-env=RUST_LOG "$@"
204204
else
205205
run0 --setenv=PATH --setenv=HOME --setenv=RUST_LOG "$@"
206206
fi

scripts/run-timeboost-demo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ pids=()
115115
i=0
116116
for f in "$config_dir"/node_*.toml; do
117117
cmd=(target/release/timeboost
118+
--committee-id 0
118119
--committee "$config_dir/committee.toml"
119120
--config "$f"
120121
--until $rounds
@@ -142,7 +143,7 @@ done
142143
if $yapper; then
143144
cmd=(target/release/yapper
144145
--tps $tps
145-
--keyset-file "$config_dir/committee.toml")
146+
--config "$config_dir/committee.toml")
146147
if [ $nitro_url ]; then
147148
cmd+=(--nitro-url "$nitro_url")
148149
fi

test-utils/src/binaries/run-committee.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::{
88
use anyhow::{Result, bail, ensure};
99
use clap::Parser;
1010
use test_utils::net::Config;
11+
use timeboost::config::CommitteeConfig;
1112
use tokio::{
1213
fs::{self, read_dir},
1314
process::Command,
@@ -48,6 +49,8 @@ async fn main() -> Result<()> {
4849
bail!("{:?} is not a file", args.timeboost)
4950
}
5051

52+
let committee = CommitteeConfig::read(args.configs.join("committee.toml")).await?;
53+
5154
let mut netconf: Option<Config> = None;
5255
let mut commands = BTreeMap::new();
5356
let mut entries = read_dir(&args.configs).await?;
@@ -61,7 +64,11 @@ async fn main() -> Result<()> {
6164
}
6265
ConfigType::Node(name) => {
6366
let mut cmd = StdCommand::new(args.timeboost.as_os_str());
64-
cmd.arg("--config").arg(entry.path()).arg("--ignore-stamp");
67+
cmd.arg("--committee-id")
68+
.arg(committee.id.to_string())
69+
.arg("--config")
70+
.arg(entry.path())
71+
.arg("--ignore-stamp");
6572
commands.insert(name.to_string(), cmd);
6673
}
6774
ConfigType::Committee | ConfigType::Unknown => continue,

timeboost/src/binaries/timeboost.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ struct Cli {
2828
#[clap(long)]
2929
config: PathBuf,
3030

31+
/// CommitteeId for the committee in which this member belongs to
32+
#[clap(long, short)]
33+
committee_id: CommitteeId,
34+
3135
/// Ignore any existing stamp file and start from genesis.
3236
#[clap(long, default_value_t = false)]
3337
ignore_stamp: bool,
@@ -84,15 +88,13 @@ async fn main() -> Result<()> {
8488

8589
let contract = KeyManager::new(node_config.chain.parent.key_manager_contract, &provider);
8690

87-
let committee_id = CommitteeId::from(contract.currentCommitteeId().call().await?);
88-
8991
let members: Vec<CommitteeMemberSol> = contract
90-
.getCommitteeById(committee_id.into())
92+
.getCommitteeById(cli.committee_id.into())
9193
.call()
9294
.await?
9395
.members;
9496

95-
info!(label = %sign_keypair.public_key(), %committee_id, "committee info synced");
97+
info!(label = %sign_keypair.public_key(), committee_id = %cli.committee_id, "committee info synced");
9698

9799
let peer_hosts_and_keys = members
98100
.iter()
@@ -131,7 +133,7 @@ async fn main() -> Result<()> {
131133

132134
let sailfish_committee = {
133135
let c = Committee::new(
134-
committee_id,
136+
cli.committee_id,
135137
sailfish_peer_hosts_and_keys
136138
.iter()
137139
.enumerate()
@@ -142,7 +144,7 @@ async fn main() -> Result<()> {
142144

143145
let decrypt_committee = {
144146
let c = Committee::new(
145-
committee_id,
147+
cli.committee_id,
146148
decrypt_peer_hosts_and_keys
147149
.iter()
148150
.enumerate()
@@ -153,7 +155,7 @@ async fn main() -> Result<()> {
153155

154156
let certifier_committee = {
155157
let c = Committee::new(
156-
committee_id,
158+
cli.committee_id,
157159
certifier_peer_hosts_and_keys
158160
.iter()
159161
.enumerate()

0 commit comments

Comments
 (0)