-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
instantsend: Implement Spork 2 Mempool Signing signalling #4024
instantsend: Implement Spork 2 Mempool Signing signalling #4024
Conversation
Signed-off-by: pasta <pasta@dashboost.org>
This spork tells masternodes to refuse to lock transactions in mempool. Only transactions included in a block should be retroactively signed. Signed-off-by: pasta <pasta@dashboost.org> add spork defenition Signed-off-by: pasta <pasta@dashboost.org>
…lmq/*` Signed-off-by: pasta <pasta@dashboost.org>
Signed-off-by: pasta <pasta@dashboost.org>
… usage Signed-off-by: pasta <pasta@dashboost.org>
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.
Interesting idea 👍
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
Signed-off-by: pasta <pasta@dashboost.org>
…a/dash into instantsend-signing-spork
See latest |
Signed-off-by: pasta <pasta@dashboost.org>
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.
See comments below + PR descriptions needs some update (spork24 removal) now.
@@ -422,7 +439,7 @@ bool CInstantSendManager::ProcessTx(const CTransaction& tx, bool allowReSigning, | |||
if (quorumSigningManager->GetVoteForId(llmqType, id, otherTxHash)) { | |||
if (otherTxHash != tx.GetHash()) { | |||
LogPrintf("CInstantSendManager::%s -- txid=%s: input %s is conflicting with previous vote for tx %s\n", __func__, | |||
tx.GetHash().ToString(), in.prevout.ToStringShort(), otherTxHash.ToString()); | |||
tx.GetHash().ToString(), in.prevout.ToStringShort(), otherTxHash.ToString()); |
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.
are this one and the other two whitespace changes below intentionally?
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.
Also, thoughts about IsInstantSendSigningEnabled
-> IsInstantSendMempoolSigningEnabled
?
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
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.
I would probably avoid making whitespace changes but it's not a big deal imo and everything else LGTM, so
utACK
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.
utACK with the same opinion about the whitespace stuff + note that the PR description is still mentioning the dropped spork.
* instantsend: refactor input locking into it's own method Signed-off-by: pasta <pasta@dashboost.org> * instantsend: introduce spork 24 `SPORK_24_INSTANTSEND_SIGNING_ENABLED` This spork tells masternodes to refuse to lock transactions in mempool. Only transactions included in a block should be retroactively signed. Signed-off-by: pasta <pasta@dashboost.org> add spork defenition Signed-off-by: pasta <pasta@dashboost.org> * instantsend: refactor `sed -i 's/allowReSigning/fRetroactive/g' src/llmq/*` Signed-off-by: pasta <pasta@dashboost.org> * instantsend: adjust comments Signed-off-by: pasta <pasta@dashboost.org> * instantsend/tests: implement Spork 24 support in tests, and test it's usage Signed-off-by: pasta <pasta@dashboost.org> * fix feature_llmq_is_retroactive.py Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com> * drop Spork 24 and use Spork 2 value 1 as being no mempool signing Signed-off-by: pasta <pasta@dashboost.org> * fix spork check Signed-off-by: pasta <pasta@dashboost.org> * Fix tests Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * Change comment Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> * IsInstantSendSigningEnabled -> IsInstantSendMempoolSigningEnabled Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com> Co-authored-by: dustinface <35775977+xdustinface@users.noreply.github.com>
This PR implements a new Spork,
SPORK_24_INSTANTSEND_SIGNING_ENABLED
Previously, the Dash network has seen InstantSend fail under extremely high load. These IS failures have resulted in diminished or non-operational chainlocks. We have worked to heavily optimize IS creation and propagation with the implementation of Concentrated Recovery as well as just pure optimization, however even with that, so much CPU can only do so much. It is likely that in order to massively scale InstantSend masternodes will need to upgrade their hardware. However, with current average usage, it makes almost no sense for masternodes to upgrade, as current hardware easily handles average load.
To mitigate these InstantSend failures further, there are a number of improvements we should investigate.
There are also some future optimizations to look into (I haven't thought TOO much about these options so 🤷 )
4. Implementation of Input Lock batch creation & / or InstantSend Lock batch creation
5. Implementation of Input Lock batch propagation
I propose that even in the case that IS becomes overloaded, potentially in a sustained attack lasting a week or more, ChainLocks should remain operational. In order to achieve this, I propose that InstantSend be disabled in the case of InstantSend failures resulting in diminished or non-operational ChainLocks.
We could achieve this currently by simply disabling Spork 2, however I think that this has a couple of problems. After we disable spork 2, transactions that had previously been locked will no longer retain the protections of instantsend. Additionally, normal miners will no longer only include "safe" transactions. By introducing this Spork24, we can first disable spork24, at this point MNs will stop creating new input locks or instantsend locks for transactions only in mempool (however we keep creating islocks for transactions included in a block such that that block can be CLed ASAP). Once no transactions on the network are ISlocked, then Spork 2 can safely be disabled. At this point, miners can include any valid transactions (not just "safe" txes), and those blocks will be CLed.
LMK if you think of a better way to achieve this, it may be possible to just modify the behavior of Spork2, but I think this approach may be safer.
EDIT: Changed to using spork2 value 1 instead of spork 24 as indicating no mempool signing