Skip to content

Commit

Permalink
Use more realistic cap factor in simtest (#19862)
Browse files Browse the repository at this point in the history
## Description 

So that we can exercise cap factor is higher and lower than the gas
budget.

## Test plan 

Updating tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
halfprice authored Oct 15, 2024
1 parent e2c7aa1 commit 8fa9f57
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/sui-benchmark/tests/simtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ mod test {
let checkpoint_budget_factor; // The checkpoint congestion control budget in respect to transaction budget.
let txn_count_limit; // When using transaction count as congestion control mode, the limit of transactions per object per commit.
let max_deferral_rounds;
let cap_factor_denominator;
{
let mut rng = thread_rng();
mode = if rng.gen_bool(0.33) {
Expand All @@ -478,7 +479,9 @@ mod test {
rng.gen_range(0..20) // Short deferral round (testing cancellation)
} else {
rng.gen_range(1000..10000) // Large deferral round (testing liveness)
}
};

cap_factor_denominator = rng.gen_range(1..100);
}

info!(
Expand Down Expand Up @@ -514,7 +517,7 @@ mod test {
* TEST_ONLY_GAS_UNIT_FOR_HEAVY_COMPUTATION_STORAGE;
config.set_max_accumulated_txn_cost_per_object_in_narwhal_commit_for_testing(total_gas_limit);
config.set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing(total_gas_limit);
config.set_gas_budget_based_txn_cost_cap_factor_for_testing(total_gas_limit); // Not sure what to set here.
config.set_gas_budget_based_txn_cost_cap_factor_for_testing(total_gas_limit/cap_factor_denominator);
},
}
config.set_max_deferral_rounds_for_congestion_control_for_testing(max_deferral_rounds);
Expand Down

0 comments on commit 8fa9f57

Please sign in to comment.