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

Add consensus min_fee for gas #7

Closed
ethanfrey opened this issue Mar 8, 2021 · 5 comments · Fixed by #45
Closed

Add consensus min_fee for gas #7

ethanfrey opened this issue Mar 8, 2021 · 5 comments · Fixed by #45
Assignees
Labels
S Small, <1 day work
Milestone

Comments

@ethanfrey
Copy link
Contributor

Cosmos has an interesting idea to allow validators to quickly adjust the block gas by making it subjective - each validator sets the required gas to enter a block their produce. While it is quite flexible to allow responding to spam (raising min gas quickly and temporarily based on off-chain social coordination), it does a poor job providing a stable baseline for running the chain. Many validators forget and leave 0 gas. Trying to convince everyone to set a similar value is quite difficult (outside of an emergency).

We should add an "AnteHandler" that enforces a min-gas fee, which can be set in genesis and adjusted by governance proposals.

@alpe
Copy link
Contributor

alpe commented Mar 16, 2021

Simplest thing would be an AnteHandler indeed which load the min fee from params. The cosmos sdk has a param update proposal type so we are covered.
I read about EIP-1559 recently on telegram by Sunny. I think a "smarter" solution than storing in params would be nice in the longer run.

@ethanfrey
Copy link
Contributor Author

Yup, there are heavy discussions on how to do this for Cosmos-SDK. Happy to use theirs when they figure it out. Let's keep it simple and stupid for now, but yeah, as a placeholder until an awesome solution is out there.

I assume there is no need for paying fees in multiple tokens, which is one of the issues the hub is trying to resolve along with EIP-1559

@ethanfrey
Copy link
Contributor Author

ethanfrey commented Mar 17, 2021

(Possibly) relevant discussion here: cosmos/cosmos-sdk#8224

We just do "minfee in params" to get this going

@ethanfrey ethanfrey added the S Small, <1 day work label Mar 17, 2021
@ethanfrey
Copy link
Contributor Author

Update: this became very urgent to other sdk folks and they have a meta issue to track designs. Good to follow this for longer-term answers cosmos/cosmos-sdk#8917

@ethanfrey
Copy link
Contributor Author

For the simple param-based consensus min-fee, Marko started mocking up a demo to show how it can be done:

https://github.com/marbar3778/fee/blob/main/app/ante.go

Note it currently only handles CheckTx, but we want it to handle DeliverTx as well: https://github.com/marbar3778/fee/blob/main/app/feeParam.go#L72-L75

(This can be used to enforce consensus min fee in DeliverTx and added to the current subjective ones. Which allows validators to quickly raise the subjective min fee if there is a spam attack)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S Small, <1 day work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants