ChainSafe / ChainBridge

🌉 Modular Multi-Directional Blockchain Bridge to interact with Multiple Networks; Ethereum, Ethereum Classic, Substrate, based chains. Stay tuned for ChainBridge Hub!
GNU Lesser General Public License v3.0
474 stars 300 forks source link

1559 style transactions getting stuck #704

Closed mbaxter closed 3 years ago

mbaxter commented 3 years ago

We recently ran into an issue with release v1.1.4: when the current base fee exceed the configured maxGasPrice, the maxPricePerGas is set to maxGasPrice + 1, and the maxPriorityFee is set to 1 wei. We observed a span of several hours where the baseFee dropped below our maxGasPrice, but these transactions were not picked up by miners. We think this is because the priority fee was set so low.

Expected Behavior

1559-style transactions should not be set with an exceedingly low maxPriorityFee.

Current Behavior

1559-style transactions are broadcast with a maxPriorityFee of 1 wei when the network is congested and prices surge above the maxGasPrice.

Possible Solution

Because a transaction will never be priced higher than maxFeePerGas regardless of maxPriorityFee, we think that maxPriorityFee should always be set based on market conditions, rather than being set to a very low value when the base fee surges.

Steps to Reproduce (for bugs)

  1. Configure a maxGasPrice that is likely to be too low for part of the day (for us, this is currently 70 gwei on Ethereum Mainnet)
  2. Observe transactions broadcast with a maxPriorityFee of 1 wei when base fees are high

Versions

ChainBridge commit (or docker tag): v1.1.4 chainbridge-solidity version: chainbridge-substrate version: Go version:

P1sar commented 3 years ago

As quick fix we increased maxPriorityFee to 1Gwei in cases when BaseFee is higher than configured MaxGasPrice. We realize the problem with current Fee calculations, and are working on more stable solution