mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 14:54:45 +00:00
Various small tree-states fixes (#4861)
* Fix block backfill with genesis skip slots * Fix freezer upper limit * Fix: write post state in lcli skip-slots (#4843) * Added CARGO_USE_GIT_CLI to the Dockerfile (#4828) * chore: replace deprecated hub with gh for releases (#4839) * Put schema version back to 24 (ignore Deneb) * Minimise diff --------- Co-authored-by: Joe Clapis <jclapis@outlook.com> Co-authored-by: Dustin Brickwood <dustinbrickwood204@gmail.com>
This commit is contained in:
@@ -110,6 +110,7 @@ pub fn run<T: EthSpec>(
|
||||
}
|
||||
_ => return Err("must supply either --state-path or --beacon-url".into()),
|
||||
};
|
||||
let mut post_state = None;
|
||||
|
||||
let initial_slot = state.slot();
|
||||
let target_slot = initial_slot + slots;
|
||||
@@ -141,14 +142,15 @@ pub fn run<T: EthSpec>(
|
||||
|
||||
let duration = Instant::now().duration_since(start);
|
||||
info!("Run {}: {:?}", i, duration);
|
||||
post_state = Some(state);
|
||||
}
|
||||
|
||||
if let Some(output_path) = output_path {
|
||||
if let (Some(post_state), Some(output_path)) = (post_state, output_path) {
|
||||
let mut output_file = File::create(output_path)
|
||||
.map_err(|e| format!("Unable to create output file: {:?}", e))?;
|
||||
|
||||
output_file
|
||||
.write_all(&state.as_ssz_bytes())
|
||||
.write_all(&post_state.as_ssz_bytes())
|
||||
.map_err(|e| format!("Unable to write to output file: {:?}", e))?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user