Geth 1.10 txpool ordering
Rationale
With the latest update of geth 1.10, transactions with the same gas price are ordered by receive time, rather than by random order.
This receive time ordering may not be suitable to binance smart chain. Since BSC's validation mechanism is 21 validators taking turn deterministically to wrap transactions, deterministic transaction ordering can lead to below problems :
- validators can GUARANTEED frontrun/ backrun pending pool transactions, as validators do not need to compete for POW. For example, a validator can guaranteed front running IDO starts at a pre-determined block number.
- since latency becomes critical after the update, nodes have less incentives to include light nodes and nodes located remotely (like in New Zealand) as peers. Nodes are concentrated located and connected. This causes the nodes become more and more centralized and defeats the purpose of decentralization.
Also, I think this change is vital and wonder is that any reason not stating it in the change list?
Implementation
The origin of this change in ethereum mainnet is to avoid spam back running transactions occupying block spaces. To achieve the same goal in bsc, could we propose the below change instead?
- sort the transaction order by receive time, with a noise added so that order is sorted by T + N(0,sigma)
- revert the change if the spam issue not serious. Seems to me that the 60m gas limit is not fully utilized recently.
Welcome any thoughts!
I hope so, so many bots using same gas price to stuck the blockchain in IDO or pancake listing
I think this relates to below issue. https://github.com/ethereum/go-ethereum/issues/21350
Agree that bsc specific PoA nature may bring some interest conflicts due to this enhancement.
validators can GUARANTEED frontrun/ backrun pending pool transactions, as validators do not need to compete for POW. For example, a validator can guaranteed front running IDO starts at a pre-determined block number.
This has nothing to do with tx ordering by received time.
since latency becomes critical after the update, nodes have less incentives to include light nodes and nodes located remotely (like in New Zealand) as peers. Nodes are concentrated located and connected. This causes the nodes become more and more centralized and defeats the purpose of decentralization.
I don't see how the incentives for nodes to connect to light nodes change based on how validators order their tx.
As for your solutions:
sort the transaction order by receive time, with a noise added so that order is sorted by T + N(0,sigma)
If there is randomization involved then people will spam tx to get the lowest random number. It takes us back to where we started.
revert the change if the spam issue not serious. Seems to me that the 60m gas limit is not fully utilized recently.
It is already getting increasingly difficult to run BSC nodes - we shouldn't be trying to make the problem worse.
With deterministic tx ordering, validators and their friends can ensure 100% send the transactions earlier to the deterministic-ordered node. Internet signal latency is limited by speed of light. If my node is located in Africa, it MUST be slower than the node located next to validators.
This change has rewarded validators with higher transaction positioning, while penalizing non-validators' nodes. This problem exists in ethereum mainnet, but bsc deterministic validator order magnified the problem.
Adding a noise to receive time will solve the problem if we set sigma (standard deviation of the noise) small enough. Send and populate every transaction needs time.
Running a bsc node nowadays is difficult. But it does not imply we do not need to enhance the tools. We shall make the playground more fair to all people, not just focus on the benefits of validators. Validators are well paid for the gas fee, and preferential tx ordering is a critical change that shall have at least consulted community.
I think here we are addressing the issue on fairness. Given validators and their associates have the absolute advantage in transactions with the same gas price as they must be the closest with the shortest request time.
I believe Binance shall address this issue, to ensure we are participating in a fair game.
Kind of new to this tx ordering thing. Are you saying that as long as the validator node or the nodes in its vicinity are paying the same gas as mine, I would almost certainly be placed after the validator's transaction due to latency issue?
If a validator wanted to insert their own transactions, and reorder transactions, they could regardless of how the txpool is implemented in the standard bsc node. (see eg MEV, flashbots, etc...) Ordering transactions with the same gas price by time of arrival in the standard bsc implementation, instead of randomly, disincentivizes spam, which is good for the long term health of the bsc network. It just sounds like you used to spam and are now frustrated that it no longer works.
IMO if binance validators started doing MEV that would look very bad, as they would be directly taking money from their users and reordering their transactions.
Everyone can modify geth for their own interest. But this does not mean we do not need to modify the default geth version.
The problem here is the tx pool logic change is favorable to validators and their friends. This is unfair especially due to bsc deterministic validator ordering.
I pointed out this undesirable change is caused by preventing spam at the beginning. I am wondering if any method can help fix the issue while promoting fairness.
I would not accuse anyone against this is having benefit due to this change. Let's focus on the matter.
@RayCCY You are right that so far as I observed, all the validators are using v1.10 with tx sort by receive time under same gas price.
Under normal market condition, most transactions are with 5 gwei gas price. Transactions submitted close to validators node will be front, while other nodes and public node (most of us just use public node in metamask) orders are at the back.
@patllc if this is the case, validators can profit a lot from this change. For example, they would definitely be the first user to participate in initial offerings, front running all the other users. Validators can also make use of their advantage to do arbitrage trading on BSC, eliminating all the other regular arbitrageurs.
To conclude, this change is so-called a way to prevent spamming, but in fact, the ultimate goal is to benefit the validators with a HUGE amount of extra profit. Therefore we can expect a lot of people with vested interests to oppose your suggestion to revert this change.
validators can GUARANTEED frontrun/ backrun pending pool transactions, as validators do not need to compete for POW. For example, a validator can guaranteed front running IDO starts at a pre-determined block number.
This has nothing to do with tx ordering by received time.
Yes it is related to tx ordering by received time. Consider an initial offering that starts at block X, right now the validators can insert their tx as the first tx in block X, thus front running all the other participants. @Dondudu please correct me if you think otherwise.
validators can GUARANTEED frontrun/ backrun pending pool transactions, as validators do not need to compete for POW. For example, a validator can guaranteed front running IDO starts at a pre-determined block number.
This has nothing to do with tx ordering by received time.
Yes it is related to tx ordering by received time. Consider an initial offering that starts at block X, right now the validators can insert their tx as the first tx in block X, thus front running all the other participants. @Dondudu please correct me if you think otherwise.
As mentioned by @patllc, any validator can always edit their own geth to have whatever behaviour they like. They can put their own tx ahead of yours even if their gas price is 0. Actually a validator will always use a "plausible" gas price to hide their behaviour since the gas gets paid to themselves anyway. This is called MEV extraction if you want to read more about it.
Yes @Dondudu Open source means that anyone can edit the code. But I think at least in the official published release, we shall equalize chances of all nodes getting earlier transaction position.
Most of the transaction concentrated in 5 gwei ( around 70% transactions in below block using 5gwei https://bscscan.com/txs?block=7960114&p=2), Unlike ethereum the gas price more diversified. This fairness issue is serious in bsc chain.
I'm seeing this problem in some frontrunning actions. Some users are just invincible, they always put their transaction just after the needed one and the rest of users can just only look. They don't ever need to spam the 5 gas transaction, they are always ahead.
Orginally bsc chain is random validator order with random transaction position. This means that even submitting order through public node can be ahead of validators' friends. (Not to mention MEV extraction here as seems cannot avoid) It is more fair than current deterministic order and deterministic transaction position.
Can we think of some new method that can both avoid spam attack and more fair?
I have proposed
-
transaction position based on received Time plus a random noise (depending on the distribution and parameters chose, spam problem may still exist)
-
revert the change (seems not okay? Any objection?)
Is there any other method?
For the benefits of all bsc users, I do think that we can think of some new ways to improve the chain.
Is randomizing the mining order of validators a possible solution to this? I don't see there will be spamming this way while ensuring no one can take advantage of the deterministic mining order.
This has to be reverted to 1.0.6/1.0.7 behaviour... I do not think it was intentionally, but 1.1.0 was released under pressure of time.
@guagualvcha Any thought ?
If you look at this, i think this wont change.. too lucrative for binance. They have a bot at https://bscscan.com/address/0xf662b54e8f96caef0336ef44f7bef6f5921d0e51 Earnings go to https://bscscan.com/address/0x1bbb0c5cab3798b16a66220365426e8c01d091d7 then to https://bscscan.com/address/0x8def74b2df35cff9137e0fd45a0754fe31d05229 and from there directly to Binance Hot Wallet.
Well... Binance hot wallet is indeed binance official wallet... It is NOT Users accounts in binance.
Arbitragers are necessary for an efficient exchange. But is binance necessarily extracting all opportunities?
I hope it is not intentional.