chain: Handle txpool conflicts properly #120
Merged
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.
This PR changes the txpool to reject transactions that conflict with transactions already in the pool. As a result, the set of transactions in the pool should always be mutually valid (albeit possibly too large to fit in one block). Previously, conflicting transactions were allowed to coexist;
siad
does this intentionally, but incoreutils
it was accidental, leading to surprising and confusing behavior.Note that there is currently no "replace-by-fee" mechanism for clearing stuck transactions from the pool. This is a somewhat contentious topic, so I'm punting on it for now. Longer term, I expect we'll want at least a basic child-pays-for-parent scheme; see the comment at the top of
revalidatePool
.Also fixed a bug in
revalidatePool
where low-fee v2 transactions were not removed.