Send flood ACK on DM retries - #3260
Open
Stempit wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve DM ACK delivery on weak / asymmetric links
Problem
On weak or asymmetric links (and with moving nodes) direct messages ACKs often have a low delivery rate. The message itself gets through, but the ACK sent back along the reverse path does not. The sender keeps retrying and the recipient keeps replying with ACKs, yet none of them arrive, so the sender shows the message as undelivered even though it was actually delivered.
The root cause: once a path is established, the recipient always sends the ACK back along the stored reverse path. If that reverse direction doesn't work (asymmetric link), every ACK (including the ones for retries) goes down the same dead path.
Change
When a message arrives as a retry (meaning the sender didn't receive the ACK for the previous attempt), the recipient sends the ACK by flood instead of along the failing saved path. Flooding reaches the sender by any working route.
The first attempt still uses a normal direct ACK, so nothing changes on healthy links. The flood only happens when the direct ACK has already failed. The retry is detected from the message's existing attempt counter, so there is no new field, config, or protocol change.
Current flow:
A times out, retransmits:
And every retry's ACK goes down the same dead reverse path.
And result shows "NOT DELIVERED", but B actually got it.
With this changes:
A times out, retransmits:
Result: A marks DELIVERED, stops retrying
Yes, this adds some flood load. But only one tiny ACK packet, and only on a retry.
In practice it reduces load overall: now some people work around the poor ACK rate by using a private channel for two people instead of DMs, and channel messages generate more flood traffic than a single ACK.
I tested this change in my city and found that It noticeably improves DM delivery confirmation and the overall DM experience.
And the same changes applies to the other roles that generate DM ACKs: