Skip to content
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

fix(baseapp): preblock events are not emmitted correctly (backport #21444) #21458

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix conflicts
  • Loading branch information
julienrbrt committed Aug 30, 2024
commit d57f6fcc9e28129b54f593e7f5f49fdbc34df0c8
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Bug Fixes

* (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.
* (baseapp) [#21444](https://github.com/cosmos/cosmos-sdk/pull/21444) Follow-up, Return PreBlocker events in FinalizeBlockResponse.

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

Expand Down
7 changes: 1 addition & 6 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,14 +707,9 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context
func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) ([]abci.Event, error) {
var events []abci.Event
if app.preBlocker != nil {
<<<<<<< HEAD
ctx := app.finalizeBlockState.Context()
ctx := app.finalizeBlockState.Context().WithEventManager(sdk.NewEventManager())
rsp, err := app.preBlocker(ctx, req)
if err != nil {
=======
ctx := app.finalizeBlockState.Context().WithEventManager(sdk.NewEventManager())
if err := app.preBlocker(ctx, req); err != nil {
>>>>>>> 58bbcd9d7 (fix(baseapp): preblock events are not emmitted correctly (#21444))
return nil, err
}
// rsp.ConsensusParamsChanged is true from preBlocker means ConsensusParams in store get changed
Expand Down
5 changes: 0 additions & 5 deletions types/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -750,13 +750,8 @@ func (m Manager) RunMigrations(ctx context.Context, cfg Configurator, fromVM Ver
// PreBlock performs begin block functionality for upgrade module.
// It takes the current context as a parameter and returns a boolean value
// indicating whether the migration was successfully executed or not.
<<<<<<< HEAD
func (m *Manager) PreBlock(ctx sdk.Context) (*sdk.ResponsePreBlock, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
paramsChanged := false
=======
func (m *Manager) PreBlock(ctx sdk.Context) error {
>>>>>>> 58bbcd9d7 (fix(baseapp): preblock events are not emmitted correctly (#21444))
for _, moduleName := range m.OrderPreBlockers {
if module, ok := m.Modules[moduleName].(appmodule.HasPreBlocker); ok {
rsp, err := module.PreBlock(ctx)
Expand Down
Loading