Skip to content

Commit 419eda7

Browse files
committed
Remove --merge flag
1 parent 2f6ebe1 commit 419eda7

File tree

2 files changed

+5
-37
lines changed

2 files changed

+5
-37
lines changed

lighthouse/tests/validator_manager.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ pub fn validator_exit_defaults() {
503503
beacon_url: Some(SensitiveUrl::parse("http://localhost:5052").unwrap()),
504504
exit_epoch: None,
505505
signature: false,
506-
merge: false,
507506
exit_status: false,
508507
};
509508
assert_eq!(expected, config);

validator_manager/src/exit_validators.rs

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub const VALIDATOR_FLAG: &str = "validators";
2020
pub const EXIT_EPOCH_FLAG: &str = "exit-epoch";
2121
pub const SIGNATURE_FLAG: &str = "signature";
2222
pub const EXIT_STATUS_FLAG: &str = "status";
23-
pub const MERGE_FLAG: &str = "merge";
2423

2524
pub fn cli_app() -> Command {
2625
Command::new(CMD)
@@ -90,19 +89,6 @@ pub fn cli_app() -> Command {
9089
.action(ArgAction::SetTrue)
9190
.display_order(0),
9291
)
93-
.arg(
94-
Arg::new(MERGE_FLAG)
95-
.long(MERGE_FLAG)
96-
.help(
97-
"Merge the generated voluntary exit signatures into a single file named \
98-
`all_validators.json`. This flag is required to be used together with \
99-
the `--signature` flag.",
100-
)
101-
.help_heading(FLAG_HEADER)
102-
.action(ArgAction::SetTrue)
103-
.requires(SIGNATURE_FLAG)
104-
.display_order(0),
105-
)
10692
.arg(
10793
Arg::new(EXIT_STATUS_FLAG)
10894
.long(EXIT_STATUS_FLAG)
@@ -122,7 +108,6 @@ pub struct ExitConfig {
122108
pub beacon_url: Option<SensitiveUrl>,
123109
pub exit_epoch: Option<Epoch>,
124110
pub signature: bool,
125-
pub merge: bool,
126111
pub exit_status: bool,
127112
}
128113

@@ -147,7 +132,6 @@ impl ExitConfig {
147132
beacon_url: clap_utils::parse_optional(matches, BEACON_URL_FLAG)?,
148133
exit_epoch: clap_utils::parse_optional(matches, EXIT_EPOCH_FLAG)?,
149134
signature: matches.get_flag(SIGNATURE_FLAG),
150-
merge: matches.get_flag(MERGE_FLAG),
151135
exit_status: matches.get_flag(EXIT_STATUS_FLAG),
152136
})
153137
}
@@ -174,7 +158,6 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
174158
beacon_url,
175159
exit_epoch,
176160
signature,
177-
merge,
178161
exit_status,
179162
} = config;
180163

@@ -184,8 +167,6 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
184167
validators_to_exit = validators.iter().map(|v| v.validating_pubkey).collect();
185168
}
186169

187-
let mut exit_message_all = Vec::new();
188-
189170
for validator_to_exit in validators_to_exit {
190171
// Check that the validators_to_exit is in the validator client
191172
if !validators
@@ -206,15 +187,11 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
206187
match exit_message_json {
207188
Ok(json) => {
208189
// Save the exit message to JSON file(s)
209-
if merge {
210-
exit_message_all.push(json.clone());
211-
} else {
212-
let file_path = format!("{}.json", validator_to_exit);
213-
write(&file_path, json).map_err(|e| {
214-
format!("Failed to write voluntary exit message to file: {}", e)
215-
})?;
216-
println!("Voluntary exit message saved to {}", file_path);
217-
}
190+
let file_path = format!("{}.json", validator_to_exit);
191+
write(&file_path, json).map_err(|e| {
192+
format!("Failed to write voluntary exit message to file: {}", e)
193+
})?;
194+
println!("Voluntary exit message saved to {}", file_path);
218195
}
219196
Err(e) => eprintln!("Failed to serialize voluntary exit message: {}", e),
220197
}
@@ -359,13 +336,6 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
359336
}
360337
}
361338

362-
if merge {
363-
let all_json = serde_json::to_string(&exit_message_all)
364-
.map_err(|e| format!("Failed to serialize voluntary exit message: {}", e))?;
365-
write("all_validators.json", all_json)
366-
.map_err(|e| format!("Failed to write all voluntary exit messages to file: {}", e))?;
367-
println!("All voluntary exit messages save to all_validators.json.")
368-
}
369339
Ok(())
370340
}
371341

@@ -526,7 +496,6 @@ mod test {
526496
beacon_url: Some(beacon_url),
527497
exit_epoch: None,
528498
signature: false,
529-
merge: false,
530499
exit_status: false,
531500
});
532501

0 commit comments

Comments
 (0)