Activate eager rent collection and BPF loader on mainnet-beta epoch 34 (#10231)

This commit is contained in:
Michael Vines
2020-05-26 10:28:29 -07:00
committed by GitHub
parent e8c6233c6e
commit 55a64c8945
2 changed files with 3 additions and 6 deletions

View File

@ -72,9 +72,7 @@ pub fn get_programs(operating_mode: OperatingMode, epoch: Epoch) -> Option<Vec<(
}
}
OperatingMode::Stable => {
if epoch == std::u64::MAX - 1 {
// The epoch of std::u64::MAX - 1 is a placeholder and is expected to be reduced in
// a future hard fork.
if epoch == 34 {
Some(vec![solana_bpf_loader_program!()])
} else if epoch == std::u64::MAX {
// The epoch of std::u64::MAX is a placeholder and is expected to be reduced in a
@ -163,7 +161,7 @@ mod tests {
#[test]
fn test_softlaunch_programs() {
assert_eq!(get_programs(OperatingMode::Stable, 1), None);
assert!(get_programs(OperatingMode::Stable, std::u64::MAX - 1).is_some());
assert!(get_programs(OperatingMode::Stable, 34).is_some());
assert!(get_programs(OperatingMode::Stable, std::u64::MAX).is_some());
}
}

View File

@ -860,8 +860,7 @@ impl Bank {
// DANGER: Adjust this guard after tds has transitioned to the eager rent
// collection and ABSOLUTELY after the mainnet-beta transitions to v1.1.
if !(self.operating_mode() == OperatingMode::Preview && self.epoch() < 47
|| self.operating_mode() == OperatingMode::Stable
&& self.epoch() < Epoch::max_value())
|| self.operating_mode() == OperatingMode::Stable && self.epoch() < 34)
{
self.collect_rent_eagerly();
}