Skip to content
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

Improve handling of messages with incorrect session ID in protocol execution loop #1151

Open
ameba23 opened this issue Nov 6, 2024 · 0 comments
Assignees

Comments

@ameba23
Copy link
Contributor

ameba23 commented Nov 6, 2024

Merging #1140 means the way we handle protocol messages with the wrong session ID has become less efficient.

In practice this happens during DKG where we run 3 sub-protocols one after the other on the same websocket connection, and usually some peers finalize one protocol and start sending the first messages from the next while others are still finalizing the first protocol.

The strategy here is to put the messages back into the incoming message channel and process them later. Since i changed how this works when parallelizing message processing, messages keep popping back out as soon as they go in.

We can see this as there are many log lines like this when testing the DKG protocol:

WARN entropy_protocol::execute_protocol: Got protocol message with incorrect session ID - putting back in queue

The protocol does finish successfully, but there is some unnecessary work done.

I think this should be fairly easy to fix by storing these messages in a VecDeque until the end of the current session. This is what was happening before but it somehow got lost in the shift around in that PR.

@ameba23 ameba23 self-assigned this Nov 6, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Entropy Core Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant