Skip to content

Live chain testing - #18

Merged
stefanobotticelli merged 2 commits into
mainfrom
live-chain-testing
Sep 20, 2026
Merged

stefanobotticelli merged 2 commits into
mainfrom
live-chain-testing

Conversation

@kalrashivam

Copy link
Copy Markdown
Collaborator

Fixes the exit-floor bug found on the live Arbitrum vault and unblocks the deploy scripts for a new launch, plus adds the migration/maintenance tooling to correct the already-deployed vault in place.

  • Exit floor removed: GlobalConfig's default minClaimAmount was 100 USDC, so instant and epoch withdrawal requests below that were rejected — residual balances under 100 USDC were permanently stuck. Default is now 0; minDepositAmount remains the separate, unaffected deposit gate.
  • Per-vault queue/cap overrides: added setDefaultQueue/setVaultQueueOverride and setVaultDynamicCapOverride to GlobalConfig so a launch vault gets epoch duration and instant-withdrawal cap parameters scaled to its real cap instead of inheriting the 10M-USDC defaults.
  • Silent failure visibility: BufferManager and StrategyRouter had empty catch {} blocks on adapter/strategy calls (buffer withdraw/deposit, NAV reads during rebalance/redeem). Replaced with AdapterCallFailed/ExternalCallFailed events carrying the revert reason, so these failures are observable instead of disappearing.
  • FixedMaturity selector routing fix: SelectorLib/SelectorRegistry only routed 14 of 17 IFixedMaturityModule functions through CoreVault; the 9 missing ones (fundingDeadlineTs, maturityTs, minFundingAssets, fixedTermStrategy, netFundedAssets, isFundingSuccessful, isFundingTargetReached, isInstantExitOpen, finalPerformanceFeeStatus) are exactly what FixedMaturityVaultUpkeep calls through the vault proxy — the keeper was non-functional on any real FM deployment.
  • Deploy script fixes: foundry.toml had no fs_permissions write access, so _writeAddressBook() reverted at the end of every deploy run; DeployFixedMaturityVault.s.sol was missing a vault approval before seedDeadDeposit(); 5 standalone scripts brought onto ChainConfig for consistency; DeployCoreSystem.s.sol now sets explicit per-vault deposit caps and dynamic-cap overrides at deploy time with deploy-time invariant checks (deposit caps, dynamic-cap threshold, epoch duration).
  • Arbitrum migration tooling: new scripts (RedeployGlobalConfig, ConfigureWithdrawalPolicy, RunArbitrumMaintenance, SetMinClaimAmount, WithdrawDeployerShares, GlobalConfigMigration helper, DeployRootTimelock) plus receipts tooling and docs to correct the exit floor on the live vault without redeploying modules.
  • Tests/docs: added GlobalConfigMigration/GlobalConfigQueue unit tests, an adapter-isolation fork test, Hardening_MissingTests additions, and updated docs/deployment.md.

shivam kalra and others added 2 commits August 21, 2026 19:46
SelectorLib.getFixedMaturityModuleSelectors() only routed 14 of
IFixedMaturityModule's 17 functions through CoreVault. The 9 missing
selectors (fundingDeadlineTs, maturityTs, minFundingAssets,
fixedTermStrategy, netFundedAssets, isFundingSuccessful,
isFundingTargetReached, isInstantExitOpen, finalPerformanceFeeStatus)
are exactly what FixedMaturityVaultUpkeep calls through the vault proxy
to drive the FM lifecycle -- the keeper was non-functional on any real
FM deployment. Add the same entries to SelectorRegistry.sol, the
independently-hardcoded guardrail copy that had drifted out of sync.

Also fixes two deploy-script blockers found by dry-running both flows
against a live Arbitrum fork:
- foundry.toml had no fs_permissions write access anywhere, so
  _writeAddressBook()'s vm.writeJson() reverted at the last line of
  every script, OE and FM alike. Grant read-write on ./broadcast.
- DeployFixedMaturityVault.s.sol's _seedDeadDeposit() never approved
  the vault before calling seedDeadDeposit(), unlike the OE script.

Bring the remaining 5 standalone deploy scripts (DeployBufferManager,
DeployFixedMaturityVaultUpkeep, DeployQueueModule, DeployStrategyRouter,
DeployVaultUpkeep) onto ChainConfig for consistency with the rest of
script/ merged in 041710c.

Verified: both DeployCoreSystem and DeployFixedMaturityVault reach
SIMULATION COMPLETE against a live Arbitrum fork with zero reverts;
full 946-test suite green.
…bitrum migration tooling

- Zero out GlobalConfig's default minClaimAmount (was 100e6) so instant and
  epoch withdrawal requests no longer strand residual balances behind an
  exit floor; minDepositAmount remains the separate, unaffected deposit gate.
- Add setDefaultQueue/setVaultQueueOverride and setVaultDynamicCapOverride
  so a launch vault can get epoch duration and instant-withdrawal cap
  parameters scaled to its real launch cap instead of inheriting the
  10M-USDC defaults.
- Replace swallowed catch {} blocks in BufferManager and StrategyRouter
  with AdapterCallFailed/ExternalCallFailed events that carry the revert
  reason, for adapter/strategy call failures during withdraw and rebalance.
- Wire the new overrides into DeployCoreSystem.s.sol with deploy-time
  invariant checks (deposit caps, dynamic-cap threshold, epoch duration).
- Add Arbitrum GlobalConfig migration/maintenance scripts
  (RedeployGlobalConfig, ConfigureWithdrawalPolicy, RunArbitrumMaintenance,
  SetMinClaimAmount, WithdrawDeployerShares, GlobalConfigMigration helper,
  DeployRootTimelock) plus receipts tooling and docs to correct the exit
  floor on the already-deployed vault without redeploying modules.
- Cover the new config paths with GlobalConfigMigration/GlobalConfigQueue
  unit tests, an adapter-isolation fork test, and Hardening_MissingTests
  additions; update docs/deployment.md to match.
@stefanobotticelli
stefanobotticelli merged commit 574da4c into main Sep 20, 2026
1 check passed
@kalrashivam
kalrashivam deleted the live-chain-testing branch September 21, 2026 21:32
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.

2 participants