From dd6d2be91dde1fd6768f6ea36c3cbc4d2b4b9143 Mon Sep 17 00:00:00 2001 From: Zeke Mostov Date: Sat, 20 Apr 2024 22:49:21 -0600 Subject: [PATCH] ensure reshard input is deterministic when reading in --- src/qos_client/src/cli/services.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qos_client/src/cli/services.rs b/src/qos_client/src/cli/services.rs index 67aae96a8..64fce482e 100644 --- a/src/qos_client/src/cli/services.rs +++ b/src/qos_client/src/cli/services.rs @@ -816,13 +816,15 @@ pub fn generate_reshard_input( let old_share_set = get_share_set(old_share_set_dir); let new_share_set = get_share_set(new_share_set_dir); - let reshard_input = ReshardInput { + let mut reshard_input = ReshardInput { quorum_keys, new_share_set, old_share_set, enclave: nitro_config, }; + reshard_input.deterministic(); + write_json_with_msg( reshard_input_path.as_ref(), &reshard_input, @@ -2461,8 +2463,9 @@ fn read_reshard_input(file: String) -> Result { error: e.to_string(), })?; - let reshard_input: ReshardInput = serde_json::from_slice(&buf) + let mut reshard_input: ReshardInput = serde_json::from_slice(&buf) .map_err(|e| Error::FileDidNotHaveValidReshardInput(e.to_string()))?; + reshard_input.deterministic(); Ok(reshard_input) }