Skip to content

Commit

Permalink
test: create a WitnessConfig that removes limits (#12642)
Browse files Browse the repository at this point in the history
Such config that disables limits is useful for tests/benchmarks. An
equivalent `test_disabled` already exists for `CongestionControlConfig`:


https://github.com/near/nearcore/blob/e692d204ed97add40f6fa5baea4477f9b28f9c49/core/parameters/src/config.rs#L217-L221

I plan to use `WitnessConfig::test_disabled` in a follow up PR to make
`benchmarknet` config adjustments.
  • Loading branch information
mooori authored Dec 19, 2024
1 parent 9b1e675 commit 2e8dcea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/parameters/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,16 @@ pub struct WitnessConfig {
/// Soft size limit of storage proof used to validate new transactions in ChunkStateWitness.
pub new_transactions_validation_state_size_soft_limit: usize,
}

impl WitnessConfig {
/// Creates a config that effectively disables ChunkStateWitness related limits by setting them
/// to max values. This can be useful for tests and benchmarks.
pub fn test_disabled() -> Self {
let max_value = usize::MAX;
Self {
main_storage_proof_size_soft_limit: max_value,
combined_transactions_size_limit: max_value,
new_transactions_validation_state_size_soft_limit: max_value,
}
}
}

0 comments on commit 2e8dcea

Please sign in to comment.