Skip to content

Commit dcedafc

Browse files
authored
Merge pull request #3694 from autonomys/adjust_slow_check
Adjust reference execution time threshold when checking the actual block execution time
2 parents 0648bb9 + f6dc8cf commit dcedafc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/sc-consensus-subspace/src/block_import.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,11 @@ where
727727
return Ok(result);
728728
}
729729

730+
// this is the actual reference execution time for the given block weight.
731+
// but we need add some buffer here to allow for block import processing
732+
// apart from the actual execution. A 200ms should be good enough.
730733
let reference_execution_time_ms =
731-
runtime_api.block_weight(best_hash)?.ref_time() / WEIGHT_REF_TIME_PER_MILLIS;
734+
(runtime_api.block_weight(best_hash)?.ref_time() / WEIGHT_REF_TIME_PER_MILLIS) + 200;
732735

733736
if actual_execution_time_ms > reference_execution_time_ms as u128 {
734737
warn!(

0 commit comments

Comments
 (0)