Avoid overflow when computing rent distribution (#12112)

* Avoid overflow when computing rent distribution

* Use assert_eq!....

* Fix tests

* Add test

* Use FeatureSet

* Add comments

* Address review comments

* Tweak a bit.

* Fix fmt
This commit is contained in:
Ryo Onodera
2020-10-01 11:59:28 +09:00
committed by GitHub
parent 8f10e407ee
commit e3773d919c
3 changed files with 138 additions and 13 deletions

View File

@@ -607,6 +607,7 @@ pub fn bank_from_archive<P: AsRef<Path>>(
panic!("Snapshot bank for slot {} failed to verify", bank.slot());
}
if genesis_config.cluster_type == ClusterType::Testnet {
// remove me after we transitions to the fixed rent distribution with no overflow
let old = bank.set_capitalization();
if old != bank.capitalization() {
warn!(