From 4dbbcbdf7ec2292d5baee3cb69c3d9c9698886be Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Sun, 23 Apr 2023 14:48:40 +0900 Subject: [PATCH] Assert there's no active scheduler before freezing --- runtime/src/bank.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 48a6e9bdc39ba9..5f2d5a0ffd94ce 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -3236,6 +3236,10 @@ impl Bank { // committed before this write lock can be obtained here. let mut hash = self.hash.write().unwrap(); if *hash == Hash::default() { + // there should be no active scheduler at this point, which + // might be actively mutating bank state... + assert!(!self.with_scheduler()); + // finish up any deferred changes to account state self.collect_rent_eagerly(); self.collect_fees();