Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Conversation

@AdamISZ
Copy link
Member

@AdamISZ AdamISZ commented Oct 24, 2016

…h less than the initially requested number of makers; sweep function is unchanged

It occurred to me that this is a much simpler, faster, and possibly more robust way of dealing with unresponsive makers who don't even provide utxos or signature up to !ioauth.

This is not really intended to supercede the idea of more intelligent selection, something like outlined here but is a more basic idea that is simpler.

If the number of full respondants in the !fill - !ioauth phase is less than that specified (by -N or similar), but is at least equal to jm_single().config.getint("POLICY", "minimum_makers"), then continue anyway - the change will be calculated correctly, higher than originally anticipated, and the txfee will be less than originally anticipated but it is already re-calculated at this point.

The timeout code in recover_from_nonrespondants thus checks the above arithmetic, if sufficient, it calls recv_txio with dummy values, which flags the code to skip the first step and pass straight into calculation of our change output and construction of !tx messages (nothing for the makers changes; their outputs are already set by their own fees).

Nothing changes for sweep; there was previously no way to handle any change in the input set of orders, and there still isn't (at least I haven't thought of one yet).

I've done various tests with randomly malicious makers (using test/ygrunner.py and inserted random failure-to-ioauth into maker.py) and it seems to work as intended.

User can flag not to use this feature by setting POLICY.minimum_makers to 0.

Review greatly welcomed. This needs careful testing, even if it is a fairly simple change (at least in comparison to other ways of dealing with the problem!)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 82.757% when pulling ec5720a on AdamISZ:completewithsubset into ab91528 on JoinMarket-Org:develop.

@AdamISZ
Copy link
Member Author

AdamISZ commented Oct 24, 2016

Tried on main net, chose 2 known malicious out of 6 using -P, got a 4 party tx completed.

# to complete, accounting for the fact that some makers might not be
# responsive. Should be an integer >=2 for privacy, or set to 0 if you
# want to disallow any reduction from your chosen number of makers.
minimum_makers = 2
Copy link
Contributor

Choose a reason for hiding this comment

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

we could just default this to 0 so the new behavior is opt-in

Copy link
Member Author

Choose a reason for hiding this comment

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

We could. But cognitive load; as of right now the experience of many new users is "try, then fail" because they very often get even 1 malicious/nonresponsive maker. I think if you canvassed the users they would be strongly expressive of a principal desire not to have their transactions stuck, privileged over having larger anonymity sets, although obviously they prefer both.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also believe this should be opt-out. "First user" experience is important, also default-settings should just work. Which they currently dont, due to these unresponsive bots.

Copy link
Contributor

@AlexCato AlexCato Oct 24, 2016

Choose a reason for hiding this comment

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

Recommendation for user UI though: at the point where they confirm that they will pay 0.xx % of cjfees in total, there should be a note if minimum_makers > 0. Something like:
If some makers do not respond, we will still create a coinjoin with at least (minimum_makers) makers. If you do not desire this behavior, you can set "minimum_makers = 0" in joinmarket.cfg.

Copy link
Member Author

Choose a reason for hiding this comment

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

@AlexCato I agree. Will push and squash that edit shortly.

@AdamISZ
Copy link
Member Author

AdamISZ commented Oct 25, 2016

Additional notes as of 4fe8e25 (will squash before merge, don't want to bork comments for now)

This commit does 3 things:

  1. Trivial, remove CoinJoinTx.actual_respondants which was a holdover from working on another branch, it is completely redundant with the existing active_orders.keys() here.
  2. I had removed the existing smart order-reselection on initial failure for the case minimum_makers=0 which was unnecessary; that code is reinstated in the block elif minmakers == 0 in recover_from_nonrespondants(). Thus, the code leaves functionality unchanged if people disable this option.
  3. Added an informative message as per @AlexCato 's suggestion, in sendpayment.py so that if choose-from-subset is enabled, the user is warned that the maker count can go down.

I did a bunch of tests of cases: (1) minmakers 0, no malicious bots, (2) minmakers 0, randomly malicious bots, (3) minmakers 2, no malicious bots, (4) minmakers 2, malicious bots and (5) sweeps with malicious bots (minmaker setting not relevant).

The tests seem to behave as expected. I'll run a couple more tumbler tests today, this time including malicious behaviour in bots to see if it handles it OK.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 82.347% when pulling 4fe8e25 on AdamISZ:completewithsubset into ab91528 on JoinMarket-Org:develop.

@AdamISZ
Copy link
Member Author

AdamISZ commented Oct 25, 2016

Tumbler tests with inserted maker maliciousness seem to be working fine. I'd anticipate merging this in the next few days - and making a new release - unless anyone objects; additional tests by others hugely appreciated.

self.msgchan.fill_orders(new_orders, self.cj_amount,
self.kp.hex_pk(), self.commitment)
else:
log.info("Two few makers responded to complete, trying again.")
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Two/Too/

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! damn, i caught that one and then forgot it again :)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 82.552% when pulling b5018e8 on AdamISZ:completewithsubset into ab91528 on JoinMarket-Org:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) to 82.293% when pulling f666ad2 on AdamISZ:completewithsubset into ab91528 on JoinMarket-Org:develop.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 82.583% when pulling c18f3af on AdamISZ:completewithsubset into ab91528 on JoinMarket-Org:develop.

…h less than the initially requested number of makers; sweep function is unchanged

Insert message to console advising user if minmakers!=0
disallow sendpayment -N choice < minimum_makers, fail before sync
@AdamISZ AdamISZ force-pushed the completewithsubset branch from c18f3af to c89347a Compare October 26, 2016 13:20
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 82.293% when pulling c89347a on AdamISZ:completewithsubset into ebf28ed on JoinMarket-Org:develop.

@AdamISZ AdamISZ merged commit c89347a into JoinMarket-Org:develop Oct 27, 2016
AdamISZ added a commit that referenced this pull request Oct 27, 2016
…sactions wit…

c89347a initial draft allowing takers to optionally complete transactions with less than the initially requested number of makers; sweep function is unchanged Insert message to console advising user if minmakers!=0 disallow sendpayment -N choice < minimum_makers, fail before sync (Adam Gibson)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants