feat: add mainnet role validation script for attestation contract - #751
Open
lauferuqquyah wants to merge 1 commit into
Open
feat: add mainnet role validation script for attestation contract#751lauferuqquyah wants to merge 1 commit into
lauferuqquyah wants to merge 1 commit into
Conversation
|
@lauferuqquyah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Adds a post-deployment validation script for the attestation contract that
asserts privileged roles and governance bindings are set, so an ownerless or
half-configured contract cannot silently go live on mainnet.
Closes #448.
What changed
scripts/validate_mainnet_roles.sh— queries a deployed contract viastellar contract invokeand runs five checks, printing a consolidatedreport and exiting non-zero if any binding is missing.
scripts/test_validate_mainnet_roles.sh— offline test suite that stubsthe
stellarCLI and drives each check through its pass and fail paths.Checks performed
ROLE_*constant fromaccess_control.rsand confirms the validator accounts for each, so a newly added role can't
slip through unchecked.
get_admin()returns a real, non-null address.get_admin_quorum_weight()is greater than zero.get_multisig_owners()is non-empty and1 <= get_multisig_threshold() <= owner count.get_pending_dao_rotation()is None (no dangling rotationon a fresh deploy).
Any failure exits non-zero, suitable for gating a deployment pipeline.
Known limitation
The contract exposes no read-only getter for the active DAO controller
address (only
set_dao, the rotation methods, andget_pending_dao_rotation). The script therefore cannot assert the activeDAO address directly; it validates the absence of a pending rotation and
documents this gap. Fully closing it would require exposing a
get_dao()view on the contract.
Testing
bash scripts/test_validate_mainnet_roles.shruns entirely offline (thestellarCLI is replaced by a stub) and exercises all five checks plus eachfailure path: null/malformed admin, zero quorum, empty multisig, threshold
exceeding owner count, and a pending DAO rotation. All 12 assertions pass.
closes#448