-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix: prevent updating check state before mempool insert #25550
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #25550 +/- ##
=======================================
Coverage 68.23% 68.23%
=======================================
Files 894 894
Lines 58149 58159 +10
=======================================
+ Hits 39676 39685 +9
- Misses 18473 18474 +1
🚀 New features to boost your workflow:
|
|
@beer-1 lint failing |
|
@aljo242 fixed! |
|
@beer-1 do you see any potential for performance overhead due to this? |
I don't think this introduce any performance degradation because it is just changing order of execution |
|
comment to prevent stale closing |
| } | ||
|
|
||
| if mode == execModeCheck { | ||
| mempoolCtx = ctx.WithMultiStore(msCache) |
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.
confirming my understanding here, we need to set the multistore for mempoolCtx back to to msCache since we are now not writing msCache before calling mempool.Insert when in modeCheck. So if we do not use msCache as our multistore, mmempool.Insert may operate on a stale multistore. Once we do call commitAnteCache though, we are safe to use ctx again since its ms has now been updated.
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.
I modified the mempool.Insert call locally to use ctx instead of mempoolCtx and all of our unit tests still passed. Could you think of a unit test that would demonstrate this ms requirement? imo its not super clear from this logic that that is required (would probably be easiest with a mock mempool and ante handler just checking values in the ms).
Description
Closes: #25543