Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Generalize matching criteria for tombstone at boot up #31547

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ impl LoadedProgramsForTxBatch {

pub enum LoadedProgramMatchCriteria {
DeployedOnOrAfterSlot(Slot),
Closed,
Tombstone,
NoCriteria,
}

Expand Down Expand Up @@ -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,
}
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}),
)
Expand Down