Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

minimal-gas-prices and baseFeePerGas conflicts #830

yihuang started this conversation in General
Discussion options

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.

You must be logged in to vote

Replies: 2 comments 6 replies

Comment options

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)

You must be logged in to vote
5 replies
Comment options

That'll cost minimal-gas-prices + baseFeePerGas for dynamic fee tx, while only cost minimal-gas-prices for legacy tx.

Comment options

yeah i see, for legacy tx, if feemarket module is enable, it would be more sense to check baseFee instead of min-gas-price

Comment options

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

Comment options

For DynamicFeeTx, effectiveGasPrice is min(baseFeePerGas + tipCap, feeCap).
For LegacyTx, effectiveGasPrice is gasPrice.

Comment options

Currently, the eth_gasPrice API returns baseFeePerGas + minimal-gas-price, I think that's wrong too.

Comment options

In your model, is minimal-gas-price part of consensus or a block producer parameter?

You must be logged in to vote
1 reply
Comment options

In your model, is minimal-gas-price part of consensus or a block producer parameter?

block producer parameter, what we have in cosmos-sdk currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /