-
Notifications
You must be signed in to change notification settings - Fork 178
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
Yield generator can be launched in Qt #487
base: master
Are you sure you want to change the base?
Conversation
The basic concept: While running, other features are put into a disabled state: wallet load, generate and recover; the coinjoins tab and the settings tab. Under the hood/technical: added a In theory, I'm betting that it'll be very possible to actually allow Taker function while Maker is running, but don't want to think it through, seems wisest to disable it for now. TODO: I think it mostly needs (a) a bunch of testing and (b) some more polish in the UI, for example the |
jmdaemon/jmdaemon/daemon_protocol.py
Outdated
@@ -212,6 +212,12 @@ def on_JM_MSGSIGNATURE_VERIFY(self, verif_result, nick, fullmsg, hostid): | |||
self.mcc.on_verified_privmsg(nick, fullmsg, hostid) | |||
return {'accepted': True} | |||
|
|||
@JMShutdown.responder | |||
def on_JM_SHUTDOWN(self): | |||
print("reached on shutdown in jmdaemonserverprotocol") |
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.
Use the logger functions instead of print?
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.
Yeah debug leftover, mistake, sorry.
I removed "script" from the title of the PR. That's dumb, it's not launching a separate process or something. |
A brief note on the TxHistory change in the last commit (rebased on master for the datadir option for testing): I thought a bit about parsing transactions as they come in to see if they're coinjoins we participated, or deposits, or something strange. That's a bunch of extra code - especially if you were to do it right, i.e. fully. So I set that aside, in line with #420 and a few comments in other places, I believe we should integrate and refactor the process of dealing with transaction history. So we currently have a So the approach taken here is not to address either the UI concerns of the tab, nor the full correct transaction type accounting, but just to ensure that while running in maker mode we make an entry for each coinjoin that happens - note it doesn't bother to find the equal-size cjout, but just records the first utxo in the tx with its corresponding amount and txid, so the user can either look it up on the blockchain or look at yigen-statement.csv for more information. Deposits are also correctly recorded while the maker is running (although again - an exotic deposit with multiple utxos to this wallet will only show one, at random), as well as of course showing the updated information in the Wallet tab and the Coins tab. Done some testing on both regtest and mainnet, seems to be quite functional. Next job will be to change the information shown in the Maker tab while it's running to something more sensible than the starting parameters and a "Stop" button. Then I'll take off the "WIP" marker and propose it for merge. |
When you squish the commits make sure you add enough linebreak between the subject line and body. Right now git log --oneline is messed up:
|
Understood, will do. |
WIP status removed; I believe, after some more testing, this is mergeable. I recognize that the UI choices are arguable; I personally find it elegant and easy to use; it's effectively just a button that's always available from anywhere in the UI, to switch this feature on/off. |
Agree on this. Another one could be a Tor indicator, where we can have three possible states - all IRC servers via Tor / some IRC servers via Tor / not using Tor at all. |
I think having the yield-gen entry point as a button in the status bar is bad UI, because:
If you want to merge it anyway I won't oppose, but at least it's known that I was against this. Regardless, I'll test a bit more shortly. |
Very much so, at least, a big part of it.
I think it's orthogonal. So while 693 still exists, all we're really looking at here is a shift to a slightly broader population of people having access to the same function. A sybil attacker will use the command line anyway, it's far more convenient for that kind of user. To get back to the first point - the reason I think making the maker function easier to use is helpful is that heterogeneous usage of Joinmarket greatly improves its obfuscation effect. I don't see how this point is at all debatable; in the absolute spherical cow case of a single Taker user and N makers with neither side ever budging from this role in any way, the obfuscation effect is more or less a crapshoot, there will be scenarios that completely re-link the starting and ending point amounts. The non-spherical cow is multiple takers, especially concurrent, and various other flies in the ointment for spies such as equal sized inputs. But imo the inability to unambiguously link the Maker or Taker role from transaction to transaction within the set is what turns Joinmarket from "kinda useful" to "pretty strong actually", which is why I think measures like this - not that this in itself is so amazing - really matter. Meanwhile I understand that incentives are skewed to being maker, generally - as long as most people don't have urgent need to move their coins around. But here I don't think there's any logic in not giving people more optionality. The only case in which I agree with the logic of "don't let users do X" is where X has danger - obvious example, restrict printing of private keys (and yet we still have to allow even that!). This function has no danger at all, so even in cases where it's not effective (say, a user running without fidelity bonds when they are enabled and in wide use - and as per above, we are a long way from that ...), it still isn't an argument against having it. |
I disagree. Maker is a passive mode of operation, single and multiple join are active. But I don't disagree in a really profound way, I think this is simply arguable.
Both Tor and blockchain connection belong on the status bar, agreed there - PRs welcome etc etc :) That's not a reason not to have this as an easy to press button from anywhere on the status bar. Having it as a toggle on/off makes sense; you can still deposit, freeze coins (and should be able to do at least non-coinjoin sends, but we'll have to check before enabling that). |
@AdamISZ Do you plan to resume working on this at some point? |
@kristapsk i mean yes and no. First, I think it's a good thing to have this function in Qt (consider: as far as I was told, @openoms was even given a grant to work on a GUI for Joinmarket, specifically because this GUI doesn't support yieldgenerator; I'm sure there's more to the story that that, but still). Second, it's not really that hard. But counter to that, I'm rather more interested in further developing #670 , combined with a javascript framework, because it would give several nicer outcomes: (1) out of the box binary cross platform distribution (2) allow client side code to be written independently of this codebase (3) a much more intuitive and reactive UI with more modern design that users are familiar with. I did reach out to try to get people interested in that, but not so much luck so far. A couple expressed interest but not more than that. That doesn't mean I don't want the existing GUI to continue to improve (hopefully the recent Windows one-click exe is helping some people, for example), just a question of, what should we work on. |
If you wanted to look into improving it @kristapsk , I could rebase this branch. |
A status bar widget allows access to configure, and start/stop a yield generator (maker) bot in the background. While running, taker functions are disabled as well as wallet changing functions. Other functionality is still available.
while in maker mode, and deposits (although there is no sophisticated tx type parsing). The location of the corresponding history file is fixed to the datadir correctly. Also fixed Maker start/stop for non-Tor case.
Also various small fixes to strings and info text, and validation of inputs and tooltips.
Rebased on master as of b57b70c Note: I have not started testing this yet, and there were one or two tricky manual edits in the rebase, so I would not be amazed if there are a couple of bugs lurking, though I doubt anything serious. As you said before, this was already operational back in January, it mostly needs some slightly better UI elements. Other than that it's probably quite viable. |
generateAction etc. must be instance vars so that they can be toggled inactive.
Have done a few tests and identified a couple of bugs, which are now fixed. Should be functional to use either Qt or command line yield generator now. |
Very good to have this especially if it does not need a huge change! Whether it will be used depends mainly on how people run their nodes. If someone has an always on (ideally dedicated) computer with a screen connected they can benefit from the ease of starting YG from the QT- GUI. For the ones whose bitcoin node (and/or separate JoinMarket node) is a headless device (like most prebuilt/compiled/facilitated node packages) something like JoininBox is still useful to be able to run YG in the background. |
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.
Couple nits.
self.makerDialog.close() | ||
|
||
|
||
def setMakerBtn(self): |
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.
self.makerDialog.close() | |
def setMakerBtn(self): | |
self.makerDialog.close() | |
def setMakerBtn(self): |
Extra blank line.
if self.maker_running: | ||
self.makerbtn.setIcon(read_QIcon("greencircle.png")) | ||
self.makerbtn.setToolTip("Maker running: click to manage") | ||
else: | ||
self.makerbtn.setIcon(read_QIcon("reddiamond.png")) | ||
self.makerbtn.setToolTip("Maker not running: click to manage.") |
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 is just pedantic, but one tooltip ends with '.' the other does not. Since they are "symmetrical" it would be nice to have them consistent.
Update:
I'm testing this out a little bit, is there a reason why the first tooltip at init is Click to start maker
but then changes to Maker not running: click to manage.
? Shouldn't the tooltips be the same?
Seems like conceptually there should be no difference in the tooltip between first time and after maker stops.
m2c are: Click to start maker
is better, Maker not running: click to manage
seems more a message for e.g., when a maker should be running but it is not, not for when maker has been directly stopped.
TODO consolidate the multiple tx history functions. | ||
""" | ||
|
||
if not self.maker_running: |
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.
TODO consolidate the multiple tx history functions. | |
""" | |
if not self.maker_running: | |
TODO consolidate the multiple tx history functions. | |
""" | |
if not self.maker_running: |
Extra blank line.
"Satoshis contribution (integer) to bitcoin transaction fee.", | ||
"Minimum size in satoshis of coinjoin allowed."] | ||
parameter_types = [str, int, float, int, int] | ||
parameter_settings = ['Relative fee', 500, 0.0002, 100, 1000000] |
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.
"Minimum CJ size (sats)" should be changed to 100000, which is default for cli since #570.
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.
But in context of #727, should be read from the config in future, not being hardcoded here.
"if relative offer type chosen.", | ||
"Satoshis contribution (integer) to bitcoin transaction fee.", | ||
"Minimum size in satoshis of coinjoin allowed."] | ||
parameter_types = [str, int, float, int, int] |
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.
All sats inputs should now use BitcoinAmountEdit
, change int
to amount
here and implement it below.
All taker single sends (but not tumbler) could be freely allowed in GUI while maker is running. As taker can source coins only from one mixdepth at a time, just need to communicate to maker to not use ("mix from") certain mixdepth in moments when user is in a single send dialog. And also make sure for taker to not use himself as a cj counterparty. |
Yes, for sure it's possible. But since it's meaningful extra work, I didn't want to include it here. |
I tested this out a bit and I've managed to do maker CoinJoins through the GUI with the regtest setup (using a custom ygrunner that creates an extra seed).
A couple of thoughts from using this:
|
Yeah those are some good thoughts. The icons were clearly not in a ready state, they were more placeholders than anything. About the log output that's in the greyed out coinjoin tab, I probably toyed with the idea of putting the yg log output in a similar box in the maker dialog, but put it to one side for now. |
About "mode of operation" - there should be third status when tumbler is running, so you have three icons - default mode, maker is active (running), tumbler is running. |
A status bar widget allows access to configure,
and start/stop a yield generator (maker) bot
in the background. While running, taker functions
are disabled as well as wallet changing functions.
Other functionality is still available.