@@ -1410,17 +1410,24 @@ impl Bank {
1410
1410
bank.update_recent_blockhashes();
1411
1411
bank.fill_missing_sysvar_cache_entries();
1412
1412
1413
- // If the accumulator is not moved to end of block, update the
1414
- // accumulator last to make sure that the solana fully updated
1415
- // state before the accumulator is used. bank is in a fully
1416
- // updated state before the accumulator is used .
1417
- if ! bank
1413
+ // The features are activated one after another.
1414
+ // The accumulator is moved to end of the block either if the
1415
+ // move_accumulator_to_end_of_block feature is active or if all
1416
+ // the features are active .
1417
+ let accumulator_moved_to_end_of_block = bank
1418
1418
.feature_set
1419
1419
.is_active(&feature_set::move_accumulator_to_end_of_block::id())
1420
- || bank
1420
+ ^ bank
1421
1421
.feature_set
1422
1422
.is_active(&feature_set::undo_move_accumulator_to_end_of_block::id())
1423
- {
1423
+ ^ bank
1424
+ .feature_set
1425
+ .is_active(&feature_set::redo_move_accumulator_to_end_of_block::id());
1426
+ // If the accumulator is not moved to end of block, update the
1427
+ // accumulator last to make sure that the solana fully updated
1428
+ // state before the accumulator is used. bank is in a fully
1429
+ // updated state before the accumulator is used.
1430
+ if !accumulator_moved_to_end_of_block {
1424
1431
bank.update_accumulator();
1425
1432
}
1426
1433
@@ -1789,17 +1796,24 @@ impl Bank {
1789
1796
);
1790
1797
1791
1798
let (_, update_accumulator_time) = measure!({
1792
- // If the accumulator is not moved to end of block, update the
1793
- // accumulator last to make sure that all fully updated state before
1794
- // the accumulator sysvar updates. sysvars are in a fully updated
1795
- // state before the accumulator sysvar updates .
1796
- if ! new
1799
+ // The features are activated one after another.
1800
+ // The accumulator is moved to end of the block either if the
1801
+ // move_accumulator_to_end_of_block feature is active or if all
1802
+ // the features are active .
1803
+ let accumulator_moved_to_end_of_block = new
1797
1804
.feature_set
1798
1805
.is_active(&feature_set::move_accumulator_to_end_of_block::id())
1799
- || new
1806
+ ^ new
1800
1807
.feature_set
1801
1808
.is_active(&feature_set::undo_move_accumulator_to_end_of_block::id())
1802
- {
1809
+ ^ new
1810
+ .feature_set
1811
+ .is_active(&feature_set::redo_move_accumulator_to_end_of_block::id());
1812
+ // If the accumulator is not moved to end of block, update the
1813
+ // accumulator last to make sure that all fully updated state before
1814
+ // the accumulator sysvar updates. sysvars are in a fully updated
1815
+ // state before the accumulator sysvar updates.
1816
+ if !accumulator_moved_to_end_of_block {
1803
1817
new.update_accumulator();
1804
1818
}
1805
1819
});
@@ -3534,14 +3548,22 @@ impl Bank {
3534
3548
// committed before this write lock can be obtained here.
3535
3549
let mut hash = self.hash.write().unwrap();
3536
3550
if *hash == Hash::default() {
3537
- // Update the accumulator before doing other tasks when freezing to avoid any conflicts.
3538
- if self
3551
+ // The features are activated one after another.
3552
+ // The accumulator is moved to end of the block either if the
3553
+ // move_accumulator_to_end_of_block feature is active or if all
3554
+ // the features are active.
3555
+ let accumulator_moved_to_end_of_block = self
3539
3556
.feature_set
3540
3557
.is_active(&feature_set::move_accumulator_to_end_of_block::id())
3541
- && ! self
3558
+ ^ self
3542
3559
.feature_set
3543
3560
.is_active(&feature_set::undo_move_accumulator_to_end_of_block::id())
3544
- {
3561
+ ^ self
3562
+ .feature_set
3563
+ .is_active(&feature_set::redo_move_accumulator_to_end_of_block::id());
3564
+ // If accumulator move to end of block is active update the accumulator before doing
3565
+ // other tasks when freezing to avoid any conflicts.
3566
+ if accumulator_moved_to_end_of_block {
3545
3567
self.update_accumulator();
3546
3568
} else {
3547
3569
info!(
0 commit comments