Removing redundant EpochSchedule param from fns
This commit is contained in:
parent
c6a751d658
commit
5472d2e605
|
@ -123,7 +123,6 @@ fn main() {
|
||||||
let results = accounts.accounts_db.update_accounts_hash(
|
let results = accounts.accounts_db.update_accounts_hash(
|
||||||
0,
|
0,
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
);
|
);
|
||||||
time.stop();
|
time.stop();
|
||||||
|
@ -135,7 +134,6 @@ fn main() {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
None,
|
None,
|
||||||
false,
|
false,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
|
@ -139,7 +139,6 @@ impl AccountsHashVerifier {
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &accounts_package.epoch_schedule,
|
|
||||||
rent_collector: &accounts_package.rent_collector,
|
rent_collector: &accounts_package.rent_collector,
|
||||||
},
|
},
|
||||||
&sorted_storages,
|
&sorted_storages,
|
||||||
|
|
|
@ -112,7 +112,6 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
|
||||||
let (_, total_lamports) = accounts.accounts_db.update_accounts_hash(
|
let (_, total_lamports) = accounts.accounts_db.update_accounts_hash(
|
||||||
0,
|
0,
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
);
|
);
|
||||||
let test_hash_calculation = false;
|
let test_hash_calculation = false;
|
||||||
|
@ -122,7 +121,6 @@ fn test_accounts_hash_bank_hash(bencher: &mut Bencher) {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
total_lamports,
|
total_lamports,
|
||||||
test_hash_calculation,
|
test_hash_calculation,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
))
|
))
|
||||||
});
|
});
|
||||||
|
@ -145,7 +143,6 @@ fn test_update_accounts_hash(bencher: &mut Bencher) {
|
||||||
accounts.accounts_db.update_accounts_hash(
|
accounts.accounts_db.update_accounts_hash(
|
||||||
0,
|
0,
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -747,7 +747,6 @@ impl Accounts {
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
can_cached_slot_be_unflushed: bool,
|
can_cached_slot_be_unflushed: bool,
|
||||||
debug_verify: bool,
|
debug_verify: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
) -> u64 {
|
) -> u64 {
|
||||||
let use_index = false;
|
let use_index = false;
|
||||||
|
@ -760,7 +759,6 @@ impl Accounts {
|
||||||
ancestors,
|
ancestors,
|
||||||
None,
|
None,
|
||||||
can_cached_slot_be_unflushed,
|
can_cached_slot_be_unflushed,
|
||||||
epoch_schedule,
|
|
||||||
rent_collector,
|
rent_collector,
|
||||||
is_startup,
|
is_startup,
|
||||||
)
|
)
|
||||||
|
@ -775,7 +773,6 @@ impl Accounts {
|
||||||
ancestors: &Ancestors,
|
ancestors: &Ancestors,
|
||||||
total_lamports: u64,
|
total_lamports: u64,
|
||||||
test_hash_calculation: bool,
|
test_hash_calculation: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
if let Err(err) = self.accounts_db.verify_bank_hash_and_lamports_new(
|
if let Err(err) = self.accounts_db.verify_bank_hash_and_lamports_new(
|
||||||
|
@ -783,7 +780,6 @@ impl Accounts {
|
||||||
ancestors,
|
ancestors,
|
||||||
total_lamports,
|
total_lamports,
|
||||||
test_hash_calculation,
|
test_hash_calculation,
|
||||||
epoch_schedule,
|
|
||||||
rent_collector,
|
rent_collector,
|
||||||
) {
|
) {
|
||||||
warn!("verify_bank_hash failed: {:?}", err);
|
warn!("verify_bank_hash failed: {:?}", err);
|
||||||
|
|
|
@ -233,7 +233,6 @@ impl SnapshotRequestHandler {
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: snapshot_root_bank.epoch_schedule(),
|
|
||||||
rent_collector: snapshot_root_bank.rent_collector(),
|
rent_collector: snapshot_root_bank.rent_collector(),
|
||||||
},
|
},
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
|
@ -5274,7 +5274,6 @@ impl AccountsDb {
|
||||||
&self,
|
&self,
|
||||||
slot: Slot,
|
slot: Slot,
|
||||||
ancestors: &Ancestors,
|
ancestors: &Ancestors,
|
||||||
epoch_schedule: &EpochSchedule,
|
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
) -> (Hash, u64) {
|
) -> (Hash, u64) {
|
||||||
self.update_accounts_hash_with_index_option(
|
self.update_accounts_hash_with_index_option(
|
||||||
|
@ -5284,7 +5283,6 @@ impl AccountsDb {
|
||||||
ancestors,
|
ancestors,
|
||||||
None,
|
None,
|
||||||
false,
|
false,
|
||||||
epoch_schedule,
|
|
||||||
rent_collector,
|
rent_collector,
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
@ -5298,7 +5296,6 @@ impl AccountsDb {
|
||||||
ancestors,
|
ancestors,
|
||||||
None,
|
None,
|
||||||
false,
|
false,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
false,
|
false,
|
||||||
)
|
)
|
||||||
|
@ -5554,7 +5551,7 @@ impl AccountsDb {
|
||||||
Some(slot),
|
Some(slot),
|
||||||
);
|
);
|
||||||
|
|
||||||
self.mark_old_slots_as_dirty(&storages, Some(config.epoch_schedule.slots_per_epoch));
|
self.mark_old_slots_as_dirty(&storages, Some(config.rent_collector.epoch_schedule.slots_per_epoch));
|
||||||
sort_time.stop();
|
sort_time.stop();
|
||||||
|
|
||||||
let mut timings = HashStats {
|
let mut timings = HashStats {
|
||||||
|
@ -5608,7 +5605,6 @@ impl AccountsDb {
|
||||||
ancestors: &Ancestors,
|
ancestors: &Ancestors,
|
||||||
expected_capitalization: Option<u64>,
|
expected_capitalization: Option<u64>,
|
||||||
can_cached_slot_be_unflushed: bool,
|
can_cached_slot_be_unflushed: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
is_startup: bool,
|
is_startup: bool,
|
||||||
) -> (Hash, u64) {
|
) -> (Hash, u64) {
|
||||||
|
@ -5623,7 +5619,6 @@ impl AccountsDb {
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: Some(ancestors),
|
ancestors: Some(ancestors),
|
||||||
use_write_cache: can_cached_slot_be_unflushed,
|
use_write_cache: can_cached_slot_be_unflushed,
|
||||||
epoch_schedule,
|
|
||||||
rent_collector,
|
rent_collector,
|
||||||
},
|
},
|
||||||
expected_capitalization,
|
expected_capitalization,
|
||||||
|
@ -5831,7 +5826,6 @@ impl AccountsDb {
|
||||||
ancestors: &Ancestors,
|
ancestors: &Ancestors,
|
||||||
total_lamports: u64,
|
total_lamports: u64,
|
||||||
test_hash_calculation: bool,
|
test_hash_calculation: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
) -> Result<(), BankHashVerificationError> {
|
) -> Result<(), BankHashVerificationError> {
|
||||||
self.verify_bank_hash_and_lamports_new(
|
self.verify_bank_hash_and_lamports_new(
|
||||||
|
@ -5839,7 +5833,6 @@ impl AccountsDb {
|
||||||
ancestors,
|
ancestors,
|
||||||
total_lamports,
|
total_lamports,
|
||||||
test_hash_calculation,
|
test_hash_calculation,
|
||||||
epoch_schedule,
|
|
||||||
rent_collector,
|
rent_collector,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -5851,7 +5844,6 @@ impl AccountsDb {
|
||||||
ancestors: &Ancestors,
|
ancestors: &Ancestors,
|
||||||
total_lamports: u64,
|
total_lamports: u64,
|
||||||
test_hash_calculation: bool,
|
test_hash_calculation: bool,
|
||||||
epoch_schedule: &EpochSchedule,
|
|
||||||
rent_collector: &RentCollector,
|
rent_collector: &RentCollector,
|
||||||
) -> Result<(), BankHashVerificationError> {
|
) -> Result<(), BankHashVerificationError> {
|
||||||
use BankHashVerificationError::*;
|
use BankHashVerificationError::*;
|
||||||
|
@ -5870,7 +5862,6 @@ impl AccountsDb {
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: Some(ancestors),
|
ancestors: Some(ancestors),
|
||||||
use_write_cache: can_cached_slot_be_unflushed,
|
use_write_cache: can_cached_slot_be_unflushed,
|
||||||
epoch_schedule,
|
|
||||||
rent_collector,
|
rent_collector,
|
||||||
},
|
},
|
||||||
None,
|
None,
|
||||||
|
@ -7630,7 +7621,6 @@ pub mod tests {
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &EpochSchedule::default(),
|
|
||||||
rent_collector: &RentCollector::default(),
|
rent_collector: &RentCollector::default(),
|
||||||
},
|
},
|
||||||
None,
|
None,
|
||||||
|
@ -8019,7 +8009,6 @@ pub mod tests {
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &EpochSchedule::default(),
|
|
||||||
rent_collector: &RentCollector::default(),
|
rent_collector: &RentCollector::default(),
|
||||||
},
|
},
|
||||||
&get_storage_refs(&storages),
|
&get_storage_refs(&storages),
|
||||||
|
@ -8048,7 +8037,6 @@ pub mod tests {
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &EpochSchedule::default(),
|
|
||||||
rent_collector: &RentCollector::default(),
|
rent_collector: &RentCollector::default(),
|
||||||
},
|
},
|
||||||
&get_storage_refs(&storages),
|
&get_storage_refs(&storages),
|
||||||
|
@ -8110,7 +8098,6 @@ pub mod tests {
|
||||||
check_hash: false,
|
check_hash: false,
|
||||||
ancestors: None,
|
ancestors: None,
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &EpochSchedule::default(),
|
|
||||||
rent_collector: &RentCollector::default(),
|
rent_collector: &RentCollector::default(),
|
||||||
},
|
},
|
||||||
&get_storage_refs(&storages),
|
&get_storage_refs(&storages),
|
||||||
|
@ -9481,13 +9468,11 @@ pub mod tests {
|
||||||
daccounts.update_accounts_hash(
|
daccounts.update_accounts_hash(
|
||||||
latest_slot,
|
latest_slot,
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
accounts.update_accounts_hash(
|
accounts.update_accounts_hash(
|
||||||
latest_slot,
|
latest_slot,
|
||||||
&ancestors,
|
&ancestors,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -9771,7 +9756,6 @@ pub mod tests {
|
||||||
accounts.update_accounts_hash(
|
accounts.update_accounts_hash(
|
||||||
4,
|
4,
|
||||||
&Ancestors::default(),
|
&Ancestors::default(),
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -9790,7 +9774,6 @@ pub mod tests {
|
||||||
&Ancestors::default(),
|
&Ancestors::default(),
|
||||||
1222,
|
1222,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -10102,7 +10085,6 @@ pub mod tests {
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: Some(&ancestors),
|
ancestors: Some(&ancestors),
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &EpochSchedule::default(),
|
|
||||||
rent_collector: &RentCollector::default(),
|
rent_collector: &RentCollector::default(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -10134,7 +10116,6 @@ pub mod tests {
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: Some(&ancestors),
|
ancestors: Some(&ancestors),
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &EpochSchedule::default(),
|
|
||||||
rent_collector: &RentCollector::default(),
|
rent_collector: &RentCollector::default(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -10147,7 +10128,6 @@ pub mod tests {
|
||||||
check_hash,
|
check_hash,
|
||||||
ancestors: Some(&ancestors),
|
ancestors: Some(&ancestors),
|
||||||
use_write_cache: false,
|
use_write_cache: false,
|
||||||
epoch_schedule: &EpochSchedule::default(),
|
|
||||||
rent_collector: &RentCollector::default(),
|
rent_collector: &RentCollector::default(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
@ -10176,7 +10156,6 @@ pub mod tests {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
1,
|
1,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
|
@ -10189,7 +10168,6 @@ pub mod tests {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
1,
|
1,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
Err(MissingBankHash)
|
Err(MissingBankHash)
|
||||||
|
@ -10211,7 +10189,6 @@ pub mod tests {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
1,
|
1,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
Err(MismatchedBankHash)
|
Err(MismatchedBankHash)
|
||||||
|
@ -10239,7 +10216,6 @@ pub mod tests {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
1,
|
1,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
|
@ -10260,7 +10236,6 @@ pub mod tests {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
2,
|
2,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
|
@ -10292,7 +10267,6 @@ pub mod tests {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
0,
|
0,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
Ok(_)
|
Ok(_)
|
||||||
|
@ -10329,7 +10303,6 @@ pub mod tests {
|
||||||
&ancestors,
|
&ancestors,
|
||||||
1,
|
1,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default()
|
&RentCollector::default()
|
||||||
),
|
),
|
||||||
Err(MismatchedBankHash)
|
Err(MismatchedBankHash)
|
||||||
|
@ -10938,7 +10911,6 @@ pub mod tests {
|
||||||
accounts.update_accounts_hash(
|
accounts.update_accounts_hash(
|
||||||
current_slot,
|
current_slot,
|
||||||
&no_ancestors,
|
&no_ancestors,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
);
|
);
|
||||||
accounts
|
accounts
|
||||||
|
@ -10947,7 +10919,6 @@ pub mod tests {
|
||||||
&no_ancestors,
|
&no_ancestors,
|
||||||
22300,
|
22300,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
@ -10959,7 +10930,6 @@ pub mod tests {
|
||||||
&no_ancestors,
|
&no_ancestors,
|
||||||
22300,
|
22300,
|
||||||
true,
|
true,
|
||||||
&EpochSchedule::default(),
|
|
||||||
&RentCollector::default(),
|
&RentCollector::default(),
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
@ -41,7 +41,6 @@ pub struct CalcAccountsHashConfig<'a> {
|
||||||
/// does hash calc need to consider account data that exists in the write cache?
|
/// does hash calc need to consider account data that exists in the write cache?
|
||||||
/// if so, 'ancestors' will be used for this purpose as well as storages.
|
/// if so, 'ancestors' will be used for this purpose as well as storages.
|
||||||
pub use_write_cache: bool,
|
pub use_write_cache: bool,
|
||||||
pub epoch_schedule: &'a EpochSchedule,
|
|
||||||
pub rent_collector: &'a RentCollector,
|
pub rent_collector: &'a RentCollector,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6030,7 +6030,6 @@ impl Bank {
|
||||||
&self.ancestors,
|
&self.ancestors,
|
||||||
Some(self.capitalization()),
|
Some(self.capitalization()),
|
||||||
false,
|
false,
|
||||||
self.epoch_schedule(),
|
|
||||||
&self.rent_collector,
|
&self.rent_collector,
|
||||||
is_startup,
|
is_startup,
|
||||||
);
|
);
|
||||||
|
@ -6056,7 +6055,6 @@ impl Bank {
|
||||||
&self.ancestors,
|
&self.ancestors,
|
||||||
Some(self.capitalization()),
|
Some(self.capitalization()),
|
||||||
false,
|
false,
|
||||||
self.epoch_schedule(),
|
|
||||||
&self.rent_collector,
|
&self.rent_collector,
|
||||||
is_startup,
|
is_startup,
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue