Account for possibility of cache flush in load() (#15454)

* Account for possibility of cache flush in load()

* More cleaning

* More cleaning

* Remove unused method and some comment cleaning

* Fix typo

* Make the detected impossible purge race panic()!

* Finally revert to original .expect()

* Fix typos...

* Add assertion for max_root for easier reasoning

* Reframe races with LoadHint as possible opt.

* Fix test

* Make race bug tests run longer for less flaky

* Delay the clone-in-lock slow path even for RPC

* Make get_account panic-free & add its onchain ver.

* Fix rebase conflicts...

* Clean up

* Clean up comment

* Revert fn name change

* Fix flaky test...

* fmt...

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
carllin
2021-04-16 08:23:32 -07:00
committed by GitHub
parent 6dab20812e
commit d747614b27
9 changed files with 1109 additions and 266 deletions

View File

@ -434,7 +434,7 @@ impl<'a> InvokeContext for ThisInvokeContext<'a> {
// Load it
result = self
.account_db
.load_slow(self.ancestors, id)
.load_with_fixed_root(self.ancestors, id)
.map(|(account, _)| Rc::new(account.data().clone()));
// Cache it
self.sysvars.push((*id, result.clone()));