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

Commit

Permalink
Generalize matching criteria for tombstone at boot up (#31547)
Browse files Browse the repository at this point in the history
Generalize matching criteria for tombstone at bootup
  • Loading branch information
pgarg66 authored May 9, 2023
1 parent 6a4a041 commit 3845423
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
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

0 comments on commit 3845423

Please sign in to comment.