From 7c2c4cb0114e1935105580c4212c1c3d55f982c8 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Mon, 8 May 2023 14:47:29 -0700 Subject: [PATCH] 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 ffa934319ce895..10790bef34c84e 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 96c8f0baa80b18..1801f27adc67d5 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) }), )