Fix non-deterministic mempool reorg test #531
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the correct approach to fixing this issue, replacing #518 which still left us with non-deterministic outcomes.
I realized the problem is that the test called
fakeClaim()
TWICE, meaning the stub resolver actually requests cloudflare's DNSSEC chain twice from the actual legacy DNS. The non-determinism is a result of the stub resolver getting a slightly different result the second time, in particular the RRSIG over the TXT RRs in the final zone. Likely there are many redundant resolvers caching cloudflare.com's TXT RRs and the secondfakeClaim()
call sometimes ended up getting a slightly newer signature, meaning itsinception
value exceeded the current chain tip time in the test, and failed withbad-claim-time
.Here's the output of the two
fakeClaim()
proof data from the original test -- you can see theinception
andexpiration
fields are different -- this is always the case when the test fails. Sometimes the test will succeed if it actually got these two signatures in reverse order (the bug is only thrown if the second proof is newer).The new approach is to only request the DNSSEC chain once at the start of the test, and then modify the
commitHash
andcommitHeight
fields once the test chain time is already in the valid range.