mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
tracing: cast block_connected duration to nanoseconds
When the tracepoint was introduced in8f37f5c2a5, the connect_block duration was passed in microseconds `µs`. By starting to use steady clock infabf1cdb20this changed to nanoseconds `ns`. As the test only checked if the duration value is `> 0` as a plausibility check, this went unnoticed. I detected this when setting up monitoring for block validation time as part of the Great Consensus Cleanup Revival discussion. This change casts the duration explicitly to nanoseconds (as it has been nanoseconds for the last three releases; switching back now would 'break' the broken API again; there don't seem to be many users affected), updates the documentation and adds a check for an upper bound to the tracepoint interface tests. The upper bound is quite lax as mining the block takes much longer than connecting the empty test block. It's however able to detect incorrect duration units passed.
This commit is contained in:
parent
9cb9651d92
commit
cd0edf26c0
4 changed files with 17 additions and 10 deletions
|
|
@ -2738,7 +2738,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
|
|||
block.vtx.size(),
|
||||
nInputs,
|
||||
nSigOpsCost,
|
||||
time_5 - time_start // in microseconds (µs)
|
||||
Ticks<std::chrono::nanoseconds>(time_5 - time_start)
|
||||
);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue