Skip to content

fix(governance): clear a pending operator proposal on renounce_admin - #537

Merged
usmanimamu17-create merged 2 commits into
ApexChainx:mainfrom
beulah7717108-eng:fix/470-renounce-invalidates-pending
Aug 31, 2026
Merged

fix(governance): clear a pending operator proposal on renounce_admin#537
usmanimamu17-create merged 2 commits into
ApexChainx:mainfrom
beulah7717108-eng:fix/470-renounce-invalidates-pending

Conversation

@beulah7717108-eng

Copy link
Copy Markdown
Contributor

Summary

renounce_admin cleared the admin and pending-admin slots but left a pending operator handoff alive, so a stale candidate could still call accept_operator and install an operator on an adminless contract — authority kept flowing after the irreversible renounce.

This change makes renounce_admin invalidate any pending operator proposal: it clears the pending operator slot and its expiry timestamp and emits an op_can event when one is pending, so no pending proposal can complete a role change after renounce.

Changes

  • governance.rs: renounce_admin now clears PENDING_OP_KEY / PENDING_OP_TS_KEY and emits op_can when a proposal was pending.
  • tests.rs: coverage for the cleared pending slot after renounce and for the blocked stale-accept path.

Tests

cargo test --lib passes the full suite, including the two new tests that pin the invalidation and the blocked acceptance.

Closes #470

renounce_admin cleared the admin and pending-admin slots but left a
pending operator handoff alive, so a stale operator could still call
accept_operator and install an operator on an adminless contract. It now
clears the pending operator slot (and its expiry timestamp) and emits an
op_can event to signal the invalidation, so no pending proposal can
complete a role change after renounce. Adds coverage for the clear and
for the blocked acceptance path.

Closes ApexChainx#470
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@beulah7717108-eng 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

Triggers clippy::len_zero under -D warnings in the Client Checks gate.

@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.

Looks clean, approved.

@usmanimamu17-create
usmanimamu17-create merged commit e2c944e 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

Labels

None yet

Projects

None yet

2 participants