From 69a9520f79a7a629d7eaa720b56fd5eb52555065 Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 22 Feb 2023 21:13:31 -0500 Subject: [PATCH] Flushes accounts cache before warping (#30437) --- core/src/validator.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/validator.rs b/core/src/validator.rs index 3972981f1d..84a2c77eb8 100644 --- a/core/src/validator.rs +++ b/core/src/validator.rs @@ -1709,6 +1709,13 @@ fn maybe_warp_slot( info!("warping to slot {}", warp_slot); let root_bank = bank_forks.root_bank(); + + // An accounts hash calculation from storages will occur in warp_from_parent() below. This + // requires that the accounts cache has been flushed, which requires the parent slot to be + // rooted. + root_bank.squash(); + root_bank.force_flush_accounts_cache(); + bank_forks.insert(Bank::warp_from_parent( &root_bank, &Pubkey::default(),