-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Approval-distribution: Fix out-of-view messages caused by a race condition in view updates #5089
Conversation
This seems to make sense, although the intention of What I'm getting at is that it seems an alternate fix could be made by simply reversing the order of these two blocks: polkadot/node/network/approval-distribution/src/lib.rs Lines 352 to 364 in e6fa871
and
Please add a unit test. |
Yes, just a reversing the order of these code blocks resolves the issue as well. Should we use this approach? |
Yes please. That approach is cleaner. |
This is done: tested on unit test and in the problematic zombienet scenario. |
Thanks! |
This issue occurs when we have received a peer's view update before our own view update. In this case, we ignore all unknown heads in the remote view and attach assignment/approval messages to a list of pending messages. However, after our view update the remote views are not updated and it leads to a situation when we report honest peers for out-of-view messages. With this patch, we assume that if we know some head and a peer has already sent us some information about this particular head (in assignment/approval MessagesPending) it also means that a peer has actually this head in it's view even if we skipped it due to the race condition between local/remote view updates.