Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Received a successful response to the tx request, but tx is not stored in mempool. #5675

Closed
egonspace opened this issue Nov 17, 2020 · 3 comments
Assignees
Labels
C:mempool Component: Mempool T:bug-unconfirmed Type Bug (has been reported but not verified or triaged)

Comments

@egonspace
Copy link

Tendermint version (use tendermint version or git rev-parse --verify HEAD if installed from source):
latest

ABCI app (name for built-in, URL for self-written if it's publicly available):
cosmos-sdk

Environment:

  • OS (e.g. from /etc/os-release):
  • Install tools:
  • Others:

What happened:
With multiple clients sending tx requests at the same time, some txs have been found to be lost without being stacked in mempools. Of course, this doesn't seem to cause a fatal flaw, but from the client's point of view, they has been successfully answered to the tx request, which is likely to cause inconvenience in usability if later found that it wasn't stored in blocks and even in mempools.

After investigating the cause, I think this scenario is possible. Suppose the mempool is almost full and processing two txs requests simultaneously. When the following code is met in the function that processes callback after successfully passing CheckTx and sending a successful response, the second thread returns an error because it is determined that the mempool is full when the first thread is filled with tx.

https://github.com/tendermint/tendermint/blob/master/mempool/clist_mempool.go#L416

What you expected to happen:

Have you tried the latest version: yes/no

How to reproduce it (as minimally and precisely as possible):

Logs (paste a small part showing an error (< 10 lines) or link a pastebin, gist, etc. containing more of the log file):

Config (you can paste only the changes you've made):

node command runtime flags:

Please provide the output from the http://<ip>:<port>/dump_consensus_state RPC endpoint for consensus bugs

Anything else we need to know:

@tessr
Copy link
Contributor

tessr commented Nov 17, 2020

Thanks for this report, and especially for the theory on what's going on. It sounds like we should make sure that that second thread is returning the error all the way back to the client so that it (the client) knows that the transaction was not included in the mempool.

@tessr tessr added C:mempool Component: Mempool T:bug-unconfirmed Type Bug (has been reported but not verified or triaged) labels Nov 17, 2020
@melekes
Copy link
Contributor

melekes commented Nov 18, 2020

#4759 (review)

@melekes
Copy link
Contributor

melekes commented Nov 18, 2020

Closing for #3546

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:mempool Component: Mempool T:bug-unconfirmed Type Bug (has been reported but not verified or triaged)
Projects
None yet
Development

No branches or pull requests

3 participants