Skip to content

Commit

Permalink
perf: Make recheck not re-run validate basic (cosmos#20208)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon authored and mmsqe committed Oct 25, 2024
1 parent d78d66e commit 4da68da
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 @@ -65,6 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements

* (server) [#21941](https://github.com/cosmos/cosmos-sdk/pull/21941) Regenerate addrbook.json for in place testnet.
* (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 4da68da

Please sign in to comment.