kaiachain / kaia

GNU Lesser General Public License v3.0
13 stars 17 forks source link

Return zero tip cap if next baseFee is lower bound #28

Closed hyeonLewis closed 3 months ago

hyeonLewis commented 3 months ago

Proposed changes

Currently, SuggestTipCap always returns tip cap based on fee history. This PR makes it return zero tip cap if nextBaseFee == LowerBoundBaseFee, which is currently 25 Gkei.

Types of changes

Please put an x in the boxes related to your change.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Related issues

Further comments

// When nextBaseFee == 25 Gkei
> cast rpc eth_maxPriorityFeePerGas --rpc-url http://localhost:8551/   
> "0x0"
> cast rpc eth_gasPrice --rpc-url http://localhost:8551/                                                                  
> "0x5d21dba00" // 25 gwei

// When nextBaseFee > 25 Gkei (and intentionally sent txs with very high `effectiveGasPrice`)
> cast rpc eth_maxPriorityFeePerGas --rpc-url http://localhost:8551/
> "0x746a528800" // 500 Gkei, which is GPOMaxPrice
> cast rpc eth_gasPrice --rpc-url http://localhost:8551/                            
> "0x12309ce5400" // (500 + 750) Gkei = 1,250 Gkei