-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove dummy confirmations in RPC API and GUI for InstantSend transactions #2040
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.
Very nice! 👍
See inline comments
+
There is no way to quickly distinguish between regular tx and IS in GUI now, you have to open tx details dialog to get some idea. Smth like 5164d34d17ff7078c90bebcf7814defa2c3bd6d6 + 4f1fd17e4d880246b79772b670ab134d3d2a7faa + 141c9b9d88e1bd30d379763dffb72d190037cbb4 should do it more or less ;)
PS. Pretty surprised that amount of changes is that small. I expected this transformation to be much more invasive originally tbh, glad that it's not the case :)
src/instantx.h
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.
This comment shouldn't be deleted
src/wallet/wallet.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.
Wouldn't IsTrusted() be enough here?
src/wallet/wallet.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.
same
src/wallet/wallet.h
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.
nit: change name to IsLockedByInstantSend or smth like that
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.
see inline comments
src/wallet/wallet.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.
Err... That's not what I meant, I meant that addition of !pcoin->IsLockedIX() was excessive because it's already a part of IsTrusted(), not that smth else should be removed..
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.
Actually... I double checked and I guess I was maybe wrong in my initial comment - we don't really check if tx is final or not when MN votes for some input so IsTrusted() == false && IsLockedIX() == true could be a thing probably. Pls revert this (and the one below) to your original version. Sorry 😇
EDIT: but we do check if lock request itself is final or not... 🙄 Anyway, more checks is probably better 😅
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.
Yes, I've missed it too, will revert it now
src/wallet/wallet.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.
same
src/wallet/wallet.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.
"Fixed" the wrong one here, should not touch this and fix GetUnconfirmedWatchOnlyBalance() instead
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.
slightly tested ACK
|
Not really sure if we can include this in 12.3 or should we postpone this till 12.4 instead. On one hand, this only touches local wallet code and GUI/rpc, no consensus or stability critical parts are affected. On the other hand, don't want any surprises in wallet code this close to the release either and there are still some TODOs regarding icons etc. I'm leaning towards 12.4 for now unless someone voice strongly for 12.3 and is willing to draw/add icons etc. |
|
utACK but would strongly prefer to put this into 12.4 or 12.3.x instead of 12.3. |
nmarley
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, but I would also prefer to wait to merge until 12.4 or a 12.3.x patch release that can be well tested
|
Can someone explain why this change is important/good. I see no problem with displaying the dummy confirmations. |
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.
Needs rebase
- bring back removed comment; - simplify 2 complex condition to ose `IsTrusted()` function only; - rename `IsLockedIX` function to 'IsLockedByInstantSend`;
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.
Tested again, looks good 👍
There is one small nit, see below. Plus we should probably update instantsend.md to match new logic/rpc param.
src/wallet/wallet.cpp
Outdated
| { | ||
| const CWalletTx* pcoin = &(*it).second; | ||
| if (pcoin->IsTrusted()) | ||
| if(pcoin->IsTrusted()) |
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.
nit: this line should have no changes (bring the whitespace back)
doc/instantsend.md
Outdated
| The key thing to understand is that this value indicates the number of "confirmations" a successful Transaction Lock represents. When Wallet RPC commands which support `minconf` and `addlockconf` parameters (such as `listreceivedbyaddress`) are performed and `addlockconf` is `true`, then `instantsenddepth` attribute is taken into account when returning information about the transaction. In this case the value in `confirmations` field you see through RPC is showing the number of `"Blockchain Confirmations" + "InstantSend Depth"` (assuming the funds were sent via InstantSend). | ||
|
|
||
| There is also a field named `instantlock` (that is present in commands such as `listsinceblock`). The value in this field indicates whether a given transaction is locked via InstantSend. | ||
| There is a field named `instantlock` (that is present in commands such as `listsinceblock`). The value in this field indicates whether a given transaction is locked via InstantSend. |
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 pretty good. But there is no underlying mechanism anymore and Examples sub-section doesn't really give any additional valuable info now, so we probably can write the whole RPC section like this:
Details pertaining to an observed "Transaction Lock" can also be retrieved through RPC. There is a boolean field named
instantlockwhich indicates whether a given transaction is locked via InstantSend. This field is present in the output of some wallet RPC commands e.g.listsinceblock,gettransactionetc. as well as in the output of some mempool RPC commands e.g.getmempoolentryand a couple of others likegetrawmempool(forverbose=trueonly).
Thoughts? @codablock @nmarley
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 agree, this paragraph seems more accurate (removes "underlying mechanism") and descriptive (adds info on boolean field and which RPC commands have 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.
ACK
- Update 8 RPCs based on dashpay/dash#2040
- Update 8 RPCs based on dashpay/dash#2040
Remove instantsenddepth option and dummy confirmations for IX transactions.