Skip to content

Commit 5e44c79

Browse files
committed
fix(e2e): delegate stakes only from the first aggregator
1 parent 626d260 commit 5e44c79

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

mithril-test-lab/mithril-end-to-end/src/end_to_end_spec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl Spec {
138138
)
139139
.await?;
140140

141-
if aggregator.is_master() {
141+
if aggregator.index() == 0 {
142142
// Delegate some stakes to pools
143143
let delegation_round = 1;
144144
assertions::delegate_stakes_to_pools(infrastructure.devnet(), delegation_round).await?;

mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use tokio::sync::RwLock;
1818
#[derive(Debug)]
1919
pub struct AggregatorConfig<'a> {
2020
pub is_master: bool,
21+
pub index: usize,
2122
pub name: &'a str,
2223
pub server_port: u64,
2324
pub pool_node: &'a PoolNode,
@@ -39,6 +40,7 @@ pub struct AggregatorConfig<'a> {
3940
#[derive(Debug)]
4041
pub struct Aggregator {
4142
is_master: bool,
43+
index: usize,
4244
name_suffix: String,
4345
server_port: u64,
4446
db_directory: PathBuf,
@@ -134,6 +136,7 @@ impl Aggregator {
134136

135137
Ok(Self {
136138
is_master: aggregator_config.is_master,
139+
index: aggregator_config.index,
137140
name_suffix: aggregator_config.name.to_string(),
138141
server_port: aggregator_config.server_port,
139142
db_directory: aggregator_config.pool_node.db_path.clone(),
@@ -145,6 +148,7 @@ impl Aggregator {
145148
pub fn copy_configuration(other: &Aggregator) -> Self {
146149
Self {
147150
is_master: other.is_master,
151+
index: other.index,
148152
name_suffix: other.name_suffix.clone(),
149153
server_port: other.server_port,
150154
db_directory: other.db_directory.clone(),
@@ -157,6 +161,10 @@ impl Aggregator {
157161
self.is_master
158162
}
159163

164+
pub fn index(&self) -> usize {
165+
self.index
166+
}
167+
160168
pub fn name(&self) -> String {
161169
format!("mithril-aggregator-{}", self.name_suffix)
162170
}

mithril-test-lab/mithril-end-to-end/src/mithril/infrastructure.rs

+1
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ impl MithrilInfrastructure {
244244

245245
let aggregator = Aggregator::new(&AggregatorConfig {
246246
is_master: config.is_master_aggregator(index),
247+
index,
247248
name: &config.aggregator_name_suffix(index),
248249
server_port: config.server_port + index as u64,
249250
pool_node,

mithril-test-lab/mithril-end-to-end/src/stress_test/aggregator_helpers.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub async fn bootstrap_aggregator(
2020

2121
let mut aggregator = Aggregator::new(&AggregatorConfig {
2222
is_master: false,
23+
index: 0,
2324
name: "genesis",
2425
server_port: args.server_port as u64,
2526
pool_node: &args.pool_node,

0 commit comments

Comments
 (0)