-
Notifications
You must be signed in to change notification settings - Fork 3
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]: Could not create state node #845
Comments
Hi, @mvandeberg , sorry for leaving comment here without your agreement and respecting the team rule. Because I wanna contribute to koinos team's development and join your team, so I am going to solve issues. So could you give me some issue to be solved quickly as test task? |
This is a good beginner task: #676 |
#845: Return unknown previous block when the parent node is not final…
sure, I will do it |
Is there an existing issue for this?
Current behavior
Occasionally chain will log that it could not create new state node.
While working on p2p, I found that this message was being logged when a child block was attempting to be applied while the parent block is being applied. This leads to a race condition that can result in timeouts within p2p. The race condition is not good in chain either.
When the parent block is being finalized, we release all locks and request a unique lock in order to bump head block, fork heads, and LIB atomically. When creating a new state node, state db waits for the parent node to be finalized, holding a lock while it does. Thankfully, creating a state node does use an internal timeout otherwise this would result in a complete deadlock of the node.
Expected behavior
We should detect this condition and return a meaningful error. I suggest
unknown_previous_block
for two reasons.Steps to reproduce
No response
Environment
- OS:
Anything else?
No response
The text was updated successfully, but these errors were encountered: