Skip to content

feat(agglayer): RBAC-based access control for bridge roles#3130

Draft
Fumuran wants to merge 2 commits into
nextfrom
fumuran-claude/agglayer-rbac-roles
Draft

feat(agglayer): RBAC-based access control for bridge roles#3130
Fumuran wants to merge 2 commits into
nextfrom
fumuran-claude/agglayer-rbac-roles

Conversation

@Fumuran

@Fumuran Fumuran commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Refactor phase of #2706. Replaces the AggLayer bridge's hard-coded admin / GER-injector / GER-remover account-ID storage slots with the miden-standards access-control stack (Ownable2Step + RoleBasedAccessControl + Authority).

Per the discussion on the issue, this uses RBAC rather than Ownable2Step alone, with a separate governance owner over three subordinate operational roles. Each role-gated bridge procedure now calls authority::assert_authorized, which checks the note sender holds the role mapped to that procedure.

Roles

  • Governance owner (Ownable2Step): top-level authority; grants/revokes roles, two-step transferable.
  • FAUCET_ADMINregister_faucet, store_faucet_metadata_hash
  • GER_INJECTORupdate_ger
  • GER_REMOVERremove_ger

Changes

  • miden-standards: add RoleAssignment + RoleBasedAccessControl::with_roles(...) to seed initial role members at construction; AccessControl::Rbac gains a members field (yields a seeded RBAC instead of empty()).
  • bridge MASM: remove the three account-ID slots and bespoke assert_sender_is_* procs; gate the four privileged procedures via authority::assert_authorized.
  • bridge Rust: AggLayerBridge is now stateless; add BridgeRoleMember, role-symbol + procedure-root accessors, and the fixed procedure→role map. create_bridge_account now takes (seed, owner, Vec<BridgeRoleMember>).
  • build.rs: include the RBAC stack when computing BRIDGE_CODE_COMMITMENT.
  • Update SPEC.md, agglayer integration tests, and bench setups. Add a with_roles-equals-runtime-grant_role equivalence test and a procedure→role map pinning test.

Out of scope (follow-up)

On-chain role-management notes (grant_role / revoke_role / transfer_ownership / accept_ownership) plus their allowlist entries and Rust builders. Roles are seeded and enforced, but rotation is not yet exercisable on-chain — hence this is the refactor phase (Refs #2706, not Closes).

Testing

  • cargo +nightly fmt --all --check and cargo clippy (affected crates, --all-targets): clean.
  • Tests pass: agglayer suite (69), rbac/authority/pausable script tests (42), miden-standards (119).

🤖 Generated with Claude Code

claude added 2 commits June 24, 2026 22:19
Replace the bridge's hard-coded admin / GER-injector / GER-remover account-ID
storage slots with the miden-standards access-control stack (Ownable2Step +
RoleBasedAccessControl + Authority). The role-gated procedures (register_faucet,
store_faucet_metadata_hash, update_ger, remove_ger) now call
authority::assert_authorized, which checks the note sender holds the FAUCET_ADMIN /
GER_INJECTOR / GER_REMOVER role mapped to that procedure. A governance owner can
grant/revoke roles and transfer ownership via Ownable2Step.

- miden-standards: add RoleAssignment + RoleBasedAccessControl::with_roles to seed
  initial role members at construction; AccessControl::Rbac gains a `members` field.
- bridge MASM: drop the three ID slots / bespoke assert_sender_is_* procs; gate the
  four privileged procedures via authority::assert_authorized.
- bridge Rust: add BridgeRoleMember, role-symbol + procedure-root accessors, and the
  fixed procedure->role map; create_bridge_account now takes an owner and a
  Vec<BridgeRoleMember> instead of three bare account IDs.
- build.rs: include the RBAC stack when computing BRIDGE_CODE_COMMITMENT.
- update SPEC.md, agglayer integration tests, and bench setups.

On-chain role-management notes (grant/revoke role, transfer ownership) are a planned
follow-up, so role rotation is not yet exercisable on-chain.

Refs #2706.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants