tevador / RandomX

Proof of work algorithm based on random code execution
BSD 3-Clause "New" or "Revised" License
1.43k stars 307 forks source link

Guessing all the easy blocks #200

Closed linas closed 3 years ago

linas commented 3 years ago

You may dislike what I'm about to say, so sorry, in advance.

It seems as if someone knows how to guess when the easy blocks are going to show up.

QRL, the "Quantum Resistant Ledger" uses RandomX. It's a small coin, about 14 MH/sec grand total network hashrate. Pool2mine is a small pool for QRL, about 84KH/sec. So, about 3x or 4x per day, someone joins this pool, mines at a rate of 2-5MH/sec for 2-5 minutes, and then leaves. When they mine, they pick up almost every block, and every block they pick up has a difficulty of 1% to 50%.

Its as if ... you might think, suspect, that, maybe ... this miner knows exactly when the easy blocks will show up. Here's some recent activity:

Date                 Block     Difficulty of block sequence
24 December  11:30PM 1319505 - 76% 88% 55% 93% 52% 38% 76% 37% 48%
25 December  4:44PM  1320554 - 16%
26 December: 7:51PM  None
27 December  2:03AM  1322615 - 66% 8% 50% 73% 1% 80% 7% 21%
             3:36AM  1322748 - 53% 75%
             9:16AM  1323005 - 20%, 29% 16% 14%
             8:36PM  None
             9:17PM  None
28 December  3:09AM  1324078 - 27% 7% 8%
             5:31AM  1324194 - 94%
             6:55AM  1324248 - 11%, 8% 6% 12% 14%
             4:11PM  1324858 - 62%

So -- 27 December is a good example. They show up at the indicated time, with maybe 5MH/sec(? see below) hash power (this is maybe(?) 1/3rd(?) of total hash power for this coin), then, starting with block 1322615 they mined almost every block in a row, every 5 to 30 seconds, and then they leave about 7 minutes later. The network rate is supposed to be one block per minute.

You can view the above at the Pool Blocks page. The hash rate spikes are visible at the Dashboard. Note that the spikes there are are the hash-rate averaged over half an hour; the instantaneous rate is much higher. The miner is Q010300...91977ef and is visible in the top ten charts

I'm hoping that the pool2mine admin will show up here, and report more precise details on the actual hash rate

You're welcome to dismiss this bug report as a crackpot theory that indicates excessive paranoia, but, for me, this seems like strong evidence that someone knows how to guess exactly when the easy blocks show up.

I don't know if the coder here is also the mathematician who came up with RandomX, or just the implementation, but someone should take a look at this, and explain to me how I'm wrong. (FWIW I know bucketloads of math, just not very much crypto.)

SChernykh commented 3 years ago

Or maybe pool's difficulty % calculation is just biased when such large hash power joins.

tevador commented 3 years ago

Unlike some of the previous PoW algorithms, RandomX changes the program every nonce and not every block, so there may be "easy nonces", but there is no such thing as an "easy block".

How we tackled the "easy nonce problem" is explained in the documentation.

The low pool effort numbers you are seeing are probably caused by the pool underestimating the hashrate of the miner. Pools estimate hashrate based on submitted shares and when a miner connects only for a few minutes, there may not be enough time to properly estimate the hashrate.

The reason the large miner is mining only a few blocks every time is because they are gaming the difficulty adjustment algorithm. It has nothing to do with RandomX.

linas commented 3 years ago

@tevador and @SChernykh Thank you! I like that explanation! (I'll dig into it a bit more... this may take a few days ...)

linas commented 3 years ago

I'm going to append notes and remarks here, as I find things. I'll keep editing this one comment to add new findings. Hopefully, this will minimize the noise.

Current hypothesis is that there is a bug in the way pools calculate shares; it gets confused/thrown off when a huge hash rate is aimed at the pool. The evidence for this is:

I think that neatly explains "everything".

linas commented 3 years ago

Thanks, closing. I'll update above comment as I find out more. Meanwhile, I reported this to the pool software via dvandal/cryptonote-nodejs-pool#620