A stale roles{} anchor now refuses instead of silently snapshotting the replaced contract, with REANCHOR=true as the explicit opt-in. - #24
Merged
Conversation
…he replaced contract, with REANCHOR=true as the explicit opt-in.
|
👋 aelmanaa, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
SyedAsadKazmi
approved these changes
Aug 17, 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
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.
This pull request introduces support for a new
REANCHORflag to thesnapshot-chainprocess, clarifies its usage throughout the documentation, and improves the handling and testing of roles anchor drift scenarios. The main goal is to ensure that after a redeploy or repoint, explicit operator action is required to move the roles anchor, preventing accidental or silent changes to critical configuration. Several code and documentation updates reinforce this behavior, improve testability, and make the process more robust and transparent.Enhancements to roles anchor handling and snapshot-chain behavior:
Makefilenow supports aREANCHORenvironment variable forsnapshot-chain, allowing explicit re-anchoring of roles after a repoint. This is reflected in both the command and its help text. [1] [2] [3]RolesSnapshot.solis updated to enforce that a stale anchor refuses to resolve unlessREANCHOR=trueis set, preventing accidental overwrites and requiring explicit operator intent for anchor movement. The logic is also clarified and better documented. [1] [2]Documentation updates for clarity and operator guidance:
roles.md,config-schema.md,deployed-addresses.md) is updated to explain the refusal behavior ofsnapshot-chainin the presence of anchor drift, and to document the correct use ofREANCHOR=truefor deliberate re-anchoring. [1] [2] [3]REANCHOR=true.Testing and warning improvements:
VerifyChain.s.solscript now tracks the last warning message in addition to counts, allowing unit tests to assert exactly which warning fired. It also resets warning/fail state between tests for isolation and clarity. [1] [2] [3]Minor codebase cleanups:
RegistryWriterinRolesSnapshot.sol) are removed for clarity.These changes collectively make the roles anchoring process more robust, explicit, and testable, and provide clearer guidance to operators and contributors.