Skip to content

Conversation

@masih
Copy link
Collaborator

@masih masih commented Sep 4, 2025

When call to the underlying (cosmos) CheckTx fails make sure that the error is returned from mempool CheckTx.

Fix check for callback to assure result is non-nil before callback function is executed.

When call to the underlying (cosmos) `CheckTx` fails make sure that the
error is returned from mempool `CheckTx`.

Fix check for callback to assure result is non-nil before callback
function is executed.
@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.27%. Comparing base (5eeed73) to head (0b921c0).

Files with missing lines Patch % Lines
internal/mempool/mempool.go 71.42% 4 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
+ Coverage   57.24%   57.27%   +0.03%     
==========================================
  Files         257      257              
  Lines       34597    34596       -1     
==========================================
+ Hits        19804    19814      +10     
+ Misses      13205    13203       -2     
+ Partials     1588     1579       -9     
Files with missing lines Coverage Δ
internal/mempool/mempool.go 70.43% <71.42%> (-0.05%) ⬇️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

if err != nil {
removeHandler(true)
res.Log = txmp.AppendCheckTxErr(res.Log, err.Error())
return err
Copy link
Contributor

@yzang2019 yzang2019 Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would break the existing broadcast logic if we return err instead of putting err in the response. Currently error is already being handled by adding to the res.log and passed into cb function back to the client

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a second though, I think it makes more sense to return error to the client rather than putting error in the response log, so the change LGTM. Probably need to evaluate whether there's any risk/impact to the existing client or not.

if err != nil {
removeHandler(true)
res.Log = txmp.AppendCheckTxErr(res.Log, err.Error())
return err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a second though, I think it makes more sense to return error to the client rather than putting error in the response log, so the change LGTM. Probably need to evaluate whether there's any risk/impact to the existing client or not.

Copy link
Contributor

@stevenlanders stevenlanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems reasonable to me. We'll want to figure out a good way to confirm this is safe. I'm a little worried about unintended risk here (like some memory leak on failures or some underlying assumption for the current behavior)

@github-actions
Copy link

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 24, 2025, 9:51 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants