Skip to content

## operator transfer paths and add audit-trail tests - #547

Merged
usmanimamu17-create merged 4 commits into
ApexChainx:mainfrom
akargi:feat/DevBranch
Aug 31, 2026
Merged

## operator transfer paths and add audit-trail tests#547
usmanimamu17-create merged 4 commits into
ApexChainx:mainfrom
akargi:feat/DevBranch

Conversation

@akargi

@akargi akargi commented Aug 31, 2026

Copy link
Copy Markdown

Closes #471

Description

Brief description of the changes in this PR.

Type of Change

Related Issues

Fixes #(issue number) or relates to #(issue number)
Closes #480

Changes Made

Testing

Describe the testing performed to validate these changes:

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented complex logic
  • I have updated relevant documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My changes do not introduce new warnings

Screenshots (if applicable)

Add screenshots or logs if applicable.
Closes #485

memplethee-lab and others added 4 commits August 31, 2026 01:29
…_operator lets an admin bypass the canonical two-step protocol silently
### Problem
`set_operator` (single-step, admin-only, no new operator consent) and the two-step `propose_operator`/`accept_operator` handoff coexisted without documentation explaining when each is appropriate. Consumers couldn't distinguish consented from non-consented operator changes from the event stream, and no tests covered the interaction between the two paths.

### Changes

**Documentation**
- Added module-level docs in `governance.rs` explaining both operator transfer paths: consent semantics, event trails, intended use, and security implications
- Updated `set_operator` function docs with detailed sections on consent, break-glass use, pending-slot interaction, and gating
- Updated `propose_operator`/`accept_operator` docs to clearly identify them as the canonical two-step path
- Updated `op_set` event schema in `event_schema.rs` to note the new operator did not consent, and that consumers can distinguish paths by event name
- Updated public API doc comments in `lib.rs` for consistency

**Tests** (5 new)
- `test_set_operator_emits_only_op_set_event` — single-step emits `op_set`, not `op_prop`/`op_acc`
- `test_two_step_operator_emits_op_prop_and_op_acc` — two-step emits `op_prop`+`op_acc`, not `op_set`
- `test_set_operator_does_not_clear_pending_operator_slot` — pending proposals survive `set_operator`
- `test_set_operator_does_not_require_new_operator_consent` — documents admin-only auth
- `test_set_operator_after_propose_does_not_invalidate_proposal` — mixed-path event trail

### Verification
- `cargo test --lib`: 598 passed, 0 failed
- `cargo clippy --lib -- -D warnings`: clean
- `cargo fmt --check`: clean

### Out of scope
Removing `set_operator` (ABI change, companion issue) or altering its semantics to require new operator auth.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@akargi 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! 🚀

Learn more about application limits

@usmanimamu17-create usmanimamu17-create left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@usmanimamu17-create
usmanimamu17-create merged commit 32607d9 into ApexChainx:main Aug 31, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment