-
Notifications
You must be signed in to change notification settings - Fork 86
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
More intelligent transaction requests #1161
Comments
Moving to 1.1 as it's inessential and we need to cut the release soon. |
@dcoutts has also informed me that this PSQ should be shared between all the tx submission handlers, remote and local. |
While working on #1514, @nfrisby discovered that unlike duplicate txs, duplicate votes are not rejected. Without the improvements described in this issue, the nodes end up resubmitting the votes to each other so that blocks end up containing the same votes many, many times. (I'll use tx to mean generalised transaction, which includes votes) The approach taken in #1476 (option 2 from the description of this issue) would mitigate this, but not entirely. It helps avoid requesting duplicate txs from other nodes, but it doesn't avoid receiving duplicate txs from the (local) wallet. A proper solution would be to track in the Mempool which txids it contains and reject incoming txs/votes that are already in the Mempool. However, this would largely duplicate the txids cache of Therefore, @edsko and I came up with a new approach:
We believe this approach is simpler than the one described in (2) (reason about "recent" and time is more complicated), it fixes the duplicate votes problem @nfrisby discovered, it avoids complex interactions in #1496. The only scenario we believe in which it is worse than option (2):
I have split off option (3) in #1743. |
It's worth noting that we could mitigate this duplicate votes issue using the
|
Note that we have to be very cautious: the wallet will monitor the blockchain to verify whether or not transactions that it has submitted are eventually included, and if they aren't, resubmit them. We have to be sure that such resubmitted transactions aren't ignored. |
1747: check that Byron can increment its adopted protocol version r=nfrisby a=nfrisby I'm not sure if this should be considered to fully address #1514, but it's good first step. It originally that #1161 is high-priority because of votes: they are replicated and fill up the blocks, making the test quite expensive. Other transactions (so far) haven't been as problematic because duplicate transactions other than votes are invalid. Therefore this PR is rooted on top of a potential fix for 1161; it's blocked by the corresponding PR. Good news, though: the protocol version update is succeeding when expected. I'm opening this as Draft since it currently includes the latest state of the other PR. Co-authored-by: Nicolas Frisby <[email protected]>
UPDATE: new plan described in #1161 (comment)
Old plan:
Currently the
txSubmissionInbound
protocol handler does not look at the Mempool to see if txs are already there before requesting them. So in practice, it will needlessly download txs it already has. More confusingly, we can observe that node A sends a tx to B, which then sends it right back to A.There are multiple options to improve this situation:
txSubmissionInbound
protocol handlers) set ofTxId
s that were recently in the Mempool. They should also expire from this set, so perhaps a PSQ would be a good fit. This can subsume (1).TxId
s we're asking from which peers and don't ask for the same one from multiple peers unless that would otherwise cause things to stall, in which case we should make another request for the sameTxId
.Because of the more complex concurrency of (3), we'll keep that for later. Getting (1) working will be easy. Our current aim is to achieve (2).
The text was updated successfully, but these errors were encountered: