-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Autoconfirm XMR trade if tx check was validated by proof service #4421
Conversation
Main part missing is the XMR proof service request processing. I did not get the service compiled yet, so could not test response data and error conditions. Further it is missing a "news badge" and popup to guide the user to the new feature. Only basic dev tested so far. Anyone welcome to pick the project up from here as I might not have time soon to continue.
@jmacxx
It is a requirement for XMR that they use a wallet capable of providing the tx key for the BTC buyer to be able to proof the XMR transfer. In a dispute the mediator would not be able to verify if the XMR transfer was done otherwise. So we just make it more safe in the way that if user ignore the info in the popup and use a not capable wallet they would risk to lose the dispute case. Now they cannot complete the trade, or at least they get aware of the problem very early. |
@boring-cyborg Wrong labelling! |
@jmacxx Thanks for the work on the feature! Looks pretty good already. Some comments:
|
assets/src/main/java/bisq/asset/CryptoNoteAddressValidator.java
Outdated
Show resolved
Hide resolved
...op/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java
Outdated
Show resolved
Hide resolved
desktop/src/main/java/bisq/desktop/main/settings/preferences/PreferencesView.java
Outdated
Show resolved
Hide resolved
desktop/src/main/java/bisq/desktop/main/settings/preferences/PreferencesView.java
Outdated
Show resolved
Hide resolved
The boring bot unfortunately will always tag it as |
Sure, I can write draft points to cover in the next day or two for feedback to make sure material is covered completely and correctly. |
Changed proto definition to allow a list of AutoConfirmSettings.
Moved the new code out to AutoConfirmManager.java
Is this referring to the Transaction ID and key input fields? I should not restrict them to hex input?
It shows the number/expected confirmations.
I intentionally oriented the badge slightly above and to the right of the title to make it appear similar to other badges shown on menu items. I think it looks great that way, but could certainly move it down a bit if that is what you want.
Done. Commit 9914600
It allows empty entry; I've also added the warning in that case. Will post a screenshot so @m52go can review.
Done.
Done.
Duly noted; I have attempted to correct all those instances of mis-capitalization. |
New settings feature text Warning when XMR trans keys not provided |
@jmacxx Thanks for your fast response and implementations! I will try to find time for updated review tomorrow. |
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.
We need at least 2 providers for DEFAULT_XMR_PROOF_PROVIDERS. Can you push wiz and emzy that they have the updated versions running? One need to run with clearnet.
Clearnet handling of provider for non-tor dev setup is missing.
In Trade:
Do not set xmrProofResult in constructor as it is only used in special circumstances. Keeping it null is more clear. (-> remove xmrProofResult = new XmrProofResult(0, 0, XmrProofResult.State.FEATURE_DISABLED);)
Makr xmrProofResult transient and @nullable
setXmrProofResult can be package scope.
// xmrProofResult is not persisted yet
@Getter
@Nullable
private transient XmrProofResult xmrProofResult;
void setXmrProofResult(XmrProofResult xmrProofResult) {
this.xmrProofResult = xmrProofResult;
xmrProofResultProperty.setValue(xmrProofResult);
}
We should consider to persist XmrProofResult in trade. for trade history it might be important to have some "proof" if autoconfirm was used or not, as well in dispute cases.
if we use propbug for XmrProofResult the enum should not be used as enum in protobuf as protobuf enums are cumbersome (have global scope). use the name instead. see other enum serialisations...(ProtoUtil.enumFromProto)
Still capitalized:
setting.preferences.autoConfirmXMR=XMR Auto Confirm
setting.preferences.autoConfirmEnabled=Enabled
setting.preferences.autoConfirmRequiredConfirmations=Required Confirmations
setting.preferences.autoConfirmMaxTradeSize=Max Trade Size (BTC)
setting.preferences.autoConfirmServiceAddresses=Service Addresses
setting.info.headline=New XMR Auto confirm feature
filterWindow.disableAutoConf=Disable Auto-confirmation (altcoins)
setXMRTxKeyWindow.txHash=Transaction id -> setXMRTxKeyWindow.txHash=Transaction ID
setXMRTxKeyWindow.txKey=Tx key -> setXMRTxKeyWindow.txKey=Transaction key
The second popup at xmr key input is removing the shaded background. You need to start that second popup with a short delay (UserThread.runAfter with 50 ms or so).
Auto confirm settings should be better visible. Either move it on top or reduce number of entries in currency list.
handleProofResult:
This handling need more thought/work:
if (!walletsSetup.hasSufficientPeersForBroadcast()) {
return failure;
}
if (!walletsSetup.isDownloadComplete()) {
return failure;
}
assets/src/main/java/bisq/asset/CryptoNoteAddressValidator.java
Outdated
Show resolved
Hide resolved
@m52go Can we add a short description and install help to the wiki? @Emzy @wiz Can you run the updated verison of the services (with tx date delivered)? one service need to provide clearnet as well (i think emzy has that already) - for dev testing in non-tor setup. I think it should be handled as bonded role. We could reuse DATA_RELAY_NODE_OPERATOR as role for that. |
I just build from master. |
Hi @chimp1984 thank you for taking time to review again.
Clearnet in dev mode is by default - no special handling needed. The SOCKS5 proxy provider is null in dev mode so HttpClient uses clearnet. To attest to that I've been using emzy's clearnet service for the past few weeks. The relevant line in HttpClient: bisq/p2p/src/main/java/bisq/network/http/HttpClient.java Lines 97 to 100 in f45a26c
If I have misunderstood please correct me. I am working on all other points you brought up. Then I'll merge in latest from master as requested (after squashing my commits). Cheers. |
* XMR seller is prompted to enter txId and viewkey. * looks up the XMR transaction to verify that it has confirmed * user can run their own validating service, or use the ones provided * 100% agreement of all chosen services is necessary for confirmation * feature can be configured and turned on/off from settings screen * feature can be globally turned off via admin filter * two code review passes from chimp1984 * one text review from m52go
- Move xmrProofInfo.checkApiResponse to XmrProofParser.parse
- Rename getKey to getUID - Rename key to uid
Change test package from bisq.core.trade.asset.xmr to bisq.core.trade.autoconf.xmr
-Reduce visibility
Remove @Inject from XmrTxProofHttpClient as we pass the Socks5ProxyProvider anyway
Sorry for the messy commit... its late ;-)
@jmacxx Made a PR to your branch.... https://github.com/jmacxx/bisq/pull/1 |
Thanks @chimp1984, I'm AFK for the next few hours, will look at this when I return. |
Autoconfirm XMR trade if tx check was validated by proof service (v3)
@chimp1984 I attempted to merge your pull request on top of my branch but got stuck in too many merge conflicts. It seems we have been refactoring the code at the same time. I think the best option would be to close this PR and you open a new one with your current snapshot of the code. |
I've merged your latest @chimp1984 . Will test it out. |
Thanks @jmacxx ! I will continue soon as well testing. best to use 2 services for testing and add some artificial delay at the repsonses so u can see how ui behaves... i used same service twice with some small hacks to not ignore it as it has same uid.. I pinged @wiz how his progress is with getting a node. To have 2 nodes is a mandatory requirement for release IMO. |
@jmacxx I tried to do a pR to your branch but it did not work. So I did a new PR to Bisq. #4458 |
Closing as replaced by #4458 |
This is a follow-up PR to #4378 by @chimp1984
Implements bisq-network/proposals#86
Features:
On the XMR buyer side,
Implementation notes
Auto confirmation entails API requests to multiple autoconf service providers. If the responses all show that the required number of confirmations have been reached the trade will be auto confirmed.
The user still has the option to confirm manually just as if auto confirm were not enabled.
Any service failure will abort the attempt at auto confirming.
In any of these cases the status is shown on screen. It also shows the progress of the confirmation count.
The general approach to implementing this feature was to keep it as simple as possible.
Auto confirmation is a one-shot process triggered by receipt of
counterCurrencyExtraData
in theCounterCurrencyTransferStartedMessage
from the counterparty.If Bisq is closed while auto confirmation was pending, when it re-starts the trade will show auto conf status disabled.
Auto-confirmed status of a trade is not persisted.Auto-confirmed status is persisted since for trade history it might be important to have some "proof" if it was used or not, as well in dispute cases. [requested by @chimp1984].Testing
In regtest use a clearnet service address, e.g.
78.47.61.90:8081
(from @Emzy)In mainnet over tor this would be
monero3bec7m26vx6si6qo7q7imlaoz45ot5m2b5z2ppgoooo6jx2rqd.onion
which is included as a default setting.To try out this feature without making a live XMR trade, the following example TX proofs may be used.
Automated testing routines were created to verify the API JSON response handling.
Checking iteroperability between new and old clients.
Test cases
Discussion