From 72ddb22d838f55e389482dbb251620dd0cc3945b Mon Sep 17 00:00:00 2001 From: Martin Stefcek Date: Tue, 4 Oct 2022 15:24:46 +0200 Subject: [PATCH] fix: computation of vn mmr --- base_layer/core/src/chain_storage/blockchain_database.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/base_layer/core/src/chain_storage/blockchain_database.rs b/base_layer/core/src/chain_storage/blockchain_database.rs index b9da0d96bd..ac4c19a12c 100644 --- a/base_layer/core/src/chain_storage/blockchain_database.rs +++ b/base_layer/core/src/chain_storage/blockchain_database.rs @@ -1329,7 +1329,8 @@ pub fn calculate_mmr_roots(db: &T, block: &Block) -> Resul output_mmr.compress(); - let validator_nodes = db.fetch_active_validator_nodes(metadata.height_of_longest_chain() + 1)?; + let mut validator_nodes = db.fetch_active_validator_nodes(metadata.height_of_longest_chain() + 1)?; + validator_nodes.sort(); let vn_mmr = ValidatorNodeMmr::new(validator_nodes.iter().map(|vn| vn.1.to_vec()).collect()); let mmr_roots = MmrRoots {