From 0730eef404eb086e968b8cd19f43020a57845613 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 20 Sep 2022 10:01:41 +0800 Subject: [PATCH 1/3] Problem: streaming listeners are not called for deliver tx event it was removed accidentally, add back. --- CHANGELOG.md | 1 + baseapp/abci.go | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94b5d614193a..09024e4908e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -164,6 +164,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (export) [#13029](https://github.com/cosmos/cosmos-sdk/pull/13029) Fix exporting the blockParams regression. * (x/gov) [#13051](https://github.com/cosmos/cosmos-sdk/pull/13051) In SubmitPropsal, when a legacy msg fails it's handler call, wrap the error as ErrInvalidProposalContent (instead of ErrNoProposalHandlerExists). * (x/gov) [#13045](https://github.com/cosmos/cosmos-sdk/pull/13045) Fix gov migrations for v3(0.46). +* (Store) [#]() Call streaming listeners for deliver tx event, was removed accidentally. ### Deprecated diff --git a/baseapp/abci.go b/baseapp/abci.go index 31004fc5d97b..39e8bf81c5e4 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -284,10 +284,18 @@ func (app *BaseApp) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx { // Otherwise, the ResponseDeliverTx will contain relevant error information. // Regardless of tx execution outcome, the ResponseDeliverTx will contain relevant // gas execution context. -func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) abci.ResponseDeliverTx { +func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) { gInfo := sdk.GasInfo{} resultStr := "successful" + defer func() { + for _, streamingListener := range app.abciListeners { + if err := streamingListener.ListenDeliverTx(app.deliverState.ctx, req, res); err != nil { + app.logger.Error("DeliverTx listening hook failed", "err", err) + } + } + }() + defer func() { telemetry.IncrCounter(1, "tx", "count") telemetry.IncrCounter(1, "tx", resultStr) From 0d2f19c6ab419ea96bbe9773bb7d2e0233f19fa4 Mon Sep 17 00:00:00 2001 From: yihuang Date: Tue, 20 Sep 2022 10:15:14 +0800 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09024e4908e8..b9550b723bc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -164,7 +164,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (export) [#13029](https://github.com/cosmos/cosmos-sdk/pull/13029) Fix exporting the blockParams regression. * (x/gov) [#13051](https://github.com/cosmos/cosmos-sdk/pull/13051) In SubmitPropsal, when a legacy msg fails it's handler call, wrap the error as ErrInvalidProposalContent (instead of ErrNoProposalHandlerExists). * (x/gov) [#13045](https://github.com/cosmos/cosmos-sdk/pull/13045) Fix gov migrations for v3(0.46). -* (Store) [#]() Call streaming listeners for deliver tx event, was removed accidentally. +* (Store) [#13334](https://github.com/cosmos/cosmos-sdk/pull/13334) Call streaming listeners for deliver tx event, it was removed accidentally. ### Deprecated From b76cd5e42136637107c0c7d8ae14c5f3a74f0964 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 20 Sep 2022 12:14:45 +0800 Subject: [PATCH 3/3] try to fix e2e test by wait for one more block --- tests/e2e/tx/service_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/e2e/tx/service_test.go b/tests/e2e/tx/service_test.go index 64e1a75c9832..89b32212d481 100644 --- a/tests/e2e/tx/service_test.go +++ b/tests/e2e/tx/service_test.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" clienttx "github.com/cosmos/cosmos-sdk/client/tx" @@ -17,7 +18,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "cosmossdk.io/simapp" "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/cosmos-sdk/testutil/network" @@ -122,6 +122,7 @@ func (s *IntegrationTestSuite) TestQueryBySig() { s.Require().NoError(err) s.Require().NotEmpty(resp.TxResponse.TxHash) + s.Require().NoError(s.network.WaitForNextBlock()) s.Require().NoError(s.network.WaitForNextBlock()) // get the signature out of the builder