From 3845423e17b4476de887a2fb81055765274c7b88 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Tue, 9 May 2023 08:26:42 -0700 Subject: [PATCH] Generalize matching criteria for tombstone at boot up (#31547) Generalize matching criteria for tombstone at bootup --- program-runtime/src/loaded_programs.rs | 6 ++---- runtime/src/bank.rs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/program-runtime/src/loaded_programs.rs b/program-runtime/src/loaded_programs.rs index ffa934319c..10790bef34 100644 --- a/program-runtime/src/loaded_programs.rs +++ b/program-runtime/src/loaded_programs.rs @@ -318,7 +318,7 @@ impl LoadedProgramsForTxBatch { pub enum LoadedProgramMatchCriteria { DeployedOnOrAfterSlot(Slot), - Closed, + Tombstone, NoCriteria, } @@ -410,9 +410,7 @@ impl LoadedPrograms { LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot) => { program.deployment_slot >= *slot } - LoadedProgramMatchCriteria::Closed => { - matches!(program.program, LoadedProgramType::Closed) - } + LoadedProgramMatchCriteria::Tombstone => program.is_tombstone(), LoadedProgramMatchCriteria::NoCriteria => true, } } diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index d06f5b9614..04872d9fcf 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -4461,7 +4461,7 @@ impl Bank { ( *pubkey, self.program_modification_slot(pubkey) - .map_or(LoadedProgramMatchCriteria::Closed, |slot| { + .map_or(LoadedProgramMatchCriteria::Tombstone, |slot| { LoadedProgramMatchCriteria::DeployedOnOrAfterSlot(slot) }), )