-
Notifications
You must be signed in to change notification settings - Fork 38
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
statedb revert to snapshot for ignored batches #1742
Conversation
WalkthroughThe changes involve an update to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- go/enclave/components/batch_executor.go (2 hunks)
Additional comments: 3
go/enclave/components/batch_executor.go (3)
175-175: The assignment of
snap
fromstateDB.Snapshot()
has been modified to use short variable declaration (:=
). This is a standard Go idiom for variable declaration and initialization, and it is correctly used here.225-228: The addition of the conditional block to revert the stateDB to a previous snapshot is a critical change. It's important to ensure that the snapshot ID (
snap
) is correctly managed and that theRevertToSnapshot
method is called appropriately. The conditionif snap > 0
suggests that a snapshot ID greater than 0 is considered valid. This logic assumes thatSnapshot()
method never returns a non-positive value for a valid snapshot, which should be verified.222-231: > Note: This review was outside the patches, so it was mapped to the patch with the greatest overlap. Original lines [1-374]
The rest of the
batch_executor.go
file should be reviewed to ensure that the changes integrate well with the existing code and do not introduce any regressions or new issues. This includes checking for proper error handling, concurrency issues with the new snapshot logic, and ensuring that the snapshot ID is managed consistently throughout the code.
This is broken - copyBatch.Header.Root = stateDB.IntermediateRoot(false) will finalize the journal which is used to revert and thus the call will panic. |
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- go/enclave/components/batch_executor.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- go/enclave/components/batch_executor.go
@StefanIliev545 , pls have a look now |
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
Why this change is needed
What changes were made as part of this PR
PR checks pre-merging
Please indicate below by ticking the checkbox that you have read and performed the required
PR checks