You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Re-resolve held sends when routing information changes - #95
Currently, Ziggurat only considers a route resolved when a route discovery is explicitly answered.
This isn't the only way a route can be discovered, there are some implicit sources that this PR now allows Ziggurat to consider:
With source routing, a route record arrives after discovery has started. This provides routing information independent from the discovery and can be used immediately.
A device-originated route request
A route reply that passes through the coordinator
To simplify the design, I've consolidated route discovery logic into the routing table. This slowly drifted during the various redesigns and is now roped back into one spot.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Discovery cleanup can incorrectly mark a successfully learned active route as failed, while conditional wakeups can leave held sends blocked despite available routes.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Discovery entries are retired before held sends are routed and without matching request IDs, risking stranded sends and accidental removal of newer discoveries.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Removing legacy wire status 3 breaks compatibility with older v2 firmware, while discovery lifecycle issues can leave broadcasts running and suppress fresh route requests.
No open issues 🎉
3 previously missed issues
In code that hasn't changed since last review
Preserve legacy wire status value 3 for v2 decoding
crates/ziggurat-protocol/src/wire.rs:715
Please retain wire value 3 as a legacy status even though the driver no longer emits it. PROTOCOL_VERSION is still 2, and older v2 firmware can send this value; removing the variant makes SendStatus::try_from(3) and confirmation-payload decoding reject a previously valid notification. Keeping the wire variant does not require retaining the driver's obsolete error or its bridge mapping.
Retire discovery after implicit route releases held sends
crates/ziggurat-zigbee/src/nwk/routing.rs:331
An implicit route can release all held sends without setting answered, so the old discovery remains tracked until its deadline. If that path then fails and another send arrives before the deadline, want_route suppresses a new request; with the default single attempt, the later send fails when the old discovery expires without ever trying a fresh route. Retire the discovery when an implicit route actually releases its sends, while retaining unanswered discoveries when sends were merely cancelled.
Stop route broadcasts when abandoned discoveries expire
crates/ziggurat-zigbee/src/nwk/routing.rs:341
When a discovery lapses after its last held send was cancelled, this branch drops the discovery without stopping its registered route-request broadcast. Copies delayed beyond the discovery lifetime, or spaced out by a long retry interval, can therefore still transmit. Report abandoned destinations separately so drive_sends can stop those copies without invalidating a usable route.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved wire-compatibility and route-discovery lifecycle bugs can reject legacy confirmations, accept late or conflicted route replies, and delay or prematurely fail held sends.
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
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.
Currently, Ziggurat only considers a route resolved when a route discovery is explicitly answered.
This isn't the only way a route can be discovered, there are some implicit sources that this PR now allows Ziggurat to consider:
To simplify the design, I've consolidated route discovery logic into the routing table. This slowly drifted during the various redesigns and is now roped back into one spot.