feat(unwind): add unwind operation for sdk&greth#631
Open
AshinGau wants to merge 1 commit intoGalxe:mainfrom
Open
feat(unwind): add unwind operation for sdk&greth#631AshinGau wants to merge 1 commit intoGalxe:mainfrom
AshinGau wants to merge 1 commit intoGalxe:mainfrom
Conversation
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.
PR Description
feat(unwind): add unwind operation for SDK & gReth
This PR implements database unwind (rollback) support for both the execution layer (gReth) and the consensus layer (gravity-sdk), enabling operators to revert the node to a specific block height.
Execution Layer (gravity_node)
stage unwindCLI command by adding theCommands::Stagebranch incli.rs.is_node_command()check inmain.rsso utility subcommands (stage, db, config, etc.) bypass full node initialization (consensus, relayer), which would otherwise panic on missing config.Consensus Layer (gravity_cli)
ConsensusDB::unwind_to_block(target)which atomically deletes all blocks, QCs, ledger infos, epoch mappings, randomness, and stale vote/timeout certificates above the target block number.gravity-cli unwindsubcommand to invoke it.RecoveryData::find_root_by_block_numberto gracefully handle missing committing QCs after an unwind by falling back to the storage ledger info, preventing "No LI found for root" panics on restart.