From ce00982d6b4446c942d50e8c5302ba2692ec351f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 20 Sep 2022 10:40:42 +0200 Subject: [PATCH] fix: streaming listeners are not called for deliver tx event (backport #13334) (#13336) * fix: streaming listeners are not called for deliver tx event (#13334) * Problem: streaming listeners are not called for deliver tx event it was removed accidentally, add back. * Update CHANGELOG.md * try to fix e2e test by wait for one more block (cherry picked from commit 822900b69f4b62f118dc1ffd42b6a9e44054eef0) # Conflicts: # CHANGELOG.md # x/auth/tx/service_test.go * Update CHANGELOG.md * Update x/auth/tx/service_test.go * Update x/auth/tx/service_test.go Co-authored-by: yihuang --- CHANGELOG.md | 1 + baseapp/abci.go | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 890f4be20566..a8137480baa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/group) [#12888](https://github.com/cosmos/cosmos-sdk/pull/12888) Fix event propagation to the current context of `x/group` message execution `[]sdk.Result`. * (x/upgrade) [#12906](https://github.com/cosmos/cosmos-sdk/pull/12906) Fix upgrade failure by moving downgrade verification logic after store migration. +* (store) [#13336](https://github.com/cosmos/cosmos-sdk/pull/13336) Call streaming listeners for deliver tx event, it was removed accidentally, backport #13334. ## [v0.46.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0) - 2022-07-26 diff --git a/baseapp/abci.go b/baseapp/abci.go index 11ed27b64099..ded8139af796 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -317,20 +317,17 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { // Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant // gas execution context. func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) { - defer telemetry.MeasureSince(time.Now(), "abci", "deliver_tx") + gInfo := sdk.GasInfo{} + resultStr := "successful" defer func() { for _, streamingListener := range app.abciListeners { - goCtx := sdk.WrapSDKContext(app.deliverState.ctx) - if err := streamingListener.ListenDeliverTx(goCtx, req, res); err != nil { - panic(fmt.Errorf("DeliverTx listening hook failed: %w", err)) + if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil { + app.logger.Error("DeliverTx listening hook failed", "err", err) } } }() - gInfo := sdk.GasInfo{} - resultStr := "successful" - defer func() { telemetry.IncrCounter(1, "tx", "count") telemetry.IncrCounter(1, "tx", resultStr)