-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix: precondition for collaborative transactions #485
Conversation
5fb70da
to
7eb7f4d
Compare
Not addressed currently is handling of "tries exceeded":
Setup
Fails with:
New scheduler algorithm will first try to sweep from Jar B, which fails because no retries are left:
|
Undrafting this now, as the "no tries left" issue can be tackled in a follow-up PR. What do you think about continuously checking the current schedule entry and check if the current "sending Jar" is checked to have enough retries left? |
I think showing a warning is fine for now, it's better than nothing. Let's try to tackle this properly at a later point. |
could not consistently reproduce that this requirement is really needed
ec5c3e5
to
83f369c
Compare
7f6659a
to
fef437e
Compare
…rs for improved testability
Updated the PR description to match new code adaptions. |
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 to me in general, I did my best to test this is thoroughly as I could.
I didn't find any bugs, but I noticed that the behavior of send/sweep is now inconsistent. (By "sweep" I mean the scheduler.)
We disable the send button for a “normal” send if preconditions are met, but we don’t disable the scheduler button if the preconditions aren't met.
I see two options:
-
Enable the regular send button as well & reword the warnings so that stuff makes sense, which it currently doesn’t (we say that “the scheduler requires” - but you can still start it, so it doesn’t really “require” it does it) - maybe even make the button red or orange, as we did when creating an FB with a
non-cjout
UTXO -
Disable the scheduler button if preconditions are not met
I'm leaning towards (1). This change can be addressed in another PR, of course.
<br /> | ||
<br /> | ||
<Trans i18nKey={`${i18nPrefix}hint_missing_retries_detail`} count={utxosViolatingRetriesLeft.length}> | ||
Following utxos have been used unsuccessfully too many times: |
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.
Following utxos have been used unsuccessfully too many times: | |
The following UTXOs have been used unsuccessfully too many times: |
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 to me, tACK ✅
I'd lean towards merging this as-is and do some final adjustments in a separate PR.
Okay. Thanks! |
Closes #438.
Adds
CoinjoinRequirements
as replacement forCoinjoinPreconditions
.Changes:
Regtest:
taker_utxo_retries
andmaker_timeout_sec
config vars for improved testabilitytaker_utxo_retries
is3
- reduce to1
to easily "simulate" a jar without retries leftmaker_timeout_sec
is30
- making it10
will increase chances of a maker timeout and additionally invokes the "Stall monitor" more oftenTests:
Additional tests after JoinMarket-Org/joinmarket-clientserver#1347 has been merged:
(slightly outdated screenshot - the info is displayed as warning (yellow) instead of an error (red))
How to test
Minimum value requirement
Not implemented - reasons stated below
Minimum confirmation requirement (>5 confs)
Try using the scheduler or send page with a jar having less then 5 confirmations.
No retries left
To just see the "retries left" error message add the following snipped temporarily to the
Jam.jsx
component.To really emulate and test having a utxo without retries left, you need to manually abort a taker operation after a commitment has been sourced. To do this you can send a collaborative transaction from one jar to another, while observing the logs (
npm run regtest:logs:jmwalletd
) and immediately lock the wallet once you see the log messageINFO:Commitment sourced OK
. You can test various scenarios, e.g. having only one utxo without retries left (tx will fail - message should appear) or having 1 utxo without retries left + 1 utxo with retries left (tx can succeed - message should NOT appear).The message should only appear if all utxos in a jar have no retries left.
Not addressed:
e.g. sending 30.1rBTC (3010000000 sats) with two utxos (30rBTC and 0.12345678rBTC) was successful
sweeping three utxos (~76rBTC, ~21rBTC and 0.02341166rBTC) was also successful
However, the following (with a sweep) did not succeed:
BUT, if the same jar is sourced with a new utxo and swept, it will succeed: