diff --git a/app/app.go b/app/app.go index 2738f08aa..641838a91 100644 --- a/app/app.go +++ b/app/app.go @@ -1051,6 +1051,20 @@ func (app *ExocoreApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abc return app.mm.EndBlock(ctx, req) } +// The DeliverTx method is intentionally decomposed to calculate the transactions per second. +func (app *ExocoreApp) DeliverTx(req abci.RequestDeliverTx) (res abci.ResponseDeliverTx) { + defer func() { + // TODO: Record the count along with the code and or reason so as to display + // in the transactions per second live dashboards. + if res.IsErr() { + app.tpsCounter.incrementFailure() + } else { + app.tpsCounter.incrementSuccess() + } + }() + return app.BaseApp.DeliverTx(req) +} + // InitChainer updates at chain initialization func (app *ExocoreApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { var genesisState simapp.GenesisState diff --git a/app/tps_counter.go b/app/tps_counter.go index 2e6eb475b..761504556 100644 --- a/app/tps_counter.go +++ b/app/tps_counter.go @@ -41,10 +41,8 @@ func newTPSCounter(logger log.Logger) *tpsCounter { return &tpsCounter{logger: logger, doneCh: make(chan bool, 1)} } -// nolint: unused // legacy code func (tpc *tpsCounter) incrementSuccess() { atomic.AddUint64(&tpc.nSuccessful, 1) } -// nolint: unused // legacy code func (tpc *tpsCounter) incrementFailure() { atomic.AddUint64(&tpc.NFailed, 1) } const defaultTPSReportPeriod = 10 * time.Second diff --git a/proto/exocore/restaking_assets_manage/v1/tx.proto b/proto/exocore/restaking_assets_manage/v1/tx.proto index c3b308ef8..f002cca2f 100644 --- a/proto/exocore/restaking_assets_manage/v1/tx.proto +++ b/proto/exocore/restaking_assets_manage/v1/tx.proto @@ -142,4 +142,6 @@ service Msg { rpc SetStakerExoCoreAddr(MsgSetExoCoreAddr) returns (MsgSetExoCoreAddrResponse); rpc RegisterClientChain(RegisterClientChainReq) returns (RegisterClientChainResponse); rpc RegisterAsset(RegisterAssetReq) returns (RegisterAssetResponse); -} \ No newline at end of file +} + +// blank comment to trigger CI \ No newline at end of file