Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for Mempool tx fee architecture #738

Open
ValarDragon opened this issue Jan 7, 2022 · 0 comments
Open

Proposal for Mempool tx fee architecture #738

ValarDragon opened this issue Jan 7, 2022 · 0 comments

Comments

@ValarDragon
Copy link
Member

ValarDragon commented Jan 7, 2022

It seems pretty clear that there is value in making it simple to alter how the mempool prioritizes and charges for various different types of transactions. The advantage of an app-specific chain is that it can even go one step further, and do this in the state machine. (E.g. Terra's Send fee tax)

In Osmosis, we have a second goal, that per the multi-asset txfees work that got voted in by governance.

I propose the following interface for making it easy to add more transaction fee filters. (Note that the CheckTX side will become obsolete for any threshold encrypted tx once those land)

type FeeDecoratorFilter interface {
    Name() string
    MinGasPrice(tx, check_tx or deliver_tx) float64 
    FlatFee(tx, check_tx or deliver_tx) sdk.Dec
    // to be spec'd later FeeRebate(tx, check_tx or deliver_tx) feeRebateUpdate
}
  • The MinGasPrice for a tx will be the sum of MinGasPrice for each filter. (Filters can both add and subtract to this!)
  • The FlatFee will similarly be the sum of all flat fees for every filter. its denominated in uosmo
  • FeeRebate is commented out, and its this future idea that maybe we want to allow people who are staking, just deposited some IBC assets, etc. to be able to get limited amounts of 0 fee. Needs more thinking before it becomes a concrete proposal though.

We then take the Name field, and automatically propogate app.toml config entries for this.

Then we make the MempoolFeeDecorator take in a slioce FeeDecoratorFilters, get the sum of MinGasPrice and FlatFee for a tx. (Can also add in the current mempool config for min gas)

Then it converts the fee token amount into uosmo equivalent as it already does, and ensure the provided fee is sufficient

The other nice thing is its easy for filters to evolve into state machine filters, with the check tx / deliver tx distinctions.

@daniel-farina daniel-farina moved this from 🕒 Todo to 🔍 Needs Review in Osmosis Chain Development Jan 10, 2022
@ValarDragon ValarDragon moved this from 🔍 Needs Review to 🕒 Todo in Osmosis Chain Development Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo 🕒
Development

No branches or pull requests

1 participant