Skip to content

Commit

Permalink
chore(ci): fix DeliverTx
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Mar 1, 2024
1 parent 15dfdd6 commit 347e767
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions app/tps_counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion proto/exocore/restaking_assets_manage/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,6 @@ service Msg {
rpc SetStakerExoCoreAddr(MsgSetExoCoreAddr) returns (MsgSetExoCoreAddrResponse);
rpc RegisterClientChain(RegisterClientChainReq) returns (RegisterClientChainResponse);
rpc RegisterAsset(RegisterAssetReq) returns (RegisterAssetResponse);
}
}

// blank comment to trigger CI

0 comments on commit 347e767

Please sign in to comment.