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

feat: in-protocol minimum gas price #107

Merged
merged 9 commits into from
Oct 1, 2024

Conversation

SebastianElvis
Copy link
Member

@SebastianElvis SebastianElvis commented Sep 30, 2024

Resolves https://github.com/babylonlabs-io/pm/issues/49

This PR introduces the in-protocol minimum gas price mechanism, in which the consensus (more specifically the AnteHandler) enforces every tx has to set a gas price at least 0.002 ubbn. The PR also provides relevant tests. The impl closely follows celestiaorg/celestia-app#2985.

In addition, this PR creates a new package app/ante to abstract out the construction of the AnteHandler for Babylon, following the practice at Celestia.

@SebastianElvis SebastianElvis marked this pull request as ready for review September 30, 2024 02:53
@SebastianElvis SebastianElvis requested a review from a team as a code owner September 30, 2024 02:53
Comment on lines +49 to +51
// CheckTxFeeWithGlobalMinGasPrices will enforce the global minimum
// gas price for all transactions.
TxFeeChecker: CheckTxFeeWithGlobalMinGasPrices,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: this is the place where min gas price is enforced

@SebastianElvis SebastianElvis marked this pull request as draft September 30, 2024 05:01
@SebastianElvis SebastianElvis marked this pull request as ready for review September 30, 2024 09:28
@SebastianElvis SebastianElvis self-assigned this Sep 30, 2024
Copy link
Member

@Lazar955 Lazar955 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, lgtm

Copy link
Contributor

@RafilxTenfen RafilxTenfen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@RafilxTenfen
Copy link
Contributor

We should probably update

baseConfig.MinGasPrices = sdk.NewCoin(appparams.BaseCoinUnit, sdkmath.NewInt(1)).String()

To use the min global default

@SebastianElvis SebastianElvis merged commit ae2e53e into main Oct 1, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants