mysteriumnetwork / node

Mysterium Network Node - official implementation of distributed VPN network (dVPN) protocol
https://mysterium.network
GNU General Public License v3.0
1.11k stars 314 forks source link

Node reported earnings do not match time + GB or mystnodes.com earnings #4476

Closed stutteringp0et closed 2 years ago

stutteringp0et commented 2 years ago

Describe the bug 0x1e9802c41c6319a482dbb53431a24c773795bcb5

Looking at the node ending with bcb5, if I calculate the time and GB (07:51:35, and 11.16 respectively) by the price for that node (0.0003002 and 0.0629088) respectively - I should see 0.70442169661111 myst earnings - which is pretty far from the mystnodes.com tally of 0.395577 myst for that node and really really far from what the node displays for earnings. The node itself shows much less accrued myst than that.

image

None of these numbers add up....and I've only looked at 1 of 16 nodes. I looked at this particular node because the balance continues to show 0 unsettled earnings, while there should be around 0.1507712 according to the data in the sessions list. Looking more closely, none of the numbers match up.

To Reproduce Steps to reproduce the behavior:

  1. run a node
  2. do the math
  3. scratch your head

Expected behavior numbers add up

Screenshots The one session so far from today, is not showing up in the unsettled earnings.

image

Environment (please complete the following information):

Additional context I'm trying to write scripts to track, notify, and trigger automation on earnings milestones, but nothing adds up.

stutteringp0et commented 2 years ago

These are some pretty significant discrepancies.

image

Running a backup on the data directories now.

adinetech commented 2 years ago

image This can be the reason.

stutteringp0et commented 2 years ago

@adinetech I'm missing a lot more than 20%. And I'm not talking about settled earnings at all. I'm seeing sessions with reported earnings that are never being tallied.

stutteringp0et commented 2 years ago

@adinetech I'll elaborate in more detail for one single node. This is the node I'm running in Sydney Australia:

image

As you can see, mystnodes.com reports 0.427620 MYST. When I open that node's UI, however, I see something completely different.....not 20% different over 70% different. The reported/settled/total earnings are almost secondary to my primary concern.

image

This particular node has been busy. And the fees for using it are 0.0002587/0.0542059 MYST (yes, I realize that these numbers fluctuate, but not by 30% - I'm seeing swings of around 0.00005 MYST, which puts it at less than 1%). Using yesterday's fees (0.0003002/0.0629088) - this node should have made 0.704421696611111 MYST - but it's total earnings are much lower than that - by 0.27 MYST; 39% lower.

I should be able to reconcile these numbers, because total earnings has no percentages lost to fees, it's a pure tally.

image

I'm not looking at unsettled earnings - I'm looking at total earnings and comparing it to the amount of time and bandwidth used. I'm seeing this nonsense on all 16 nodes that I'm running. Discrepancies of between 16 and 54% across the board. Something is missing from this equation. I've set all systems to debug level logging, and I'm planning on parsing through everything when I have enough to look at.

I run these 16 systems for my business, they happen to be idle 99% of the time - which is why I put your software on them. Why not make something out of the idle time? While trying to use my NMS to graph the system usages, I'm presented with these conundrums...these numbers that just don't add up.

stutteringp0et commented 2 years ago

Digging a little deeper into the myst cli - I'm llooking at service sessions and finding that 36% of sessions were charged nothing. Now, I'm not terribly concerned by this, because although the number of sessions is high, the percentage of data transfer those uncharged connections represent is very low (less than 1%...too small to even bother doing the math)

in 50 transactions, 36% were charged nothing. The sessions data displayed does not show the time, so I can't speak to that loss - but the total amount of data is 6485.275692MiB/170.3947728MiB, and the uncharged amount is 1.244839001MiB/0.528464222MiB . I can only assume that the time values would look something like these numbers.

Trying to locate the missing earnings, they don't appear to be in session data discrepancies. The small amount of data present doesn't approach coming to account for the missing myst.

stutteringp0et commented 2 years ago

Missing earnings aside, I'd like to focus on settlement and withdrawal for a moment.

OK, let's follow a single node, and a single withdrawal and see where it goes. Unfortunately, there isn't any way to see the fees from the settle process - which is a little suspect, because quite a bit of value is lost in that transaction.

0x1e9802c41c6319a482dbb53431a24c773795bcb5 was my first node to reach 0.25 myst (before the recent change to auto-settlement at 0.9 myst). From that transaction, 0.1692834 myst was transferred to 2 accounts. 0.020414104 to somewhere (an account I do not recognize) and 0.148869296 to my own account. There is a listed 0.00584940959986 matic fee, which I assume is the 0.020414104 myst (same dollar amount) and which amounts to a 12% fee.....a little steep....not ETH steep, but God doesn't even ask for 12%....

Here's the transaction https://polygonscan.com/tx/0x516343a036eeb856315e0eb0da17da295088ffe98d72c9818420c25d61afec7a

Here is the fun part, again - the numbers don't lie. There is a 20% settlement fee, which would turn 0.25 myst into 0.2 myst after settlement.....but after settlement, I only had 0.1692834 to transfer. That's 67.7% of the 0.25 myst I started with. So there is a 12.3% difference in the amount I'm told is a settlement fee (20%), and the actual amount settled - MORE than the 12% fee charged to transfer to my wallet.

Now, I understand that gas fees fluctuate, and 12% isn't really much different than 12.3% - so assuming the 12.3% is another gas fee seems logical. My point in this exercise is to point out that the amount being transferred is losing a combined total of 20.4%, in addition to the 20% settlement fee - we're being fee'd over 40% (settlement fee + 2 gas fees). Not that there shouldn't be a settlement fee - but the gas fees for 2 transfers is ridiculous. If I have a defined transfer address - transfer it directly there and save me 12% in fees! This is the difference, on a 0.25 myst settlement being 0.14886926 myst in my wallet (status quo), or it being 0.1692834 myst (1 gas fee instead of 2).

Mind you, I know these numbers are small, but I intended my first transfers to be small so I could see and get to understand the process and particulars....and what I'm seeing has me questioning the wisdom of the architects. Who thought it would be a good idea to engineer a settlement and withdrawal system that gives participants 59.5477185% of their "earnings"?

Donatas-MN commented 2 years ago

@stutteringp0et gas fees are not calculated in %, they are a fixed amount for that moment of time. Because of low settlement value (0.25) total fees were around 30% (20% network + Polygon chain transaction fee). That's why auto-settlement value was increased to 0.9 MYST, so total % of fees is decreased.

Regarding earnings, what do you currently see for 0x1e9802c41c6319a482dbb53431a24c773795bcb5 node? It should be ~0.91 MYST. Can you attach most recent screenshots from NodeUI and Mystnodes? Also try to update to newest node version?

stutteringp0et commented 2 years ago

I keep Myst updated on all (now) 18 nodes, it's never more than 24 hours past a new release. My concern is that the numbers reveal a fee-hellscape. I get that the gas fees fluctuate - but the settlement process takes a fee, then the withdrawal process takes a fee - there are two gas fees to make a withdrawal. The first works out to 7%, the second was calculated to be 8%. In total, the withdrawal process takes 35%.

For example (and I've been waiting for this to happen for several days), one of my nodes reached the 0.9 threshold for auto-settlement. The node UI says in black-and-white that the fee is 20%, however, 27% is taken when you factor in the first gas fee.

Settlement amount: 0.9031207 Fee: 0.2506481 (27.7%) Received Amount: 0.6524726 (72.2%)

The actual decimal tail on those percentages is quite long, but they work out to 100%.

Of course, if I leave the balance in the node to accumulate, then fee percentage goes down for the 2nd gas fee - but I'm still losing 7% to an unnecessary first gas fee. If I have a defined default withdrawal address - send it there and save me 8% in fees....

Donatas-MN commented 2 years ago

These transaction (gas) fees are taken by Polygon blockchain depending on how busy it is. We don't have any influence to it.

Regarding settlement, we have automated withdrawals in backlog which will allow to settle directly to external wallet thus saving one part of current blockchain fees.