Conversation
| // Add 100 blocks margin to account for block time variance and ensure attestation is | ||
| // reliably expired. This assumed that 100 blocks takes always more than `ATTESTATION_EXPIRY_SECONDS` seconds |
There was a problem hiding this comment.
How are we coming up with these estimations and how do they reflect reality?
There was a problem hiding this comment.
the de-facto estimation is 1 second per block, but the test was failing sometimes, probably due to exactly that. So here I am making sure we give it more time, and if that's not the case the failure should point that out.
| let block_info = worker.view_block().await?; | ||
| let current_timestamp = block_info.timestamp() / 1_000_000_000; | ||
| // Putting this assertion here such that if the test fails for this reason | ||
| // we already know | ||
| assert!( |
There was a problem hiding this comment.
Sorry to bother, but could you explain to me what is happening so I can learn?
There was a problem hiding this comment.
the test was failing, probably due to the blocks being executed much faster than expected. Now I test explicitly if what we expected, that the expiry time passed after a number of blocks, is correct. If in the future the test fails, but in another place, then we know that time was not the problem
|
CI failed above, but it was another test |
Closes #1900