You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(block): use parent state for witness validation - #61
Validate block witness signatures in Manager after selecting the candidate-parent state, for direct application and fork switching.
Defer competing branches and retain up to four normalized signature candidates per block. Preserve the original signature and roll the remaining candidates so a later valid signature can still be used when the block becomes a fork ancestor or is applied directly after rollback.
Return explicit processing results so forwarding, application metrics and peer-failure attribution follow the actual block outcome.
Refresh receive timestamps for deferred broadcast blocks, clear only the restarting peer's pending sync payloads and requests, and share missing-parent/invalid-ancestor classification across both ingress paths.
Preserve KhaosDatabase graph nodes and serialized storage of unprocessed blocks. Retain authenticated capsules only after execution commits.
The database and network changes address one validation problem and must land together: forwarding, retries and peer-failure attribution depend on the result returned by Manager.
Why are these changes required?
After a witness-key rotation or strict-ECDSA activation, validation against the local head can disagree with validation against a block's own parent. The selected parent state must govern witness recovery, permissions and scheduling.
This PR has been tested by:
Focused tests on x86_64 / JDK 8: 141 tests across 11 framework classes covering parent-state validation, activation, fork rollback/recovery, signature overflow, direct application after rollback, storage, broadcast, duplicate metrics and synchronization.
The broadcast and synchronization fifth-signature regression tests fail against the original PR implementation and pass with this fix.
bash .github/scripts/check_math_usage.sh and git diff --check.
Full-suite validation remains incomplete. ARM64 / JDK 17, multi-node convergence and historical replay have not been verified locally.
Follow up
Verify multi-node convergence and historical replay, measure propagation and validation costs, and determine rollout and activation requirements before deployment.
Extra details
Target: release_v4.8.3. This changes consensus-relevant block acceptance around witness-permission updates and strict-ECDSA activation. Existing and updated nodes may disagree on affected blocks. The supported mixed-version window and the node versions requiring a coordinated upgrade have not yet been established; these tests do not establish safe rolling-upgrade or hard-fork compatibility.
No dependency, configuration, protobuf or persistent database schema changes are introduced. The release branch's KhaosDatabase memory and commit lifecycle are preserved.
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 8160bcd7-e3cc-4e79-a272-0e8f907c5daa
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
🔍 Trigger review
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Federico2014
changed the title
fix(block): validate witnesses against candidate-parent state
fix(block): use parent state for witness validation
Oct 23, 2026
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
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.
What does this PR do?
Validate block witness signatures in
Managerafter selecting the candidate-parent state, for direct application and fork switching.The database and network changes address one validation problem and must land together: forwarding, retries and peer-failure attribution depend on the result returned by
Manager.Why are these changes required?
After a witness-key rotation or strict-ECDSA activation, validation against the local head can disagree with validation against a block's own parent. The selected parent state must govern witness recovery, permissions and scheduling.
This PR has been tested by:
./gradlew :framework:checkstyleMain :framework:checkstyleTest :plugins:checkstyleMain --max-workers=2.bash .github/scripts/check_math_usage.shandgit diff --check.Full-suite validation remains incomplete. ARM64 / JDK 17, multi-node convergence and historical replay have not been verified locally.
Follow up
Verify multi-node convergence and historical replay, measure propagation and validation costs, and determine rollout and activation requirements before deployment.
Extra details
Target:
release_v4.8.3. This changes consensus-relevant block acceptance around witness-permission updates and strict-ECDSA activation. Existing and updated nodes may disagree on affected blocks. The supported mixed-version window and the node versions requiring a coordinated upgrade have not yet been established; these tests do not establish safe rolling-upgrade or hard-fork compatibility.No dependency, configuration, protobuf or persistent database schema changes are introduced. The release branch's KhaosDatabase memory and commit lifecycle are preserved.