Skip to content

Conversation

@codablock
Copy link

This PR removes all legacy InstantSend code, including UI and RPC stuff.
See individual commits for details.

@codablock codablock added this to the 14.1 milestone Jul 7, 2019
@UdjinM6 UdjinM6 added P2P Some notable changes on p2p level RPC Some notable changes to RPC params/behaviour/descriptions labels Jul 7, 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.

Looks good 👍

pls see few suggestions below

UdjinM6
UdjinM6 previously approved these changes Jul 8, 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.

Looks good 👍

slightly tested (client-side only) ACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a 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?

@codablock
Copy link
Author

@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...

@codablock
Copy link
Author

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.

@UdjinM6
Copy link

UdjinM6 commented Jul 8, 2019

Should also fix tests now

@codablock
Copy link
Author

Not sure I understand...you assume that tests will fail?

@UdjinM6
Copy link

UdjinM6 commented Jul 8, 2019

Oh, you only reverted changes related to spork20 existence, not the logic behind it, I see.

@codablock
Copy link
Author

Exactly, this is really just to ensure that the spork is propagated to clients/nodes that still need it.

UdjinM6
UdjinM6 previously approved these changes Jul 8, 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.

ok, utACK :)

@UdjinM6
Copy link

UdjinM6 commented Jul 8, 2019

needs rebase

Copy link
Member

Choose a reason for hiding this comment

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

if( -> if (

Copy link
Author

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.

Copy link
Author

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

Copy link
Member

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)

Copy link
Author

Choose a reason for hiding this comment

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

Yepp, out of scope

@codablock
Copy link
Author

Rebased and force-pushed.

@codablock codablock force-pushed the pr_remove_legacy_instantsend branch from b18ff68 to 38d1aea Compare July 8, 2019 17:38
@codablock
Copy link
Author

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 38d1aeabcc3133c00971f2ee0a95a2b4e6e52da2

This 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
PastaPastaPasta previously approved these changes Jul 8, 2019
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a 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

@UdjinM6
Copy link

UdjinM6 commented Jul 9, 2019

Needs rebase again.

codablock added 3 commits July 9, 2019 09:00
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.
@codablock codablock force-pushed the pr_remove_legacy_instantsend branch from 56e52a9 to 8a2e8e7 Compare July 9, 2019 07:07
@codablock
Copy link
Author

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.

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.

re-utACK

Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

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

re-utACK

@UdjinM6 UdjinM6 merged commit 2f21e55 into dashpay:develop Jul 9, 2019
PastaPastaPasta added a commit that referenced this pull request May 26, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2P Some notable changes on p2p level RPC Some notable changes to RPC params/behaviour/descriptions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants