File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -403,6 +403,14 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc
403403 return nil , errors .New ("PrepareProposal handler not set" )
404404 }
405405
406+ // Abort any running OE so it cannot overlap with `PrepareProposal`. This could happen if optimistic
407+ // `internalFinalizeBlock` from previous round takes a long time, but consensus has moved on to next round.
408+ // Overlap is undesirable, since `internalFinalizeBlock` and `PrepareProoposal` could share access to
409+ // in-memory structs depending on application implementation.
410+ // No-op if OE is not enabled.
411+ // Similar call to Abort() is done in `ProcessProposal`.
412+ app .optimisticExec .Abort ()
413+
406414 // Always reset state given that PrepareProposal can timeout and be called
407415 // again in a subsequent round.
408416 header := cmtproto.Header {
You can’t perform that action at this time.
0 commit comments