Skip to content

fix(governance): remove KEY_LAST_CANCELLED_AT from finalize_admin_tra… - #1727

Open
laxjovial wants to merge 1 commit into
LabsCrypt:mainfrom
laxjovial:fix/finalize-admin-transfer-cooldown
Open

fix(governance): remove KEY_LAST_CANCELLED_AT from finalize_admin_tra…#1727
laxjovial wants to merge 1 commit into
LabsCrypt:mainfrom
laxjovial:fix/finalize-admin-transfer-cooldown

Conversation

@laxjovial

Copy link
Copy Markdown

Fix: Remove KEY_LAST_CANCELLED_AT from finalize_admin_transfer

Closes #1664

Problem

multisig_governance::finalize_admin_transfer was setting KEY_LAST_CANCELLED_AT upon successful finalization of an admin transfer. This storage key is used by propose_admin_transfer to enforce a 1-hour cooldown (REPROPOSAL_COOLDOWN_SECONDS) after a proposal is cancelled — preventing spam/repeated failed attempts.

By setting it on successful finalization, a completed transfer was treated the same as a cancellation, locking the new admin out of submitting any governance proposals for 1 hour immediately after taking office.

Root Cause

// BUG: finalization ≠ cancellation
env.storage().instance().set(&KEY_LAST_CANCELLED_AT, &now);

…nsfer

finalize_admin_transfer incorrectly set KEY_LAST_CANCELLED_AT on
successful finalization, treating a completed transfer as a cancellation.
This locked the new admin out of submitting governance proposals for
1 hour (REPROPOSAL_COOLDOWN_SECONDS) immediately after taking office.

Remove the erroneous write so the cooldown is only enforced after
actual cancellations. Add regression test confirming the new admin
can propose immediately after finalization.

Fixes LabsCrypt#1664
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.

[Bug][Contract] multisig_governance::finalize_admin_transfer incorrectly sets KEY_LAST_CANCELLED_AT cooldown

1 participant