Skip to content

Commit

Permalink
Custom debug impl for LoadedPrograms cache (solana-labs#33808)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgarg66 authored Oct 22, 2023
1 parent 8260ffc commit abf3b3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion program-runtime/src/loaded_programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ impl Default for ProgramRuntimeEnvironments {
}
}

#[derive(Debug)]
pub struct LoadedPrograms<FG: ForkGraph> {
/// A two level index:
///
Expand All @@ -459,6 +458,17 @@ pub struct LoadedPrograms<FG: ForkGraph> {
fork_graph: Option<Arc<RwLock<FG>>>,
}

impl<FG: ForkGraph> Debug for LoadedPrograms<FG> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("LoadedPrograms")
.field("root slot", &self.latest_root_slot)
.field("root epoch", &self.latest_root_epoch)
.field("stats", &self.stats)
.field("cache", &self.entries)
.finish()
}
}

impl<FG: ForkGraph> Default for LoadedPrograms<FG> {
fn default() -> Self {
Self {
Expand Down
1 change: 0 additions & 1 deletion runtime/src/bank_forks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct SetRootTimings {
prune_remove_ms: i64,
}

#[derive(Debug)]
pub struct BankForks {
banks: HashMap<Slot, BankWithScheduler>,
descendants: HashMap<Slot, HashSet<Slot>>,
Expand Down

0 comments on commit abf3b3e

Please sign in to comment.