-
Notifications
You must be signed in to change notification settings - Fork 28
perf: default the orders transport to v2 (NIP-44 kind 14) #704
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d7ecbef
perf: default the orders transport to v2 (NIP-44 kind 14)
grunch 80dffa5
fix: resolve the node transport before sending, not after
grunch 5fc4e96
Merge branch 'main' into perf/default-transport-v2
grunch 683c76a
test: distinguish the chat REQ from the orders REQ by author
grunch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
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.
When a user sends an order during cold start against a supported
protocol_version=1node,MostroService.publishOrderpassesmostroInstance?.protocolVersionas null, so this branch now emits an unsupported kind-14 message that the v1 node ignores. The later instance listener only replaces the receive subscription; it cannot retry the lost outbound action. Limit the v2 default to the initial orders subscription optimization, or wait for transport discovery before selecting the outbound envelope.Useful? React with 👍 / 👎.
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.
Fixed in 80dffa5 — but by waiting for transport discovery, not by preserving the v1 default on the send path.
The concern is real: an outbound envelope on the wrong transport is dropped by the node and nothing retries it. Keeping
null → giftWrapfor sends does not fix it though, it just moves the loss: on a v2 node (the mandatory case now) a cold-start send would go out as kind 1059 and be ignored exactly the same way. Either default is a guess, and one of the two nodes always loses.So the send path no longer guesses.
OpenOrdersRepository.awaitMostroInstance()returns the cached kind-38385 info event, or waits for it (bounded, 3s, well under the 10s orphan-session cleanup timer) and logs + falls back to the previous defaults on timeout. Applied at everywrapForTransportcall site:MostroService.publishOrder,DisputeRepository, and the three restore requests. Same call also removes the PoW-0 guess those paths had, which had the same root cause.The v2 default in
resolveTransportstays as the last-resort fallback for the case where the info event genuinely never arrives.Tests:
test/data/repositories/open_orders_repository_await_instance_test.dartpins the three outcomes (cached, resolves on arrival, null on timeout). Full suite green (1196),flutter analyzeclean.