|
96 | 96 | create_program_runtime_environment_v1, create_program_runtime_environment_v2,
|
97 | 97 | },
|
98 | 98 | solana_compute_budget::compute_budget::ComputeBudget,
|
| 99 | +<<<<<<< HEAD |
99 | 100 | solana_cost_model::cost_tracker::CostTracker,
|
| 101 | +======= |
| 102 | + solana_compute_budget_instruction::instructions_processor::process_compute_budget_instructions, |
| 103 | + solana_cost_model::{block_cost_limits::simd_0207_block_limits, cost_tracker::CostTracker}, |
| 104 | +>>>>>>> 9e59baae7 (SIMD-0207: Raise block limit to 50M (#4112)) |
100 | 105 | solana_feature_set::{
|
101 | 106 | self as feature_set, remove_rounding_in_fee_calculation, reward_full_priority_fee,
|
102 | 107 | FeatureSet,
|
@@ -5066,6 +5071,22 @@ impl Bank {
|
5066 | 5071 | debug_do_not_add_builtins,
|
5067 | 5072 | );
|
5068 | 5073 |
|
| 5074 | + // Cost-Tracker is not serialized in snapshot or any configs. |
| 5075 | + // We must apply previously activated features related to limits here |
| 5076 | + // so that the initial bank state is consistent with the feature set. |
| 5077 | + // Cost-tracker limits are propagated through children banks. |
| 5078 | + if self |
| 5079 | + .feature_set |
| 5080 | + .is_active(&feature_set::raise_block_limits_to_50m::id()) |
| 5081 | + { |
| 5082 | + let (account_cost_limit, block_cost_limit, vote_cost_limit) = simd_0207_block_limits(); |
| 5083 | + self.write_cost_tracker().unwrap().set_limits( |
| 5084 | + account_cost_limit, |
| 5085 | + block_cost_limit, |
| 5086 | + vote_cost_limit, |
| 5087 | + ); |
| 5088 | + } |
| 5089 | + |
5069 | 5090 | if !debug_do_not_add_builtins {
|
5070 | 5091 | for builtin in BUILTINS
|
5071 | 5092 | .iter()
|
@@ -6639,6 +6660,63 @@ impl Bank {
|
6639 | 6660 | if new_feature_activations.contains(&feature_set::update_hashes_per_tick6::id()) {
|
6640 | 6661 | self.apply_updated_hashes_per_tick(UPDATED_HASHES_PER_TICK6);
|
6641 | 6662 | }
|
| 6663 | +<<<<<<< HEAD |
| 6664 | +======= |
| 6665 | + |
| 6666 | + if new_feature_activations.contains(&feature_set::accounts_lt_hash::id()) { |
| 6667 | + // Activating the accounts lt hash feature means we need to have an accounts lt hash |
| 6668 | + // value at the end of this if-block. If the cli arg has been used, that means we |
| 6669 | + // already have an accounts lt hash and do not need to recalculate it. |
| 6670 | + if self |
| 6671 | + .rc |
| 6672 | + .accounts |
| 6673 | + .accounts_db |
| 6674 | + .is_experimental_accumulator_hash_enabled() |
| 6675 | + { |
| 6676 | + // We already have an accounts lt hash value, so no need to recalculate it. |
| 6677 | + // Nothing else to do here. |
| 6678 | + } else { |
| 6679 | + let parent_slot = self.parent_slot; |
| 6680 | + info!( |
| 6681 | + "Calculating the accounts lt hash for slot {parent_slot} \ |
| 6682 | + as part of feature activation; this may take some time...", |
| 6683 | + ); |
| 6684 | + // We must calculate the accounts lt hash now as part of feature activation. |
| 6685 | + // Note, this bank is *not* frozen yet, which means it will later call |
| 6686 | + // `update_accounts_lt_hash()`. Therefore, we calculate the accounts lt hash based |
| 6687 | + // on *our parent*, not us! |
| 6688 | + let parent_ancestors = { |
| 6689 | + let mut ancestors = self.ancestors.clone(); |
| 6690 | + ancestors.remove(&self.slot()); |
| 6691 | + ancestors |
| 6692 | + }; |
| 6693 | + let (parent_accounts_lt_hash, duration) = meas_dur!({ |
| 6694 | + self.rc |
| 6695 | + .accounts |
| 6696 | + .accounts_db |
| 6697 | + .calculate_accounts_lt_hash_at_startup_from_index( |
| 6698 | + &parent_ancestors, |
| 6699 | + parent_slot, |
| 6700 | + ) |
| 6701 | + }); |
| 6702 | + *self.accounts_lt_hash.get_mut().unwrap() = parent_accounts_lt_hash; |
| 6703 | + info!( |
| 6704 | + "Calculating the accounts lt hash for slot {parent_slot} \ |
| 6705 | + completed in {duration:?}, accounts_lt_hash checksum: {}", |
| 6706 | + self.accounts_lt_hash.get_mut().unwrap().0.checksum(), |
| 6707 | + ); |
| 6708 | + } |
| 6709 | + } |
| 6710 | + |
| 6711 | + if new_feature_activations.contains(&feature_set::raise_block_limits_to_50m::id()) { |
| 6712 | + let (account_cost_limit, block_cost_limit, vote_cost_limit) = simd_0207_block_limits(); |
| 6713 | + self.write_cost_tracker().unwrap().set_limits( |
| 6714 | + account_cost_limit, |
| 6715 | + block_cost_limit, |
| 6716 | + vote_cost_limit, |
| 6717 | + ); |
| 6718 | + } |
| 6719 | +>>>>>>> 9e59baae7 (SIMD-0207: Raise block limit to 50M (#4112)) |
6642 | 6720 | }
|
6643 | 6721 |
|
6644 | 6722 | fn apply_updated_hashes_per_tick(&mut self, hashes_per_tick: u64) {
|
|
0 commit comments