Skip to content

Commit 8c9152d

Browse files
mergify[bot]facundomedicajulienrbrt
authored
fix(baseapp): preblock events are not emmitted correctly (backport #21444) (#21458)
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent f2b1a52 commit 8c9152d

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4949
### Bug Fixes
5050

5151
* (baseapp) [#21256](https://github.com/cosmos/cosmos-sdk/pull/21256) Halt height will not commit the block indicated, meaning that if halt-height is set to 10, only blocks until 9 (included) will be committed. This is to go back to the original behavior before a change was introduced in v0.50.0.
52+
* (baseapp) [#21444](https://github.com/cosmos/cosmos-sdk/pull/21444) Follow-up, Return PreBlocker events in FinalizeBlockResponse.
5253

5354
## [v0.50.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.9) - 2024-08-07
5455

baseapp/baseapp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
707707
func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) ([]abci.Event, error) {
708708
var events []abci.Event
709709
if app.preBlocker != nil {
710-
ctx := app.finalizeBlockState.Context()
710+
ctx := app.finalizeBlockState.Context().WithEventManager(sdk.NewEventManager())
711711
rsp, err := app.preBlocker(ctx, req)
712712
if err != nil {
713713
return nil, err

types/module/module.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,6 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM Ver
751751
// It takes the current context as a parameter and returns a boolean value
752752
// indicating whether the migration was successfully executed or not.
753753
func (m *Manager) PreBlock(ctx sdk.Context) (*sdk.ResponsePreBlock, error) {
754-
ctx = ctx.WithEventManager(sdk.NewEventManager())
755754
paramsChanged := false
756755
for _, moduleName := range m.OrderPreBlockers {
757756
if module, ok := m.Modules[moduleName].(appmodule.HasPreBlocker); ok {

0 commit comments

Comments
 (0)