-
Notifications
You must be signed in to change notification settings - Fork 951
Tree-sync friendly lookup sync tests #8592
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
base: unstable
Are you sure you want to change the base?
Conversation
| // removed from the da_checker. Note that ALL components are removed from the da_checker | ||
| // so when we re-download and process the block we get the error | ||
| // MissingComponentsAfterAllProcessed and get stuck. | ||
| lookup.reset_requests(); |
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.
Bug found on testing, lookups may be stuck given this sequence of events
| // sending retry requests to the disconnecting peer. | ||
| for sync_request_id in self.network.peer_disconnected(peer_id) { | ||
| self.inject_error(*peer_id, sync_request_id, RPCError::Disconnected); | ||
| } |
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.
Minor bug, we need to remove the peer from the sync states (e.g. self.block_lookups) then inject the disconnect events. Otherwise we may send requests to peers that are already disconnected. I don't think there's risk of sync getting stuck if libp2p rejects sending messages to disconnected peers, but deserves a fix anyway.
|
This pull request has merge conflicts. Could you please resolve them @dapplion? 🙏 |
Issue Addressed
Current lookup sync tests are written in an explicit way that assume how the internals of lookup sync work. For example the test would do:
This is unnecessarily verbose. And it will requires a complete re-write when something changes in the internals of lookup sync (has happened a few times, mostly for deneb and fulu).
What we really want to assert is:
Proposed Changes
Keep all existing tests and add new cases but written in the new style described above. The logic to serve and respond to request is in this function
fn simulatehttps://github.com/dapplion/lighthouse/blob/2288a3aeb11164bb1960dc803f41696c984c69ff/beacon_node/network/src/sync/tests/lookups.rs#L301CompleteStrategywhere you can set for example "respond to BlocksByRoot requests with empty"TestConfigAlong the way I found a couple bugs, which I documented on the diff.
Review guide
Look at
lighthouse/beacon_node/network/src/sync/tests/lookups.rsdirectly (no diff).Other changes are very minor and should not affect production paths