diff --git a/baseapp/abci.go b/baseapp/abci.go index 32a6d8683227..ef17ecc0a72a 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -412,6 +412,16 @@ func (app *BaseApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliv return sdkerrors.ResponseDeliverTxWithEvents(err, gInfo.GasWanted, gInfo.GasUsed, sdk.MarkEventsToIndex(anteEvents, app.indexEvents), app.trace) } + if sdk.MaxEventSize > 0 { + for _, event := range result.Events { + for _, attr := range event.Attributes { + if len([]byte(attr.Key))+len([]byte(attr.Value)) > sdk.MaxEventSize { + attr.Value = "evt val too large, inc max-event-size in config.toml" + } + } + } + } + return abci.ResponseDeliverTx{ GasWanted: int64(gInfo.GasWanted), // TODO: Should type accept unsigned ints? GasUsed: int64(gInfo.GasUsed), // TODO: Should type accept unsigned ints? diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index c8c7ee401d98..dc1376f8613d 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -775,16 +775,6 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re } } - if sdk.MaxEventSize > 0 { - for _, event := range result.Events { - for _, attr := range event.Attributes { - if len([]byte(attr.Key))+len([]byte(attr.Value)) > sdk.MaxEventSize { - attr.Value = "evt val too large, inc max-event-size in config.toml" - } - } - } - } - return gInfo, result, anteEvents, priority, err }