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 priority to check tx based on gas fees #23

Merged
merged 3 commits into from
Sep 22, 2022
Merged

Conversation

Kbhat1
Copy link
Contributor

@Kbhat1 Kbhat1 commented Sep 21, 2022

@Kbhat1 Kbhat1 requested a review from codchen September 21, 2022 14:20
@@ -662,7 +662,7 @@ func (app *BaseApp) runTx(ctx sdk.Context, mode runTxMode, txBytes []byte) (gInf

// only run the tx if there is block gas remaining
if mode == runTxModeDeliver && ctx.BlockGasMeter().IsOutOfGas() {
return gInfo, nil, nil, sdkerrors.Wrap(sdkerrors.ErrOutOfGas, "no block gas left to run tx")
return gInfo, nil, nil, 0, sdkerrors.Wrap(sdkerrors.ErrOutOfGas, "no block gas left to run tx")
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we want to set these error cases to -1 so that if some valid txs didn't specify priority and default to 0, at least they won't be ranked after the invalid ones?

bankKeeper: bk,
feegrantKeeper: fk,
txFeeChecker: tfc,
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this field is required, we probably want to add it to simapp in this repo to 1 prevent it from breaking and 2 serve as an example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added it in the simapp where we create a new AnteHandler in latest commit. However it is not required func NewDeductFeeDecorator(ak AccountKeeper, bk types.BankKeeper, fk FeegrantKeeper, tfc TxFeeChecker) DeductFeeDecorator { if tfc == nil { tfc = CheckTxFeeWithValidatorMinGasPrices }

@Kbhat1 Kbhat1 merged commit c83b148 into main Sep 22, 2022
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.

2 participants