-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement LLMQ based InstantSend #2735
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
Conversation
UdjinM6
left a comment
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.
A few quick comments
b650a05 to
72d220c
Compare
|
Forgot to mention in the PR description that this PR also changes the behavior of ChainLocks when the new InstantSend system is activated. It will only try to ChainLock the tip when all included TXs were locked before or are old enough to be sure that there won't be conflicting InstantSend locks popping up. This disincentives miners to include TXs that are not publicly known/propagated for now, as they risk creating a block that never gets ChainLocked. I'll later implement InstantSend locking of transactions that were published through mined blocks, which will then allow retroactive ChainLocking of the affected blocks. |
UdjinM6
left a comment
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.
a couple more
c141700 to
d185f90
Compare
|
Rebased on develop and force-pushed |
991c4e6 to
2da8d74
Compare
We can reconstruct recovered sigs from other P2P messages to avoid re-validation of those. We will do this later in InstantSend code.
This also includes handling of TXs that were previously orphanced
The new system does not require explicit lock requests, so we downgrade TXLOCKREQUEST to TX and start propagating it instead of the original.
Later commits will introduce checks for "safe TXs" which might abort the signing on first try, but succeed a few seconds later, so we periodically retry to sign the tip.
Safe means that the TX is either ixlocked or known since at least 10 minutes. Also change miner code to only include safe TXs in block templates.
…d fix CheckCanLock to respect mempool limits)
Return value is unused and the method actually never returned something.
…l.py Otherwise we overload Travis and tests start to randomly fail.
Otherwise we'll miss checks for ancestors.
8d7bcc6 to
06fc655
Compare
UdjinM6
left a comment
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.
👍
ACK
This PR includes an initial implementation of LLMQ based InstantSend. It is meant to be present in parallel to the old InstantSend system.
Switching between the old and the new system happens via
SPORK_2_INSTANTSEND_ENABLED, which became a new meaning. When set to 0 (as on testnet/mainet right now), it will use the old system. When set to 1, it will use the new system. When set to anything else, it's considered disabled. This is only meant to be temporary until the old system is removed, at which time we can revert back to the old meaning of spork 2.The new system is very likely not going to be ready for v14, so we won't activate it. Reason is that more testing is required, especially in regard to performance and load.
The new system has a few differences to the old system:
I did quite a bit of load testing on private devnets and also plan to make a public devnet in the next days so that people can play around. Results of the load testing so far:
As an alternative to the signing session code rewrite for UDP and targeting v15 (or whatever the next version would be), another option is to add another minimum TX fee for large TXs. This would allow to add LLMQ based InstantSend to v14 and then later optimize it so that all TXs can use it, independent from their size.