-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
refactor: Baseapp audit changes #14379
Conversation
} | ||
|
||
// Returns the application's deliverState if app is in runTxModeDeliver, | ||
// otherwise it returns the application's checkstate. | ||
// prepareProposalState if app is in runTxPrepareProposal, processProposalState | ||
// if app is in runTxProcessProposal, and checkState otherwise. | ||
func (app *BaseApp) getState(mode runTxMode) *state { | ||
switch mode { | ||
case runTxModeDeliver: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change potentially affects state.
Call sequence:
github.com/cosmos/cosmos-sdk/baseapp.validateBasicTxMsgs (baseapp/baseapp.go:539)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).runTx (baseapp/baseapp.go:618)
(*github.com/cosmos/cosmos-sdk/baseapp.BaseApp).DeliverTx (baseapp/baseapp.go:326)
@@ -162,7 +162,7 @@ | |||
// already be initialized in InitChain. Otherwise app.deliverState will be | |||
// nil, since it is reset on Commit. | |||
if app.deliverState == nil { | |||
app.setDeliverState(req.Header) | |||
app.setState(runTxModeDeliver, req.Header) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods
LGTM! Thanks :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
[Cosmos SDK] Kudos, SonarCloud Quality Gate passed! |
FYI @facundomedica -- audit PRs need to be backported to v0.47 :) |
Co-authored-by: Aleksandr Bezobchuk <[email protected]> (cherry picked from commit 6d33fa8)
Co-authored-by: Facundo Medica <[email protected]>
Description
Some refactor from Amaury's and my notes.
Some other stuff is left, will do on a separate PR as those still need review
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change