Skip to content

serviceability: authorize governance instructions via Permission accounts#3977

Open
juan-malbeclabs wants to merge 2 commits into
mainfrom
perm-governance
Open

serviceability: authorize governance instructions via Permission accounts#3977
juan-malbeclabs wants to merge 2 commits into
mainfrom
perm-governance

Conversation

@juan-malbeclabs

@juan-malbeclabs juan-malbeclabs commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate the governance admin instructions to the authorize() Permission-account system (see smartcontract/programs/doublezero-serviceability/PERMISSION.md), gated on the GLOBALSTATE_ADMIN flag:

  • GlobalState: SetAuthority, SetAirdrop, SetFeatureFlags, SetVersion
  • GlobalConfig: SetGlobalConfig
  • Foundation and QA allowlist add/remove

Behavior is preserved: while RequirePermissionAccounts is off, the legacy foundation-allowlist check still authorizes; Permission-account holders with GLOBALSTATE_ADMIN are additionally accepted. Also corrects the stale legacy-mapping table in PERMISSION.md to match check_legacy_any().

Part of the incremental rollout of the Permission system across serviceability (one PR per domain).

Testing Verification

  • New permission-account tests exercising the GLOBALSTATE_ADMIN path across the three account layouts (fixed, allowlist-mutating, and the 10-account SetGlobalConfig), plus the existing foundation/non-foundation regression tests.
  • cargo test -p doublezero-serviceability, cargo test -p doublezero_sdk, and make rust-lint pass.

Permission migration series

One of 8 per-domain PRs migrating serviceability instructions to the Permission (authorize()) system. The branches partition the change set with no overlap and can be reviewed and merged independently (only the CHANGELOG entry conflicts trivially).

PR Domain Flag(s)
#3977 Governance (globalstate/globalconfig/allowlists) GLOBALSTATE_ADMIN ← this PR
#3978 Contributor CONTRIBUTOR_ADMIN
#3979 Infra (location/exchange) INFRA_ADMIN
#3980 Devices + interfaces NETWORK_ADMIN, HEALTH_ORACLE
#3981 Links NETWORK_ADMIN, HEALTH_ORACLE
#3982 Multicast MULTICAST_ADMIN, ACCESS_PASS_ADMIN
#3983 Tenant TENANT_ADMIN
#3984 User (update / check_access_pass / check_status) USER_ADMIN, ACTIVATOR

…unts

Migrate GlobalState (setauthority/setairdrop/setfeatureflags/setversion),
GlobalConfig, and foundation/QA allowlist admin instructions to authorize()
with the GLOBALSTATE_ADMIN flag. Behavior is preserved via the legacy
foundation-allowlist fallback; Permission-account holders are additionally
authorized. Correct the stale legacy-mapping table in PERMISSION.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant