Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Dec 11, 2024
1 parent f6417d8 commit 547b3ce
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 77 deletions.
9 changes: 1 addition & 8 deletions cost-model/src/block_cost_limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,18 @@ pub const INSTRUCTION_DATA_BYTES_COST: u64 = 140 /*bytes per us*/ / COMPUTE_UNIT
/// accumulated by Transactions added to it; A transaction's compute units are
/// calculated by cost_model, based on transaction's signatures, write locks,
/// data size and built-in and SBF instructions.
<<<<<<< HEAD
pub const MAX_BLOCK_UNITS: u64 =
MAX_BLOCK_REPLAY_TIME_US * COMPUTE_UNIT_TO_US_RATIO * MAX_CONCURRENCY;
pub const MAX_BLOCK_UNITS_SIMD_0207: u64 = 50_000_000;

#[cfg(test)]
static_assertions::const_assert_eq!(MAX_BLOCK_UNITS, 48_000_000);
=======
pub const MAX_BLOCK_UNITS: u64 = 48_000_000;
pub const MAX_BLOCK_UNITS_SIMD_0207: u64 = 50_000_000;
>>>>>>> ccb3cd3a7 (SIMD-0207: Raise block limit to 50M (#4026))

/// Number of compute units that a writable account in a block is allowed. The
/// limit is to prevent too many transactions write to same account, therefore
/// reduce block's parallelism.
pub const MAX_WRITABLE_ACCOUNT_UNITS: u64 = MAX_BLOCK_REPLAY_TIME_US * COMPUTE_UNIT_TO_US_RATIO;

<<<<<<< HEAD
#[cfg(test)]
static_assertions::const_assert_eq!(MAX_WRITABLE_ACCOUNT_UNITS, 12_000_000);

Expand All @@ -60,8 +55,6 @@ pub const MAX_VOTE_UNITS: u64 = (MAX_BLOCK_UNITS as f64 * 0.75_f64) as u64;
#[cfg(test)]
static_assertions::const_assert_eq!(MAX_VOTE_UNITS, 36_000_000);

=======
>>>>>>> ccb3cd3a7 (SIMD-0207: Raise block limit to 50M (#4026))
/// The maximum allowed size, in bytes, that accounts data can grow, per block.
/// This can also be thought of as the maximum size of new allocations per block.
pub const MAX_BLOCK_ACCOUNTS_DATA_SIZE_DELTA: u64 = 100_000_000;
Expand Down
53 changes: 0 additions & 53 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,7 @@ use {
create_program_runtime_environment_v1, create_program_runtime_environment_v2,
},
solana_compute_budget::compute_budget::ComputeBudget,
<<<<<<< HEAD
solana_cost_model::cost_tracker::CostTracker,
=======
solana_compute_budget_instruction::instructions_processor::process_compute_budget_instructions,
solana_cost_model::{block_cost_limits::simd_0207_block_limits, cost_tracker::CostTracker},
>>>>>>> ccb3cd3a7 (SIMD-0207: Raise block limit to 50M (#4026))
solana_feature_set::{
self as feature_set, remove_rounding_in_fee_calculation, reward_full_priority_fee,
FeatureSet,
Expand Down Expand Up @@ -6644,53 +6639,6 @@ impl Bank {
if new_feature_activations.contains(&feature_set::update_hashes_per_tick6::id()) {
self.apply_updated_hashes_per_tick(UPDATED_HASHES_PER_TICK6);
}
<<<<<<< HEAD
=======

if new_feature_activations.contains(&feature_set::accounts_lt_hash::id()) {
// Activating the accounts lt hash feature means we need to have an accounts lt hash
// value at the end of this if-block. If the cli arg has been used, that means we
// already have an accounts lt hash and do not need to recalculate it.
if self
.rc
.accounts
.accounts_db
.is_experimental_accumulator_hash_enabled()
{
// We already have an accounts lt hash value, so no need to recalculate it.
// Nothing else to do here.
} else {
let parent_slot = self.parent_slot;
info!(
"Calculating the accounts lt hash for slot {parent_slot} \
as part of feature activation; this may take some time...",
);
// We must calculate the accounts lt hash now as part of feature activation.
// Note, this bank is *not* frozen yet, which means it will later call
// `update_accounts_lt_hash()`. Therefore, we calculate the accounts lt hash based
// on *our parent*, not us!
let parent_ancestors = {
let mut ancestors = self.ancestors.clone();
ancestors.remove(&self.slot());
ancestors
};
let (parent_accounts_lt_hash, duration) = meas_dur!({
self.rc
.accounts
.accounts_db
.calculate_accounts_lt_hash_at_startup_from_index(
&parent_ancestors,
parent_slot,
)
});
*self.accounts_lt_hash.get_mut().unwrap() = parent_accounts_lt_hash;
info!(
"Calculating the accounts lt hash for slot {parent_slot} \
completed in {duration:?}, accounts_lt_hash checksum: {}",
self.accounts_lt_hash.get_mut().unwrap().0.checksum(),
);
}
}

if new_feature_activations.contains(&feature_set::raise_block_limits_to_50m::id()) {
let (account_cost_limit, block_cost_limit, vote_cost_limit) = simd_0207_block_limits();
Expand All @@ -6700,7 +6648,6 @@ impl Bank {
vote_cost_limit,
);
}
>>>>>>> ccb3cd3a7 (SIMD-0207: Raise block limit to 50M (#4026))
}

fn apply_updated_hashes_per_tick(&mut self, hashes_per_tick: u64) {
Expand Down
16 changes: 0 additions & 16 deletions sdk/feature-set/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,21 +881,10 @@ pub mod migrate_stake_program_to_core_bpf {
solana_pubkey::declare_id!("6M4oQ6eXneVhtLoiAr4yRYQY43eVLjrKbiDZDJc892yk");
}

<<<<<<< HEAD
=======
pub mod deplete_cu_meter_on_vm_failure {
solana_pubkey::declare_id!("B7H2caeia4ZFcpE3QcgMqbiWiBtWrdBRBSJ1DY6Ktxbq");
}

pub mod reserve_minimal_cus_for_builtin_instructions {
solana_pubkey::declare_id!("C9oAhLxDBm3ssWtJx1yBGzPY55r2rArHmN1pbQn6HogH");
}

pub mod raise_block_limits_to_50m {
solana_pubkey::declare_id!("5oMCU3JPaFLr8Zr4ct7yFA7jdk6Mw1RmB8K4u9ZbS42z");
}

>>>>>>> ccb3cd3a7 (SIMD-0207: Raise block limit to 50M (#4026))
lazy_static! {
/// Map of feature identifiers to user-visible description
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
Expand Down Expand Up @@ -1111,12 +1100,7 @@ lazy_static! {
(disable_account_loader_special_case::id(), "Disable account loader special case #3513"),
(enable_secp256r1_precompile::id(), "Enable secp256r1 precompile SIMD-0075"),
(migrate_stake_program_to_core_bpf::id(), "Migrate Stake program to Core BPF SIMD-0196 #3655"),
<<<<<<< HEAD
=======
(deplete_cu_meter_on_vm_failure::id(), "Deplete compute meter for vm errors SIMD-0182 #3993"),
(reserve_minimal_cus_for_builtin_instructions::id(), "Reserve minimal CUs for builtin instructions SIMD-170 #2562"),
(raise_block_limits_to_50m::id(), "Raise block limit to 50M SIMD-0207"),
>>>>>>> ccb3cd3a7 (SIMD-0207: Raise block limit to 50M (#4026))
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down

0 comments on commit 547b3ce

Please sign in to comment.