Skip to content

Commit

Permalink
Disable accounts squash call from bank
Browse files Browse the repository at this point in the history
- It's asserting and killing testnet
- temporary solution for beacons
  • Loading branch information
pgarg66 authored and solana-grimes committed Mar 21, 2019
1 parent a0d940a commit 7685ba2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions runtime/src/accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ impl AccountsDB {
.map_or(0, |fork_info| fork_info.transaction_count)
}

#[allow(dead_code)]
fn remove_parents(&self, fork: Fork) -> Vec<Fork> {
let mut info = self.fork_infos.write().unwrap();
let fork_info = info.get_mut(&fork).unwrap();
Expand All @@ -743,6 +744,7 @@ impl AccountsDB {
.is_empty()
}

#[allow(dead_code)]
fn get_merged_account_map(
&self,
fork: Fork,
Expand All @@ -763,6 +765,7 @@ impl AccountsDB {
}

/// make fork a root, i.e. forget its heritage
#[allow(dead_code)]
fn squash(&self, fork: Fork) {
let parents = self.remove_parents(fork);

Expand Down Expand Up @@ -991,6 +994,7 @@ impl Accounts {

/// accounts starts with an empty data structure for every child/fork
/// this function squashes all the parents into this instance
#[allow(dead_code)]
pub fn squash(&self, fork: Fork) {
assert!(!self.account_locks.lock().unwrap().contains_key(&fork));
self.accounts_db.squash(fork);
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ impl Bank {
let parents = self.parents();
*self.parent.write().unwrap() = None;

self.accounts().squash(self.accounts_id);
// self.accounts().squash(self.accounts_id);

let parent_caches: Vec<_> = parents
.iter()
Expand Down

0 comments on commit 7685ba2

Please sign in to comment.