Skip to content

Commit

Permalink
perf: Make recheck not re-run validate basic (cosmos#20208) (#871)
Browse files Browse the repository at this point in the history
Signed-off-by: yihuang <[email protected]>
Co-authored-by: Dev Ojha <[email protected]>
Co-authored-by: yihuang <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2025
1 parent cfbca9f commit d9bb1b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (server) [#21941](https://github.com/cosmos/cosmos-sdk/pull/21941) Regenerate addrbook.json for in place testnet.
* (store) [#923](https://github.com/crypto-org-chain/cosmos-sdk/pull/923) Enable iavl async pruning.
* (store) [#934](https://github.com/crypto-org-chain/cosmos-sdk/pull/934) Add pause pruning.
* (baseapp) [#20208](https://github.com/cosmos/cosmos-sdk/pull/20208) Skip running validateBasic for rechecking txs.

### Bug Fixes

Expand Down
8 changes: 6 additions & 2 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,12 @@ func (app *BaseApp) runTxWithMultiStore(
}

msgs := tx.GetMsgs()
if err := validateBasicTxMsgs(msgs); err != nil {
return sdk.GasInfo{}, nil, nil, err
// run validate basic if mode != recheck.
// as validate basic is stateless, it is guaranteed to pass recheck, given that its passed checkTx.
if mode != execModeReCheck {
if err := validateBasicTxMsgs(msgs); err != nil {
return sdk.GasInfo{}, nil, nil, err
}
}

for _, msg := range msgs {
Expand Down

0 comments on commit d9bb1b6

Please sign in to comment.