-
Couldn't load subscription status.
- Fork 421
Assure BroadcasterInterface packages of len > 1 are child-with-parents #4173
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
Assure BroadcasterInterface packages of len > 1 are child-with-parents #4173
Conversation
|
👋 Thanks for assigning @tnull as a reviewer! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4173 +/- ##
==========================================
+ Coverage 88.78% 88.82% +0.03%
==========================================
Files 180 180
Lines 137066 137278 +212
Branches 137066 137278 +212
==========================================
+ Hits 121694 121936 +242
+ Misses 12552 12531 -21
+ Partials 2820 2811 -9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// package and broadcast together. Some of the transactions may or may not depend on each other, | ||
| /// be sure to manage both cases correctly. | ||
| /// If more than one transaction is given, these transactions MUST be considered to be a | ||
| /// child-with-parents package and be broadcast together. Implementations MUST NOT |
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.
nit: might be worth clarifying a single child and linking the Bitcoin Core docs (if they're online or just saying "the submitpackage RPC").
4ba0e53 to
5916b2a
Compare
| /// If more than one transaction is given, these transactions MUST be considered to be a | ||
| /// single-child-with-parents package and be broadcast together |
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.
| /// If more than one transaction is given, these transactions MUST be considered to be a | |
| /// single-child-with-parents package and be broadcast together | |
| /// If more than one transaction is given, these transactions MUST be a | |
| /// single child and its parents and be broadcast together as a package |
|
🔔 1st Reminder Hey @tnull! This PR has been waiting for your review. |
5916b2a to
aac2b29
Compare
| /// single child and its parents and be broadcast together as a package | ||
| /// (see the `submitpackage` Bitcoin Core RPC). | ||
| /// | ||
| /// Implementations MUST NOT assume any topological order on the transactions. |
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.
in submitpackage's docs it says
The package must be topologically sorted, with the child being the last element in the array.
making the user handle this seems like extra complexity that LDK should be able to handle for them
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.
LDK will still broadcast transactions topologically (and maybe we should check that in the tests @tankyleo) but the API is also sometimes used by dowstream code (eg ldk-node) and it seems like a good thing for the BroadcasterInterface implementation to re-sort topologically.
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.
Generally LGTM, one comment.
So we remove the possibility that a batch of transactions passed to a BroadcasterInterface implementation contains unrelated transactions, or multiple children.
Good, that possibly makes things a bit easier down the line also, when add a BroadcastType or similar to the BroadcasterInterface. (Will see to open a draft for this soonish)
| /// be sure to manage both cases correctly. | ||
| /// If more than one transaction is given, these transactions MUST be a | ||
| /// single child and its parents and be broadcast together as a package | ||
| /// (see the `submitpackage` Bitcoin Core RPC). |
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.
Can we add a link here, especially since Core docs for RPCs aren't super discoverable?
aac2b29 to
10a403e
Compare
Implementations MUST NOT assume any topological order on the transactions. While Bitcoin Core v29+ `submitpackage` RPC allows packages of length 1 to be submitted via `submitpackage`, it still requires any package submitted there to be a `child-with-parents` package. So we remove the possibility that a batch of transactions passed to a `BroadcasterInterface` implementation contains unrelated transactions, or multiple children.
10a403e to
7c9b21f
Compare
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.
Thanks! Gonna go ahead and land this since its just doc + test.
|
Backported to 0.2 in #4185. |
Implementations MUST NOT assume any topological order on the transactions.
While Bitcoin Core v29+
submitpackageRPC allows packages of length 1 to be submitted viasubmitpackage, it still requires all packages submitted there to bechild-with-parents.So we remove the possibility that a batch of transactions passed to a
BroadcasterInterfaceimplementation contains unrelated transactions, or multiple children.