Repository navigation
feat(revenue-pool): timelocked propose/execute/cancel upgrade - #1434
abiolatousin-design wants to merge 3 commits into
Conversation
|
@abiolatousin-design 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! 🚀 |
b001731 to
ba56a58
Compare
|
@abiolatousin-design Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
Removes the .vscode task and the .lfk loader this branch picked up (delete .vscode/extensions.json, delete .vscode/launch.json, delete .vscode/settings.json, delete .vscode/spellright.dict, delete .vscode/tasks.json, delete public/fonts/fa-solid.lfk). No functional change to the branch's own work.
|
@abiolatousin-design Our automated scan matched code from the PolinRider malware campaign, which steals developer credentials (GitHub, npm, wallets) and spreads through infected repositories:
What to do:
The PR will be re-scanned automatically and can be merged once it is clean. |
|
This PR came from a machine infected with the PolinRider malware. We stripped the malware files, but the code itself also contains corrupted changes (random character mutations / sabotage), so it cannot be merged. Found in |
Overview
This PR puts
RevenuePool::upgradebehind a propose/execute/cancel timelock, mirroring the pattern already used bypropose_emergency_drain/execute_emergency_drain/cancel_emergency_drainin the same crate and bycontracts/settlement/src/timelock.rs. The legacyupgradeentrypoint becomes an alias forpropose_upgrade, so existing tooling can no longer swap the pool's WASM in a single admin-signed call. The storage-migration gate is also reworked to use a real layout hash instead ofzero_layout_hash, and the migration finalization moves to a post-swapmigrateentrypoint.Related Issue
Changes
🔒 Timelocked Upgrade Flow
[MODIFY]
contracts/revenue_pool/src/errors.rs[MODIFY]
contracts/revenue_pool/src/events.rsupgrade_proposed,upgrade_executed, andupgrade_cancelledevent emissions, following the existing emergency-drain event shape.[MODIFY]
contracts/revenue_pool/src/test_storage_migration.rsrecord_deployed_schemawhen absent, and a mismatched fixture surfacesSchemaMismatchinstead of silently passing on a zero hash.📚 Docs
docs/EVENT_SCHEMA.mdupgrade_proposed/upgrade_executed/upgrade_cancelledevents and their payloads.Verification Results
execute_afterreturns a timelock errorexpires_atreturns expired errorUnauthorizedupgrade()only proposes; WASM unchangedmainswaps in one call, this PR does notSchemaMismatchtest_storage_migration.rsCC5KINWRSLKSSQG4ZOTP3EZIOUVC6ER7HL5GZALYY4LVE6ZIMX4PMCSEdocs/EVENT_SCHEMA.mdupdatedUpgrade Order for the Deployed Pool
The deployed pool
CC5KINWRSLKSSQG4ZOTP3EZIOUVC6ER7HL5GZALYY4LVE6ZIMX4PMCSEmust be migrated in this order:propose_upgrade(admin, new_wasm_hash)on the current contract. This only stores the pending proposal and emitsupgrade_proposed; the WASM is unchanged.execute_after(the timelock window) and callexecute_upgrade(admin)beforeexpires_at. This swaps the WASM.migrateon the new code to runfinalize_migrationagainst the recorded layout hash.Cancellation via
cancel_upgrade(admin)is available at any point before execution, including while emergency-paused.Size Delta
WASM size delta for
callora-revenue-poolis reported in the CI build step and is within the 3% budget required by the issue.Closes #1402