-
Notifications
You must be signed in to change notification settings - Fork 113
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
fix(test): avoid failing getblocktemplate acceptance test when the chain tip changes #6091
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, let's run it a few times to make sure that it works?
Co-authored-by: teor <[email protected]>
It ran successfully a few times but I changed the constants to make 300 block proposals at 5 second intervals to be sure. I'll try 3000 if that succeeds. Update: It succeeded with 300. Update: 3000 failed with "not based on the current best chain tip", possibly because it was dropping the send futures. Update: 1000 succeeded. I'm going to try a shorter Update: a shorter extra longpoll wait time worked too (with 2500 iterations). |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6091 +/- ##
==========================================
- Coverage 78.08% 78.02% -0.06%
==========================================
Files 304 304
Lines 39035 39035
==========================================
- Hits 30482 30459 -23
- Misses 8553 8576 +23 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're dropping some futures, but you might want to be awaiting them?
https://github.com/ZcashFoundation/zebra/actions/runs/4071294784/jobs/7012969586#step:8:970
Because send is cancel-safe, you might not be sending any messages on these channels at all:
https://docs.rs/tokio/latest/tokio/sync/mpsc/struct.Sender.html#method.send
Depending on the behaviour you want, you could await the futures or use blocking_send(). If there is any risk of deadlocks or hangs, then try_send() or send_timeout() might be better.
🤦Thank you. I somehow missed the |
I updated the constants to run the proposal test 1000x at 300ms interval. The log for an interrupt by a template with
https://github.com/ZcashFoundation/zebra/actions/runs/4078725058/jobs/7030039421#step:8:1096 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some concerns about the reliability of the timings used here, but I'm not sure if they are blockers.
These are excellent notes that have helped me notice some additional mistakes in this PR, but I'd like to handle these in a new PR so that the issue doesn't cause any more improper CI failures in the meantime. Your concerns are perceptive, the timings - particularly |
@Mergifyio rebase |
❌ Base branch update has failedGit reported the following error:
err-code: 46491 |
@arya2 did you want to fix the merge conflict then I can approve? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give this a shot!
In your next PR, would you mind reducing the verbose test output, if it isn't already fixed in this PR?
https://github.com/ZcashFoundation/zebra/actions/runs/4080594267/jobs/7033830311#step:8:199 Some of these transactions, blocks, or templates can contain 4MB of hex data. And sometimes GitHub won't load the logs if they are too big. |
Motivation
We need to ensure that block templates remain valid for repeated proposal checks.
See #5963 (comment).
Closes #6079.
I was hoping to add/retain test coverage but this grew more complicated than expected so let me know if one of the alternative designs on that issue would be preferable.
Complex Code or Requirements
This PR adds some concurrency in
try_validate_block_template
:submit_old: false
tolong_poll_result_rx
until receiving a message ondone_rx
select!
for cancelling block proposals and making new requests when receiving messages fromlong_poll_result_rx
Solution
getblocktemplate
with long pollingsubmit_old: false
are receivedRelated changes:
Review
Let me know if one of the alternative designs would be preferable.
Reviewer Checklist
Follow Up Work