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: CheckTX Priority #10507

Merged
merged 8 commits into from
Nov 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
godoc++
  • Loading branch information
alexanderbez committed Nov 8, 2021
commit 647068d043615794223c196be1b1ac65dbe6d816
12 changes: 11 additions & 1 deletion x/auth/middleware/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ func MempoolFeeMiddleware(txh tx.Handler) tx.Handler {
}
}

// CheckTx implements tx.Handler.CheckTx.
// CheckTx implements tx.Handler.CheckTx. It is responsible for determining if a
// transaction's fees meet the required minimum of the processing node. Note, a
// node can have zero fees set as the minimum. If non-zero minimum fees are set
// and the transaction does not meet the minimum, the transaction is rejected.
//
// Recall, a transaction's fee is determined by ceil(minGasPrice * gasLimit).
// In addition, we set the Priority of the transaction to be ordered in the
// Tendermint mempool based naively on the total sum of all fees included.
// Applications that need more sophisticated mempool ordering should look to
// implement their own fee handling middleware instead of using
// mempoolFeeTxHandler.
func (txh mempoolFeeTxHandler) CheckTx(ctx context.Context, tx sdk.Tx, req abci.RequestCheckTx) (abci.ResponseCheckTx, error) {
sdkCtx := sdk.UnwrapSDKContext(ctx)

Expand Down