-
Notifications
You must be signed in to change notification settings - Fork 452
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
Losing tokens without downloading #4234
Comments
Yes, it is strange behavior. We are aware of the unexpected issue of running into negative credits. We very much want to fix this. We'll be making the feature: "only seed for credit income". Without receiving a credit report, you will not upload. Probably should be on by default. Duplicate of prior report: #4161 |
But I have downloaded nothing, my download list is completely empty, so I don't think anything can be seeding. |
Ehhhh, actually.. I have no idea. Anybody any theories? |
Bug filer probably didn't look at the credit mining tab. |
I have disabled credit mining and I did look at the credit mining tab, it was empty. |
@MeadowHillSoftware I do not mean for this issue to be about the credit mining. I am now trying to reproduce this on a clean installation where all downloading and credit mining is disabled from the beginning. |
More info and details are helpfull, thnx! Indeed the status of the credit mining tab is important. You can also upload/earn + download&invest from there. |
I have now removed my So I guess anybody could reproduce this issue by just installing a clean version of tribler or removing their settings folder and then just letting tribler run for a few hours. That will result in taking MBytes from the community without downloading anything. The full steps I took were:
After that my trust statistics look like this: Update, now my trust statistics look like this: So my total amount of tokens is positive, but the amount I "took" from the community still grows. |
I will try to debug this one. First, I'm trying to reproduce it myself by running Tribler idle for an extended period of time. If anyone wants to help me out, it would be helpful if one could send me a copy of their TrustChain database if the issue is reproduced (otherwise I will be debugging TrustChain records which balances should be correct). This database can be found in the Tribler state, under the @noughtmare the graph you linked shows an interesting thing. The first transaction correctly increases your balance with around 9MB. In the next transaction however, it seems that a transaction is initiated where you only take MBs. Do you still have this database around? |
@devos50 This is a zip of my trustchain.db file (I can't upload .db files to github directly, so I zipped it). I believe that still includes those first transactions. |
Thank you! I will inspect the file 👍 |
@noughtmare I need one more piece of information, namely your public identity that TrustChain uses. You can find that identifier if you enable the developer mode in the settings panel (under the 'debug' panel). Then you should open the debug pane in the left menu. If you then navigate to the 'Trustchain' pane, you will see a field named It should look something like this: https://gyazo.com/5ed5e2a2abfbe1422c8e6e3aed51c339 |
Thanks! I looked into this and it seems that there are occasionally transactions created which transfers tokens from you to some counterparty. The transaction contents of one of them looks like this:
It's a bit hard to read but there is nothing uploaded and around 13.5MB downloaded, which matches with the graph you linked on this issue. Why you would initiate such a transaction without any active downloads is still unknown to me. I have to check the code to see how this is possible. |
@noughtmare you mentioned that you did |
@devos50 Is it not just enough to turn of the option in the settings? I originally turned it on to see how much of a difference it would make to the amount of tokens that I would receive, especially since in the beginning I mostly lost tokens by staying connected to the network. |
Yes that should also be enough but removing the state dir also removes any data attached to Tribler so it's more like the nuclear option. |
I'm still not sure what's causing this. I will add an assert to the payout method and run some idle Tribler instances to reproduce this. The log output should give some more information then. |
Please do not run as an exit node. There are some very bad torrents out there, worse then copyright violations. |
Closely related, gaining tokens without uploading:
I sent 1.3 MB of payout to the next hop and got paid out 48 MB. EDIT: Maybe even more interesting, my total up/down of the IPv8 community (175 MB) is less than the >200 MB of bandwidth tokens I have earned this session: |
Today, I fixed two issues related to payouts (in #4248 and #4250). These changes should make the payout system more robust. That said, I still haven't figured out how (and especially why) balance is drained when only doing relaying activities. I have setup a server which has been running Tribler idle for a few hours. After these few hours, it has accumulated a balance of 659MB. I also print every single payout made. I've written a script that parses all payouts and reconstructs the final balances. This yields me roughly 968MB. So somewhere in the process, I have lost 309MB. I should do a deeper inspection of the database and backtrace every single payout made to further debug this issue. |
After some extensive debugging, I think I might have found the bug! 🎉 If there is a downloader D, a relay R and an exit node E, the following could happen. If D has to do a payout of 100MB, it will send a half block to R, say that this half block has sequence number 10 in the chain of D. Now, if R receives this half block, it will try to validate the half block by requesting blocks 5-9 in the chain of D (assuming that R does not have these blocks already). Simultaneously, R continues the payout process (without full validation of the chain of D) and pays 100MB to E by creating and sending a half block to the exit node. Now, if D does not respond properly with blocks 5-9 as requested by R, the balance of R will be -100MB. I have seen this behaviour in the logs of Tribler. So how can we fix this? I can think of two solutions:
Any suggestions or other solutions for this? |
Congrats! |
I'm still experiencing this on the |
That’s unexpected. There’s something else apparently. I will look at it tomorrow... |
After some thinking about this, I believe this is the way the mechanism should work. Let me first note that the graph might be slightly confusing since it implies that you take MBs from the communities. This is an implication of the way the payout mechanism works. We should improve the visualization a bit and discuss this. When paying out bandwidth tokens, the downloader (which is at one end of the circuit) pays tokens to the subsequent hops in the circuit. Intermediate hops take these tokens and transfer a part of this full token amount to the next hop. So first you receive some tokens and then transfer some of them to the next hop, which will happen at roughly the same time (which explain the occurrence of the two orangish dots right above each other). The most important thing here is that the MBs given should always be bigger than the MBs taken when there are no active downloads. You can find more technical details about the payouts in this document. I will do some more testing to see whether everything works as expected. |
I have no downloads but I am still losing tokens, how can that be?
I can reproduce this on version 7.2.2 and the 'next' branch from github.
The screenshot is made while I was using revision 407afd3
The text was updated successfully, but these errors were encountered: