-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
mempool: introduce KeepInvalidTxsInCache config option #5813
Conversation
If set to true, an invalid transaction will be kept in cache in order to avoid processing it again. see #5751 Signed-off-by: p4u <pau@dabax.net>
Codecov Report
@@ Coverage Diff @@
## master #5813 +/- ##
==========================================
+ Coverage 59.93% 60.01% +0.07%
==========================================
Files 262 262
Lines 23704 23705 +1
==========================================
+ Hits 14207 14226 +19
+ Misses 7992 7973 -19
- Partials 1505 1506 +1
|
@melekes what's the reason behind removing the cache transactions if the mempool is full? Wouldn't it be a better approach to keep them so invalid transactions won't occupy a slot that could be used by a valid transaction? |
If the mempool is full and a good tx comes in, it will be added to cache. But if, by the time ABCI application responds with CheckTx (Code: 0 - valid tx), the mempool becomes full, we want to remove tx from the cache so it can be readded. Otherwise, there's a "deadlock" of sort where a user got successful response (meaning CheckTx succeeded, but 1) it was not committed 2) he/she can't add it because cache already contains this tx). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ok, makes sense. |
Thanks for the work! |
When set to true, an invalid transaction will be kept in the cache (this may help some applications to protect against spam). NOTE: this is a temporary config option. The more correct solution would be to add a TTL to each transaction (i.e. CheckTx may return a TTL in ResponseCheckTx). Closes: #5751
When set to true, an invalid transaction will be kept in the cache (this may help some applications to protect against spam). NOTE: this is a temporary config option. The more correct solution would be to add a TTL to each transaction (i.e. CheckTx may return a TTL in ResponseCheckTx). Closes: #5751
When set to true, an invalid transaction will be kept in the cache (this may help some applications to protect against spam). NOTE: this is a temporary config option. The more correct solution would be to add a TTL to each transaction (i.e. CheckTx may return a TTL in ResponseCheckTx). Closes: #5751
Does this fixes issue on cosmos/cosmos-sdk#4695? |
not really since tx1 and tx2 are different (if I understood the issue you've linked correctly) |
@melekes - all different transactions. |
When set to
true
, an invalid transaction will be kept in the cache (this may help some applications to protect against spam).NOTE: this is a temporary config option. The more correct solution would be to add a TTL to each transaction (i.e. CheckTx may return a TTL in ResponseCheckTx).
Closes: #5751