-
Notifications
You must be signed in to change notification settings - Fork 179
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
RPC API: Add optional txfee property for single joins #1612
RPC API: Add optional txfee property for single joins #1612
Conversation
@theborakompanioni Please test. |
I will be able to test this and report back tomorrow. Thanks @kristapsk 🙏 |
@kristapsk Generally works great and as expected. Except, when an invalid value (e.g. ℹ️ Also happens when the value (+ random factor) results in a fee greater than e.g. {"mixdepth":0,"amount_sats":0,"destination":"bcrt1q...","txfee":-1} Returns:
(Jam parses html responses of the API and just displayes "Processing Failed") A subsequent request to {"section":"POLICY","field":"tx_fees"} will yield {"configvalue": "-1"} |
This happens only with direct send or also with coinjoin? |
On {"mixdepth":0,"amount_sats":0,"destination":"bcrt1q...","counterparties": 8,"txfee":-1} I get no error but the "invalid" value is persisted. In the logs I see:
without the transaction moving forward. |
Currently |
Sanity checks on input should be added here, but that's only part of the problem. Direct send catches |
Will try to look at it in the next day or so. |
Just as a hint: Jam will not let the user input invalid values for So @AdamISZ, please do not just prioritize this based on my comments. 🙏 |
6cebc43
to
dcf347a
Compare
Added |
The problem is that there could be a lot of random issues not related to |
@theborakompanioni In any case, my worries above aren't directly related to this PR, that's broader issue. Could you test again this against your original issue (-1 txfee, absurd fee is not checked)? |
dcf347a
to
e1b6fcb
Compare
Added also handling any exception for |
OK looking at it today, I see your question. I think it's just a matter of putting it in Indeed, if we can't rely on that code being executed at the end of the single-coinjoin operation (whether it succeeds or fails), then we have other problems: there is a state-tracking variable that has to change from But if I understood what you wrote correctly, you're saying that |
OK, looking at your code patch again I see you have put it just after the call to |
It looks to me so. Otherwise in any case it should log "Coinjoin did not complete successfully." Or maybe I didn't understand correctly what @theborakompanioni wrote above:
And, yes, then it is broader problem. |
This was in response to negative fee values which you apparently already addressed. Please excuse my unresponsiveness regarding this, I hope I can carve out a some more time in the coming weeks. 🙏 |
And negative fee value caused exception and looks to me that this caused |
Latest tests on e.g. starting a taker operation providing a negative {"mixdepth":3,"amount_sats":0,"destination":"...","counterparties":8,"txfee":-1} lead to an expected {"message": "Invalid request format."} However, the {"session": true, "maker_running": false, "coinjoin_in_process": true, ...} A subsequent request to <html><head><title>Processing Failed</title></head><body><b>Processing Failed</b></body></html> There is no way to resolve this situation other than restarting the daemon. Every other test seemed to work fine! |
This output is not generated by JoinMarket code. Caused by invalid JSON? Any ideas how to debug that? |
Possibly an uncaught exception. Unfortunately, there is no output in the logs. Clients should prevent sending negative fee values in the first place, so this should not be a problem for actual users. However, just wanted to inform you about this behaviour. I hope I could give you the steps to reproduce the problem locally. |
The thing is that RPC backend code checks for negative fee values and this should not happen. https://github.com/JoinMarket-Org/joinmarket-clientserver/pull/1612/files#diff-669a0b743055398b7266dcc7762ac5e2b3e4af1601237d22c689655cfc91de0eR1322 |
e1b6fcb
to
421ca4b
Compare
Rebased to run OpenAPI Diff CI action. |
It looks OpenAPI DIff doesn't like that there is
|
Hmm... 🤔 Maybe I have not used the latest changes by mistake.. I will try again asap.
Yes, it'd be good to have a grace period for some time, e.g. next version could deprecated |
I think it stems from the fact that |
Oh, makes sense! Will move txfee validation to before that. But also need to think how to solve OpenAPI Diff CI failure the best way. |
421ca4b
to
5d337c2
Compare
What about keeping it a string for now (for consistency) and adapting it in an API "v2" in a future major release (v0.10.0)? |
9681c06
to
1061a76
Compare
1061a76
to
ab1481d
Compare
Ok, it seems I fixed it. What it didn't like is that any type is specified for the new optional property. Should work for us, casts to int or string are made at backend code where necessary. |
All tests pass now. @theborakompanioni If you could re-test with ab1481d, I'm ready to merge this. |
tACK! Loved to see it merged 🧡 Just for the sake of completeness: If you pass a non-number string, it will answer with a 500 html response, instead of json. But this is a general inconsistency throughout the API, and definitely nothing that should be addressed here. Jam can (somewhat) handle this, by parsing the error message from the html response. |
Resolves #1607.