diff --git a/.changelog/unreleased/improvements/3591-max-block-time-estimate.md b/.changelog/unreleased/improvements/3591-max-block-time-estimate.md new file mode 100644 index 0000000000..fed62890a2 --- /dev/null +++ b/.changelog/unreleased/improvements/3591-max-block-time-estimate.md @@ -0,0 +1,2 @@ +- Improved the `max_block_time` estimate. + ([\#3591](https://github.com/anoma/namada/pull/3591)) \ No newline at end of file diff --git a/crates/parameters/src/lib.rs b/crates/parameters/src/lib.rs index 55a91c75d5..9ef3591b95 100644 --- a/crates/parameters/src/lib.rs +++ b/crates/parameters/src/lib.rs @@ -622,18 +622,9 @@ where last_block_height, num_blocks_to_read, )?; - let max_block_time_estimate = - estimate_max_block_time_from_parameters(storage)?; - - Ok(maybe_max_block_time.map_or( - max_block_time_estimate, - |max_block_time_over_num_blocks_to_read| { - std::cmp::max( - max_block_time_over_num_blocks_to_read, - max_block_time_estimate, - ) - }, - )) + + maybe_max_block_time + .map_or_else(|| estimate_max_block_time_from_parameters(storage), Ok) } #[cfg(test)]