-
Notifications
You must be signed in to change notification settings - Fork 700
Test: Fix miner_constructs_replay_block
#6399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
miner_constructs_replay_block
Why is there no mining thread running? |
In this case, it's because the nakamoto relay thread starts up at block 230 so that it can submit a nakamoto block commit for block 231 (the block at which nakamoto activates). But, even though the miner won block 230, it was pre-nakamoto, so the miner thread either shouldn't start at all (a change this PR makes) or starts up but errors before ever flipping the fault injection flag from PENDING to STALLED. |
|
What if instead of this change, we add the logic in the Neon miner to also stall based on this flag and switch the flag from Or is the Neon miner not running either in this case? |
So the sequence for the (unpatched) version of this test where things pass is something like:
The sequence where things fail is something like:
So, there is no nakamoto miner thread and there is no epoch 2.x thread. Note, the miner thread would have aborted in the "success" case if it didn't hit the stall directive. The "race" is between the test thread discovering that a nakamoto block commit has been issued+issuing the stall and the relayer thread spawning a miner + attempting to mine. So, it's kind of lucky that the success case works at all because it has a test thread racing to get a directive set before the miner thread discovers that it should abort. We could weight the race more in the test thread's favor by moving the stall directive before the wait for block commits command, but I think its better to just not race here. |
e16b7ef
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #6399 +/- ##
===========================================
+ Coverage 75.33% 79.40% +4.07%
===========================================
Files 555 555
Lines 350915 350927 +12
===========================================
+ Hits 264358 278666 +14308
+ Misses 86557 72261 -14296
... and 256 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This should fix the
miner_constructs_replay_blocktest in CI. It does two things: