bnb-chain / bsc

A BNB Smart Chain client based on the go-ethereum fork
GNU Lesser General Public License v3.0
2.71k stars 1.56k forks source link

Some validators adds more transactions to the block & gains more reward. #1183

Closed BrainTR closed 1 year ago

BrainTR commented 1 year ago

Normally validators adds transactions to the block which between (Block.Timestamp - 6000ms~) and (Block.Timestamp - 3000ms~). #107 #239 But some validator adds transactions to the block which between (Block.Timestamp - 6000ms~) and (Block.Timestamp - 500ms~). Because of this, some validators adds more transactions to the block than other validators and gains more reward.

I wrote a simple script and detected some of those validators:

0xD1d6bF74282782B0b3eb1413c901D6eCF02e8e28 - Richard Feynman
0x295e26495CEF6F69dFA69911d9D8e4F3bBadB89B - Legend
0x72b61c6014342d914470eC7aC2975bE345796c2b - BNB48 Club
0x0BAC492386862aD3dF4B666Bc096b0505BB694Da - Claude Shannon
0xa6f79B60359f141df90A0C745125B131cAAfFD12 - Avengers
0x3f349bBaFEc1551819B8be1EfEA2fC46cA749aA1 - Legend II
0x8b6C8fd93d6F4CeA42Bbb345DBc6F0DFdb5bEc73 - Legend III
0x61Dd481A114A2E761c554B641742C973867899D3 - Synclub

Their APRs are higher than the others. https://www.bnbchain.org/en/staking Some validators in this list also mentioned in the following issues: #1101 #1170

I think they are using a patch something like #1151 for their custom geth.

Example Data

{BlockNumber} - {ValidatorAddress} - ...

Normal Block Flow

normal-flow

Abnormal Block Flow

abnormal-flow-1 abnormal-flow-2

These validators is sort of stealing transactions (and rewards) from the next validator. Is this normal and acceptable?

brilliant-lx commented 1 year ago

Yea, we have noticed it. And we are trying to figure out a proposal to address this problem. BSC core team delivers a reference binary release and it is open source, if all validators follow the default rule, it will be ok. However, some of the rule is not written in the consensus, it does have the risk that some validators change the code and gain more reward, but not punished. It is not fair and not acceptable, but we have to make it be part of the consensus, while not rely on validator's self-discipline.

brilliant-lx commented 1 year ago

There is a PR try to eliminate the problem, make mining more fair and follow the GasPrice rule as well. You may check: https://github.com/bnb-chain/bsc/pull/1186/

ghost commented 1 year ago

If it is not fair and not acceptable, since the validators are elected by BNB holders, why not anyone propose to vote down these BAD validators or even slash them?

brilliant-lx commented 1 year ago

Slash them may not be a good solution. Although they got more rewards, they have not broken the law right now. We will work out other solution to make it more fair between validators.

ghost commented 1 year ago

Fair enough. It would be better if we can solve the problem through code. Just want to bring up that sometimes we can utilize the power of PoS, especially when some behavior is bad for the chain healthy and the code is not ready. It's also a threat to those who want to do bad things.

I have another concern is that with the bug fix, can we really stop these validators broadcast their blocks for about 1-2 seconds late to package even more transactions. In theory if a validator A broadcasts a block too late, other validators will propose blocks trying to replace the late block. Then there will be a competition and several reorgs maybe. But actually the candidate block most likely would be proposed by the 8 validators motioned above (maybe they also changed the code to propose the candidate earlier)

soltrac commented 1 year ago

There are MANY things some validators are doing to increase the rewards. Reorganizing transactions to own benefit, etc.

I've noticed also some chainlink oracles are starting to expose their transactions only to Avengers and friends validators, having not competition to liquidation bots. That's the problem when you have only 21 validators, it is easy to cheat. For example, look this venus liquidation bot xD 0xd915cb4a5384b473378939e671a243c6e93a08a5

I think there is not much to do.

BrainTR commented 1 year ago

After the v1.1.18 update, this issue looks like resolved.