-
Notifications
You must be signed in to change notification settings - Fork 585
-
Currently, when the feemarket module is enabled, for eth transactions we have an extra requirement:
effectiveGasPrice >= minimal-gas-prices
where effectiveGasPrice = min(baseFeePerGas + tipCap, feeCap) for `DynamicFeeTx`
effectiveGasPrice = gasPrice for `LegacyTx`
Usually, clients pick zero or constant tipCap for dynamic fee tx, and baseFeePerGas keep dropping when blocks are sparse, when baseFeePerGas drop to a point where effectiveGasPrice < minimal-gas-prices, the dynamic fee tx will fail, and client have to re-calculate a tipCap based on current minimal-gas-prices and baseFeePerGas. So basically the client logic will be different from go-ethereum.
A simple solution is don't check minimal-gas-prices at all for eth tx when feemarket is enabled. And for legacy tx, rather than check tx.gasPrice >= minimal-gas-prices, we check tx.gasPrice >= baseFeePerGas.
And considering the native cosmos tx, we shouldn't set min-gas-price too low, a reasonable one might be set min-gas-price = initial base fee.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 6 replies
-
isnt tipCap = minimal-gas-prices?
in that case effectiveGasPrice can never be inferior to minimal-gas-price?
(in case feecap is lower, then its normal for tx to fail)
Beta Was this translation helpful? Give feedback.
All reactions
-
That'll cost minimal-gas-prices + baseFeePerGas for dynamic fee tx, while only cost minimal-gas-prices for legacy tx.
Beta Was this translation helpful? Give feedback.
All reactions
-
yeah i see, for legacy tx, if feemarket module is enable, it would be more sense to check baseFee instead of min-gas-price
Beta Was this translation helpful? Give feedback.
All reactions
-
btw what do you mean by legacy tx?
I think we dont make the distinction on ante handler between legacy and dynamic tx and both txs should follow the same rule
- if feemarket enable then check that
txfee>= baseFee + min-gas-price - if feemarket not enable then check that
txFee>= min-gas-price
txFee = effectiveFee for dynamicTx (EIP 1559) or = gasprice for legacytx
Beta Was this translation helpful? Give feedback.
All reactions
-
For DynamicFeeTx, effectiveGasPrice is min(baseFeePerGas + tipCap, feeCap).
For LegacyTx, effectiveGasPrice is gasPrice.
Beta Was this translation helpful? Give feedback.
All reactions
-
Currently, the eth_gasPrice API returns baseFeePerGas + minimal-gas-price, I think that's wrong too.
Beta Was this translation helpful? Give feedback.
All reactions
-
In your model, is minimal-gas-price part of consensus or a block producer parameter?
Beta Was this translation helpful? Give feedback.
All reactions
-
In your model, is
minimal-gas-pricepart of consensus or a block producer parameter?
block producer parameter, what we have in cosmos-sdk currently.
Beta Was this translation helpful? Give feedback.