-
Notifications
You must be signed in to change notification settings - Fork 1
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
Block processing should use storage atomically #21
Comments
Something like this? Wanted to check if this was the right approach before refactoring everything |
Talked to @tzdybal about this and he mentioned "this can only be visible when a validator process is killed brutally". Removed |
It seems this can also be visible in certain circumstances (high load of node machine and very quick RPC queries) when for example |
A team ran into an issue when using From @tzdybal: We save block information and update height in the code just before saving block responses - and it's not atomic/transactional. because of that status may report a block for which block responses are not yet available. |
## Overview Update height only after block responses are saved. Partially fixes #477 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced testing capabilities for the block publishing process, including validation for successful executions and error handling. - **Bug Fixes** - Improved state management logic during block publication to enhance consistency and error handling. - **Tests** - Added new test cases to ensure the correct behavior of the block publishing method under various scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This was not fixed by rollkit/rollkit#1782. |
Currently
ApplyBlock
,SaveBlock
,Commit
,SaveBlockResponses
andSetHeight
are executed as completely separate operations - this potentially leads to inconsistencies in database.https://github.com/celestiaorg/optimint/blob/b1df4346508c124d59504555f34210773a4e5b50/block/manager.go#L216-L247
https://github.com/celestiaorg/optimint/blob/b1df4346508c124d59504555f34210773a4e5b50/block/manager.go#L392-L433
Ideally all those operations should use single KV batch to ensure atomicity.
Ref: rollkit/rollkit#457, rollkit/rollkit#474
The text was updated successfully, but these errors were encountered: