Skip to content

Commit

Permalink
Default to 25% for tenure_cost_limit_per_block_percentage
Browse files Browse the repository at this point in the history
Signed-off-by: Jacinta Ferrant <[email protected]>
  • Loading branch information
jferrant committed Nov 15, 2024
1 parent 21ed874 commit 0896355
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion testnet/stacks-node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2582,6 +2582,12 @@ impl MinerConfigFile {
.to_string(),
);
};
let tenure_cost_limit_per_block_percentage =
if self.tenure_cost_limit_per_block_percentage.is_none() {
miner_default_config.tenure_cost_limit_per_block_percentage
} else {
self.tenure_cost_limit_per_block_percentage
};
Ok(MinerConfig {
first_attempt_time_ms: self
.first_attempt_time_ms
Expand Down Expand Up @@ -2688,7 +2694,7 @@ impl MinerConfigFile {
first_rejection_pause_ms: self.first_rejection_pause_ms.unwrap_or(miner_default_config.first_rejection_pause_ms),
subsequent_rejection_pause_ms: self.subsequent_rejection_pause_ms.unwrap_or(miner_default_config.subsequent_rejection_pause_ms),
block_commit_delay: self.block_commit_delay_ms.map(Duration::from_millis).unwrap_or(miner_default_config.block_commit_delay),
tenure_cost_limit_per_block_percentage: self.tenure_cost_limit_per_block_percentage,
tenure_cost_limit_per_block_percentage,
})
}
}
Expand Down
5 changes: 3 additions & 2 deletions testnet/stacks-node/src/tests/nakamoto_integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5985,7 +5985,7 @@ fn clarity_burn_state() {
deploy_fee + tx_fee * tenure_count + tx_fee * tenure_count * inter_blocks_per_tenure,
);
naka_conf.add_initial_balance(PrincipalData::from(sender_signer_addr).to_string(), 100000);
naka_conf.miner.tenure_cost_limit_per_block_percentage = None;
naka_conf.miner.tenure_cost_limit_per_block_percentage = Some(100);
let stacker_sk = setup_stacker(&mut naka_conf);

test_observer::spawn();
Expand Down Expand Up @@ -7740,7 +7740,7 @@ fn check_block_info() {
naka_conf.burnchain.chain_id = CHAIN_ID_TESTNET + 1;
let http_origin = format!("http://{}", &naka_conf.node.rpc_bind);
naka_conf.miner.wait_on_interim_blocks = Duration::from_secs(1);
naka_conf.miner.tenure_cost_limit_per_block_percentage = None;
naka_conf.miner.tenure_cost_limit_per_block_percentage = Some(100);
let sender_sk = Secp256k1PrivateKey::new();
let sender_signer_sk = Secp256k1PrivateKey::new();
let sender_signer_addr = tests::to_addr(&sender_signer_sk);
Expand Down Expand Up @@ -8707,6 +8707,7 @@ fn mock_mining() {
let (mut naka_conf, _miner_account) = naka_neon_integration_conf(None);
naka_conf.miner.wait_on_interim_blocks = Duration::from_secs(1);
naka_conf.node.pox_sync_sample_secs = 30;
naka_conf.miner.tenure_cost_limit_per_block_percentage = Some(100);
let sender_sk = Secp256k1PrivateKey::new();
let sender_signer_sk = Secp256k1PrivateKey::new();
let sender_signer_addr = tests::to_addr(&sender_signer_sk);
Expand Down

0 comments on commit 0896355

Please sign in to comment.