Skip to content

Commit

Permalink
Remove slot_epoch from SVM (#2720)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte authored Aug 23, 2024
1 parent 52e7329 commit 106d4cf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
5 changes: 0 additions & 5 deletions program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ pub enum BlockRelation {
pub trait ForkGraph {
/// Returns the BlockRelation of A to B
fn relationship(&self, a: Slot, b: Slot) -> BlockRelation;

/// Returns the epoch of the given slot
fn slot_epoch(&self, _slot: Slot) -> Option<Epoch> {
Some(0)
}
}

/// The owner of a programs accounts, thus the loader of a program
Expand Down
9 changes: 1 addition & 8 deletions runtime/src/bank_forks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ use {
log::*,
solana_measure::measure::Measure,
solana_program_runtime::loaded_programs::{BlockRelation, ForkGraph},
solana_sdk::{
clock::{Epoch, Slot},
hash::Hash,
},
solana_sdk::{clock::Slot, hash::Hash},
std::{
collections::{hash_map::Entry, HashMap, HashSet},
ops::Index,
Expand Down Expand Up @@ -721,10 +718,6 @@ impl ForkGraph for BankForks {
})
.unwrap_or(BlockRelation::Unknown)
}

fn slot_epoch(&self, slot: Slot) -> Option<Epoch> {
self.banks.get(&slot).map(|bank| bank.epoch())
}
}

#[cfg(test)]
Expand Down
6 changes: 1 addition & 5 deletions svm/tests/mock_bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use {
solana_sdk::{
account::{AccountSharedData, ReadableAccount, WritableAccount},
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
clock::{Clock, Epoch, UnixTimestamp},
clock::{Clock, UnixTimestamp},
feature_set::FeatureSet,
native_loader,
pubkey::Pubkey,
Expand Down Expand Up @@ -49,10 +49,6 @@ impl ForkGraph for MockForkGraph {
Ordering::Greater => BlockRelation::Descendant,
}
}

fn slot_epoch(&self, _slot: Slot) -> Option<Epoch> {
Some(0)
}
}

#[derive(Default, Clone)]
Expand Down

0 comments on commit 106d4cf

Please sign in to comment.