-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix double BlockRequest after announcement #1215
Conversation
|
iirc, initially the reason behind two counters was:
That said, if I understand correctly, the whole |
|
Well, this problem occurs now because, because of other constrains we had to move |
|
cc @arkpar |
svyatonik
left a comment
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.
IMO maintain_sync is called where it should be (but probably better ask @arkpar about that). I'm happy with the fix, but still suggest you to remove the changed line at all, because peer.common_number should always be <= import_status.best_importing_number. Feel free to merge as-is if you're unsure.
|
Looks correct to me |
|
This seems to have broken syncing with fork and ancestry search tests. |
|
Yeah, I noticed at least test is failing with this, so we might have to find a different approach after all.. |
|
Superseded by #1235 |
* companion pr for paritytech#6235 * ??? * nah doesn't work for my branch * bump Cargo.lock * bump kusama spec versin * bump kusama spec version * revert to master * bump Cargo.lock Co-authored-by: Bastian Köcher <[email protected]>
While investigating the CPU spikes at import, I noticed that we are requesting a block twice after it as announced. Turns out that we are tracking the
queue_best_numbertwice, once in the importqueue itself and once prior to that and because of the order in items are called, they are not in sync at that particular moment after we have received the latest block and before the handover to the importqueue - but exactly at that moment do we check whether we should download further blocks against the importqueue, which doesn't yet know of the new block. And we happen to request the same block again - but only twice because right after the request we successfully import the block and the next response is actually ignored.The fix is simple: we need to check the local value not the remote value. This PR does that and the logs show no double imports or requests anymore.