PIVX-Project / PIVX

Protected Instant Verified Transactions - Core wallet.
https://www.pivx.org
MIT License
529 stars 714 forks source link

MN at the bottom of the queue but no payment received #216

Closed agulab closed 7 years ago

agulab commented 7 years ago

A staker that was supposed to pay my masternode instead paid another masternode. This happens when there are multiple winners for a given block… which can happen when there are sudden swings in the number of masternodes on the network. I know there is a proposed solution for this behavior already, though it is still in internal testing right now, so I'm publishing this issue here to keep track of it.

Steps to reproduce:

  1. Follow your MN Pos in https://pivx.bitcoiner.me/masternodes/list/
  2. When your MN Pos is in the first 10% it is eligible for winning.
  3. When your MN is put at the bottom of the queue, it should have been paid.
  4. If your MN didn't receive a payment, then this issue happened.

Expected behavior

Receive a payment every time the MN is put at the bottom of the queue.

Actual behavior

The MN is put at the bottom of the queue but received no payment.

What version of PIVX Core are you using?

2020100

Any extra information that might be useful

It happened twice in four queue rounds for my MN, which sets a 50% chance of it happening. I talked about this in Slack and a developer asked me to post it here.

Mrs-X commented 7 years ago

How many blocks ago was this masternode last paid?

agulab commented 7 years ago

Yesterday at block 735572

Mrs-X commented 7 years ago

That's 1086 blocks ago. We have 2171 masternodes right now, so you can expect the next payment in about 1085 blocks.

BTW, the ranking from masternode list rank (or masternodelist for newer versions of PIVX), even when it might sound so, is NOT related to masternode payments, it's used to build consensus for SwiftTX and other things. Naming it rank was, umh, unlucky :-)

The decision to reward a masternode is (besides some other technical things) based on:

If those prerequisites are all fulfilled the score for each of those 10% masternodes is computed. The score is (basically) the hash (!) from some data from the blockchain and some properties of your masternode, so each node comes to the same result. The masternode with the highest score gets the payment.

But, and this is the important part: the hash is (more or less) a random number, so you never know which masternode will win beforehand. And, if you have really bad luck, your masternode might stay in that 10% list for quite some time until it gets paid, I've had cases where I was paid after 8000 blocks instead of about 2000 blocks. But as long as you're masternode is enabled it stays in that 10% of nodes.

In the long run, good and bad luck equals out and everyone gets the same number of rewards, so no need to worry.

agulab commented 7 years ago

Thanks for your time writing that Mrs-X, but it is not exactly covering my problem. I know Rank doesn't show the position of the MN in the payment queue, I'm looking at Pos (Position) in https://pivx.bitcoiner.me/masternodes/list/ which is an external service from a third party, but have always worked fine when it comes to calculate MN position in the payment queue. I know how the payment system works, and that's why I'd like to emphasize that my MN got out of the 10% without having received a payment, which is not an expected behavior. I don't care about the time my MN has to stay inside that 10%, as long as it gets to the bottom of the queue with a payment.

Thanks again for your interest, but I'm sure the Issue still stands.

nov3a4 commented 7 years ago

Could somebody help with detective work? Who received my first masternode reward? I had to restart masternode. So I restarted it. It was written here, that the masternode received reward 1day and 10 hours ago. https://pivx.bitcoiner.me/masternodes/list/ But I did not receive the reward. Today my second reward come correctly. I do not wish to donate my first reward everytime I restart pivxd.

It at least should be written somewhere, that first reward is donation to somebody, so I can compile the code myself instead.

I think it would be greedy if somebody receives not voluntary donation everytime from each restart of pivd of each of more than 2000 masternodes without even letting know masternode owners.

(Roughly 2000 masternodes x 2.5 PIV reward = 5000 PIV each time all masternodes needs restart. Which is $10850 USD.) Basically the donation receiver would be able create new masternode very quickly and the centralisation would start here.

I hope, there is clear explanation. Because otherwise the idea of decentralisation and pivx would start to lose in such centralisation behaviour.

This behaviour was observed with pivxd version 2.2.1. Such behaviour was not observed with pivxd version 2.2.0.

Mrs-X commented 7 years ago

Since in both cases https://pivx.bitcoiner.me/masternodes/list/ is involved it would make sense to contact them and ask HOW exactly the results there are computed.

If wanted/needed the owner of that site can drop me a private email so we can go through his/her code together.

And, BTW, there is absolutely NO donation code in PIVX, so something else must be the reason for that.

nov3a4 commented 7 years ago

The author of the website is on PIVX Slack with name @bitcoiner.

This is his response: "I don't know how this can be. My site scraps data from a running wallet client node with the command masternode list full, so you can verify if this is just my node having issues, or check in your My Masternodes tab to see if you're getting the same."

It could be handy to contact him.

Mrs-X commented 7 years ago

What does http://178.254.23.111/~pub/DN/MN_order.html say?

agulab commented 7 years ago

I'll check the position with that site for a couple of payments and then come back here. Thanks!