Move committedCheckpointId from ChainManager to InMemoryStore - #1264
Merged
Conversation
Remove the duplicated committedCheckpointId field from ChainManager and read it from InMemoryStore instead. The store now seeds its committed checkpoint from the resumed DB state so createBatch and rollback derive the next checkpoint id from a single source.
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR refactors checkpoint state ownership by moving ChangesCheckpoint state ownership refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors checkpoint tracking by moving
committedCheckpointIdfromChainManagertoInMemoryStore, where it logically belongs as part of the in-memory state. This simplifies theChainManagertype and makes checkpoint state management more cohesive.Key Changes
committedCheckpointIdfield fromChainManager.ttypeChainManager.createBatchto acceptcommittedCheckpointIdas a parameter instead of reading from the managerInMemoryStore.make, accepting it as an optional parameter defaulting toInternal.initialCheckpointIdMain.resto initializeInMemoryStorewith the checkpoint ID from persisted stateGlobalState.updateProgressedChains(no longer needed in ChainManager)committedCheckpointIdfromstate.ctx.inMemoryStoreinstead ofstate.chainManagerImplementation Details
InMemoryStore.makenow accepts an optional~committedCheckpointIdparameter, initialized from persisted state during startupChainManager.createBatchnow requirescommittedCheckpointIdas an explicit parameter, making the dependency clear at call sitesInMemoryStore, centralizing state managementhttps://claude.ai/code/session_017aScst99c1b2ETxLY7fyTb
Summary by CodeRabbit