-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug]: Race condition on app.checkTxState #18844
Comments
Great write up, thanks @nivasan1. So while the AppManager/runtime stuff is being worked on, this should still be addressed for current and future v0.50.x Eden users. I believe your proposal would work. Another proposal I would consider is making the private func (s *state) getContext() sdk.Context {
s.mtx.RLock()
defer s.mtx.RUnlock()
return s.ctx
} And ensure all readers call |
@alexanderbez How would you make runTx / extended usage of the state.ctx synchronized with accesses to getCtx? You would need some form of reference counting, I'd imagine? Maybe I'm misunderstanding tho? |
So you don't need to make |
Is there an existing issue for this?
What happened?
The Issue
internalFinalizeBlock
cosmos-sdk/baseapp/abci.go
Line 760 in 47770f3
CreateQueryContext
cosmos-sdk/baseapp/abci.go
Line 1239 in 47770f3
Proposed Solution
CurrentHeader
field to the baseApp that is wrapped by a mutex to avoid the need for unsynchronized accesses to theapp.checkTxState
.baseApp
ABCI methods are not thead-safe, but all cometBFT ABCI methods are executed synchronously (localAppConn). A different solution could be to make the app-states thread-safe, but this is a much larger lift IMOCosmos SDK Version
v0.50
How to reproduce?
No response
The text was updated successfully, but these errors were encountered: