feat(admin): add emergency upgrade bypass - #846
Open
Hikmaholadele wants to merge 9 commits into
Open
Conversation
|
@Hikmaholadele 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! 🚀 |
Contributor
|
@Hikmaholadele please fix CI |
Hikmaholadele
added a commit
to Hikmaholadele/bc-forge
that referenced
this pull request
Aug 27, 2026
Resolve merge conflicts from PR BCPathway#846: - lib.rs: keep both emergency_execute_upgrade (ours) and register_wasm_hash/ require_valid_wasm_hash (main) with no code changes to either - 581 snapshot files: accept main's versions (regenerable fuzz data, upstream is canonical) - Emergency upgrade test snapshots (6 files) and upgrade_e2e.rs preserved from feature branch 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Contributor
|
@Hikmaholadele please fix CI and resolve conflicts |
Add `withdraw`, which burns wrapped shares and returns a pro-rata share of the vault's underlying assets (principal + accrued yield): tokens_out = shares * total_assets / total_shares Payouts round down to favor the protocol and revert if they round to zero. Withdrawals are guarded by the existing reentrancy lock, paused state, and share-balance checks. Emits a `withdrw` event. Adds unit tests covering happy paths (partial/full/multi-user withdrawals, yield compounding, rounding) and error states (zero, negative, insufficient shares, paused, uninitialized, dust payout), regenerates stale wrapper snapshots, and exposes `withdraw` on the TypeScript WrapperClient. Closes BCPathway#721 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
BCPathway#730) Adds the require_unlocked modifier to the vault (wrapper) contract. The guard checks env.ledger().timestamp() against the user's recorded unlock time and reverts with WrapperError::TokensLocked while the deposit is still locked, and is wired into withdraw so locked deposits cannot be exited early. New admin-gated entry points set_unlock_time/clear_unlock_time record and remove the per-user deposit lockup, and get_unlock_time exposes the stored unlock timestamp. Lockup state is stored per-user in persistent storage under DataKey::UnlockTime(Address). Unit tests cover the happy paths (withdrawal at and after the unlock time) and error states (locked revert, per-user isolation, non-admin rejection, uninitialized contract). 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
…t after main merge Merging main into the unlocked-modifier branch duplicated the `withdraw` entry point (main's copy plus the branch's copy with the BCPathway#730 require_unlocked guard) and gave ZeroShares the same discriminant as TokensLocked, which broke compilation. Keep the lockup-guarded withdraw, drop the duplicate, and renumber ZeroShares to 12. Also commit the snapshot files for the share-price, supply, and pauser tests that arrived with the merge. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Allows the proposer of a multi-sig UpgradeProposal to withdraw it before execution. The proposal is marked ProposalStatus::Cancelled rather than deleted, preserving its history. Reverts with ProposalAlreadyExecuted if already executed, NotProposer if called by anyone other than the original proposer, and ProposalNotCancellable if already Cancelled or Expired. Resolves BCPathway#662
Add --estimate option to the upgrade command that uses Soroban simulateTransaction to calculate gas and estimate total fee cost without submitting on-chain. Returns base fee, resource fee, and total fee in stroops.
Adds integration tests exercising the full multi-sig gated WASM upgrade lifecycle: deploy, register a new WASM hash as a valid upgrade target, submit a proposal, gather approvals to reach quorum, and drive execute_upgrade through every governance gate (pool membership, quorum, mandatory timelock) up to WASM installation. Fills a coverage gap: the execute_upgrade error paths (QuorumNotMet, TimelockActive, UnauthorizedRole, ProposalNotFound, ProposalAlreadyExecuted) had no dedicated tests before. Resolves BCPathway#672
- Add gitignore exception for testdata/*.wasm so the test fixture contract.wasm is tracked (previously excluded by *.wasm rule) - Commit contract.wasm test fixture required by upgrade_e2e.rs tests - Update Soroban auth snapshots to reflect RoleMask storage layout introduced by the main merge This resolves three CI compilation errors: 1. E0425: emergency_execute_upgrade not found in module super 2. couldn't read contracts/admin/testdata/contract.wasm 3. E0425: emergency_execute_upgrade not found in crate bc_forge_admin The emergency_execute_upgrade implementation itself was correctly preserved through the merge; the failures were caused by the missing WASM fixture and stale auth snapshots. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
Hikmaholadele
force-pushed
the
feat/682-emergency-upgrade-bypass
branch
from
August 27, 2026 12:08
1998250 to
89e0873
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #682
Summary
Closes #682