Skip to content

Commit

Permalink
Abort OE in PrepareProposal
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyding committed Jul 18, 2024
1 parent 5a60ce2 commit e5c3ffd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,14 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc
NextValidatorsHash: req.NextValidatorsHash,
AppHash: app.LastCommitID().Hash,
}

// Abort any running OE so it cannot overlap with `PrepareProposal`. This could happen if optimistic
// `internalFinalizeBlock` from previous round takes a long time, but consensus has moved on to next round.
// Overlap is undesirable, since internalFinalizeBlock` and `PrepareProoposal` could share access to
// in-memory structs.
// No-op if OE is not enabled.
// Similar call to Abort() is done in `ProcessProposal`
app.optimisticExec.Abort()
app.setState(execModePrepareProposal, header)

// CometBFT must never call PrepareProposal with a height of 0.
Expand Down

0 comments on commit e5c3ffd

Please sign in to comment.