@@ -1410,17 +1410,24 @@ impl Bank {
14101410 bank.update_recent_blockhashes();
14111411 bank.fill_missing_sysvar_cache_entries();
14121412
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
14181418 .feature_set
14191419 .is_active(&feature_set::move_accumulator_to_end_of_block::id())
1420- || bank
1420+ ^ bank
14211421 .feature_set
14221422 .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 {
14241431 bank.update_accumulator();
14251432 }
14261433
@@ -1789,17 +1796,24 @@ impl Bank {
17891796 );
17901797
17911798 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
17971804 .feature_set
17981805 .is_active(&feature_set::move_accumulator_to_end_of_block::id())
1799- || new
1806+ ^ new
18001807 .feature_set
18011808 .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 {
18031817 new.update_accumulator();
18041818 }
18051819 });
@@ -3534,14 +3548,22 @@ impl Bank {
35343548 // committed before this write lock can be obtained here.
35353549 let mut hash = self.hash.write().unwrap();
35363550 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
35393556 .feature_set
35403557 .is_active(&feature_set::move_accumulator_to_end_of_block::id())
3541- && ! self
3558+ ^ self
35423559 .feature_set
35433560 .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 {
35453567 self.update_accumulator();
35463568 } else {
35473569 info!(
0 commit comments