Skip to content

Commit

Permalink
Flush receipt with the correct state (#546)
Browse files Browse the repository at this point in the history
## Describe your changes and provide context
`stateToCommit` could be either `processProposalState` or
`deliverState`, so we should flush to the correct one. This might not be
causing issue yet though, since before receipt flush, we'd first write
`stateToCommit` to the parent state, so that `deliverState` would fall
through to parent which is already updated by `stateToCommit`

## Testing performed to validate your change
existing test
  • Loading branch information
codchen authored Nov 1, 2024
1 parent 02f1c2f commit d3830c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func (app *BaseApp) Commit(ctx context.Context) (res *abci.ResponseCommit, err e
retainHeight := app.GetBlockRetentionHeight(header.Height)

if app.preCommitHandler != nil {
if err := app.preCommitHandler(app.deliverState.ctx); err != nil {
if err := app.preCommitHandler(app.stateToCommit.ctx); err != nil {
panic(fmt.Errorf("error when executing commit handler: %s", err))
}
}
Expand Down

0 comments on commit d3830c1

Please sign in to comment.