forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge bitcoin#22674: mempool validation and submission for packages o…
…f 1 child + parents
- Loading branch information
Showing
9 changed files
with
549 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Transaction Relay Policy | ||
|
||
Policy is a set of validation rules, in addition to consensus, enforced for unconfirmed | ||
transactions. | ||
|
||
This documentation is not an exhaustive list of all policy rules. | ||
|
||
- [Packages](packages.md) | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Package Mempool Accept | ||
|
||
## Definitions | ||
|
||
A **package** is an ordered list of transactions, representable by a connected Directed Acyclic | ||
Graph (a directed edge exists between a transaction that spends the output of another transaction). | ||
|
||
For every transaction `t` in a **topologically sorted** package, if any of its parents are present | ||
in the package, they appear somewhere in the list before `t`. | ||
|
||
A **child-with-unconfirmed-parents** package is a topologically sorted package that consists of | ||
exactly one child and all of its unconfirmed parents (no other transactions may be present). | ||
The last transaction in the package is the child, and its package can be canonically defined based | ||
on the current state: each of its inputs must be available in the UTXO set as of the current chain | ||
tip or some preceding transaction in the package. | ||
|
||
## Package Mempool Acceptance Rules | ||
|
||
The following rules are enforced for all packages: | ||
|
||
* Packages cannot exceed `MAX_PACKAGE_COUNT=25` count and `MAX_PACKAGE_SIZE=101KvB` total size | ||
(#20833) | ||
|
||
- *Rationale*: This is already enforced as mempool ancestor/descendant limits. If | ||
transactions in a package are all related, exceeding this limit would mean that the package | ||
can either be split up or it wouldn't pass individual mempool policy. | ||
|
||
- Note that, if these mempool limits change, package limits should be reconsidered. Users may | ||
also configure their mempool limits differently. | ||
|
||
* Packages must be topologically sorted. (#20833) | ||
|
||
* Packages cannot have conflicting transactions, i.e. no two transactions in a package can spend | ||
the same inputs. Packages cannot have duplicate transactions. (#20833) | ||
|
||
* No transaction in a package can conflict with a mempool transaction. | ||
|
||
* When packages are evaluated against ancestor/descendant limits, the union of all transactions' | ||
descendants and ancestors is considered. (#21800) | ||
|
||
- *Rationale*: This is essentially a "worst case" heuristic intended for packages that are | ||
heavily connected, i.e. some transaction in the package is the ancestor or descendant of all | ||
the other transactions. | ||
|
||
The following rules are only enforced for packages to be submitted to the mempool (not enforced for | ||
test accepts): | ||
|
||
* Packages must be child-with-unconfirmed-parents packages. This also means packages must contain at | ||
least 2 transactions. (#22674) |
This file contains 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 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 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 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.