feat(store): rollback --store flag to to include block store in rollback#1137
Conversation
WalkthroughThe rollback command now includes an optional Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant RollbackState
participant BlockStore
User->>CLI: Run rollback command [--store]
CLI->>RollbackState: Call with rollbackStore flag
alt rollbackStore is true
RollbackState->>BlockStore: DeleteBlock for each block above new state height
BlockStore-->>RollbackState: Block(s) deleted
end
RollbackState-->>CLI: Return rolled-back height and app hash
CLI-->>User: Output result
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (1.64.8)Error: you are using a configuration file for golangci-lint v2 with golangci-lint v1: please use golangci-lint v2 ✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
cmd/tenderdash/commands/rollback_test.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: test_apps
- GitHub Check: test_abci_cli
- GitHub Check: tests (01)
- GitHub Check: e2e-test (rotate)
- GitHub Check: golangci-lint
- GitHub Check: e2e-test (dashcore)
Issue being fixed or feature implemented
This change introduces a new store flag to the rollback command, allowing users to optionally roll back the block store to match the state height after a rollback operation. This feature is required to ensure consistency between the block store and state during recovery scenarios.
What was done?
Updated the rollback command to include the store flag.
Modified the RollbackState function to conditionally roll back the block store based on the flag.
Added documentation for the store flag in the command description.
How Has This Been Tested?
Breaking Changes
None
Checklist:
For repository code-owners and collaborators only
Summary by CodeRabbit
New Features
Bug Fixes