-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove legacy InstantSend code #3020
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
Remove legacy InstantSend code #3020
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.
Looks good 👍
pls see few suggestions below
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.
Looks good 👍
slightly tested (client-side only) ACK
PastaPastaPasta
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.
Shouldn't spork 2 and 3 be removed entirely?
|
@PastaPastaPasta Nope, spork 5, 6 and 20 are removed instead. Spork 20 was only meant to switch to the new system, but spork 2 is still meant to signal if InstantSend is enabled or not. But...I just realized that we have to clarify with the mobile team if they actually handle sporks this way... |
7a8d80f to
78e7df7
Compare
|
Just clarified with the mobile team that spork20 can't be easily removed as they internally still depend on it. We can remove spork20 in a few months however. I've reverted removal of spork20 and squashed that into the original commit. |
|
Should also fix tests now |
|
Not sure I understand...you assume that tests will fail? |
|
Oh, you only reverted changes related to spork20 existence, not the logic behind it, I see. |
|
Exactly, this is really just to ensure that the spork is propagated to clients/nodes that still need it. |
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.
ok, utACK :)
|
needs rebase |
src/qt/walletmodel.cpp
Outdated
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.
if( -> if (
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.
Out of scope of this PR...wallet.cpp is generally loaded with style infringements, but fixing them would lead to many merge conflicts in backports.
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.
Ah sorry, this is walletmodel.cpp and not wallet.cpp
src/wallet/rpcwallet.cpp
Outdated
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 believe these should use emplace_back instead of push_back (out of scope for this PR)
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.
Yepp, out of scope
78e7df7 to
b18ff68
Compare
|
Rebased and force-pushed. |
b18ff68 to
38d1aea
Compare
|
FYI, this should help re-reviewing after the force-push: $ function gfd() {
local fp1=$(git merge-base --fork-point develop $1)
local fp2=$(git merge-base --fork-point develop $2)
echo fp1=$fp1
echo fp2=$fp2
diff --color=always -u -I'^[^-+]' <(git diff $fp1..$1) <(git diff $fp2..$2)
}
$ gfd b18ff68fc6c9289a8e08db29cad9228904c3e350 38d1aeabcc3133c00971f2ee0a95a2b4e6e52da2This will show a diff of the diffs and thus filters out all the noise that you usually have when looking at a diff like in the "force-pushed" links created by Github. It however requires you to have the old commit locally, e.g. because you pulled the PR or my branch locally. |
PastaPastaPasta
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.
utACK, all commits looks good. I want to build locally and test this tonight before we merge
|
Needs rebase again. |
This removes the need to carefully maintain ppszTypeName, which required correct order and also did not allow to permanently remove old message types. To get the command name for an INV type, GetCommandInternal uses a switch which needs to be maintained from now on. The way this is implemented also resembles the way it is implemented in Bitcoin today, but it's not identical. The original PR that introduced the switch case in Bitcoin was part of the Segwit changes and thus never got backported. I decided to implement it in a slightly different way that avoids throwing exceptions when an unknown INV type is encountered. IsKnownType will now also leverage GetCommandInternal() to figure out if the INV type is known locally. This has the side effect of old/legacy message types to return false from now on. We will depend on this side effect in later commits when we remove legacy InstantSend code.
When we receive an IX message, we simply treat it as a regular TX and relay it as such. We'll however still request IX messages when they are announced to us. We can't simply revert to requesting TX messages in this case as it might result in the other peer not answering due to the TX not being in mapRelay yet. We should at some point in the future completely drop handling of IX messages instead.
This should have no influence on mainnet as these sporks are actually set there. This will however affect regtest, which shouldn't have LLMQ based InstantSend enabled by default.
These were only testing legacy InstantSend
This was for fUseInstantSend which is not present anymore since rebase
56e52a9 to
8a2e8e7
Compare
|
Rebased and force-pushed. Also re-added SPORK_16_INSTANTSEND_AUTOLOCKS as it is checked by a few mobile clients to decide on necessary fees. |
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.
re-utACK
PastaPastaPasta
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.
re-utACK
ad4b164 chore: drop deprecated RPC `instantsendtoaddress` (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * `instantsendtoaddress` was deprecated in [dash#3020](#3020), which was included in Dash Core v0.15. ## Breaking Changes Deprecated RPC will no longer be available. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK ad4b164 Tree-SHA512: 62f63d7eacdcddb31987eea0e55b033d9d89c0861ec096d442226f6ae530b2850be465ebfc24501763cb3c30444b36fbc3f02d1f355b2b58a174bdb833f6c6cd
This PR removes all legacy InstantSend code, including UI and RPC stuff.
See individual commits for details.