Skip to content
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

Avoid propagating InstantSend related old recovered sigs #3145

Merged
merged 5 commits into from
Oct 16, 2019

Conversation

codablock
Copy link

This PR implements "truncating" of recovered sigs in the LLMQ DB. Truncating means that the sig itself is deleted from the DB, but the hash of it is left in the DB so that we won't re-request it later. It also avoids reprocessing of the sig when another node sends it to us after we've already got it from another node.

This fixes issues when other nodes are unable to keep up with the network. In this case requesting sigs from them will timeout and cause us to re-request from another node. When we then get the sig from the second node, we'll process and relay it. If an InstantSend lock comes in which uses that sig, the code in CInstantSendManager causes the recovered sig to be deleted by calling RemoveRecoveredSig. After some time, the first node might end up sending us the same sig again, causing us to re-process and re-propagate the recovered signature. Neighbor nodes will now get the same sig from us, even thought they also have seen it already, which makes them re-process and re-propagate it as well. This then continues until the whole network has seen and processed the sig twice.

Changing the removal to "truncating" fixes this issue as it stops re-processing and re-propagation.

@codablock codablock added this to the 14.1 milestone Oct 11, 2019
Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@UdjinM6 UdjinM6 merged commit efd8d2c into dashpay:develop Oct 16, 2019
barrystyle pushed a commit to PACGlobalOfficial/PAC that referenced this pull request Jan 22, 2020
* More/better logging for InstantSend

* Implement CRecoveredSigsDb::TruncateRecoveredSig

* Truncate recovered sigs for ISLOCKs instead of completely removing them

This makes AlreadyHave() return true even when the recovered sig is deleted
locally. This avoids re-requesting and re-processing of old recovered sigs.

* Also truncate recovered sigs for freshly received ISLOCKs

* Fix comment
panleone pushed a commit to panleone/PIVX that referenced this pull request Nov 15, 2024
* More/better logging for InstantSend

* Implement CRecoveredSigsDb::TruncateRecoveredSig

* Truncate recovered sigs for ISLOCKs instead of completely removing them

This makes AlreadyHave() return true even when the recovered sig is deleted
locally. This avoids re-requesting and re-processing of old recovered sigs.

* Also truncate recovered sigs for freshly received ISLOCKs

* Fix comment
panleone pushed a commit to panleone/PIVX that referenced this pull request Nov 15, 2024
* More/better logging for InstantSend

* Implement CRecoveredSigsDb::TruncateRecoveredSig

* Truncate recovered sigs for ISLOCKs instead of completely removing them

This makes AlreadyHave() return true even when the recovered sig is deleted
locally. This avoids re-requesting and re-processing of old recovered sigs.

* Also truncate recovered sigs for freshly received ISLOCKs

* Fix comment
Fuzzbawls added a commit to PIVX-Project/PIVX that referenced this pull request Jan 11, 2025
a85b450 Merge pull request dashpay#3399 from codablock/pr_speedups2 (Alexander Block)
136f900 cherry-pick dashpay#2833 (Alexander Block)
d942439 Merge pull request dashpay#3389 from codablock/pr_concentrated_recovery (Alexander Block)
36790d2 cherry pick dashpay#3368 (Author Alexander Block)
dac01a9 cherry-pick dashpay#2780 (Alexander Block)
39d0ed9 cherry-pick dashpay#3367 (Alexander Block)
5084bbf Allow re-signing of IS locks when performing retroactive signing (dashpay#3219) (Alexander Block)
802c006 Only track last seen time instead of first and last seen time (dashpay#3165) (Alexander Block)
479b64b Avoid propagating InstantSend related old recovered sigs (dashpay#3145) (Alexander Block)
27fa2af cherry-pick dashpay#3117 (Pasta)
cf138e0 cherry-pick dashpay#3097 (Pasta)
23b140e Introduce getbestchainlock rpc and fix llmq-is-cl-conflicts.py (dashpay#3094) (UdjinM6)

Pull request description:

  as usual each commit backports a different PR

ACKs for top commit: a85b450
  Duddino:
    utACK a85b450
  Liquid369:
    uTACK a85b450
  Fuzzbawls:
    ACK a85b450

Tree-SHA512: e9024d180888d8a6cc300ba9df74fc15929e3ade1773e5d312bd8cc93f6c9fd3898c5bf2d14672abf4faba576575c33936708e6e1dfd01a393479d264d3f2c57
Liquid369 pushed a commit to Liquid369/PIVX that referenced this pull request Jan 14, 2025
* More/better logging for InstantSend

* Implement CRecoveredSigsDb::TruncateRecoveredSig

* Truncate recovered sigs for ISLOCKs instead of completely removing them

This makes AlreadyHave() return true even when the recovered sig is deleted
locally. This avoids re-requesting and re-processing of old recovered sigs.

* Also truncate recovered sigs for freshly received ISLOCKs

* Fix comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants