fix: No recovery path if VWAP bootstrap fails mid-sequence (#644)

Add recovery procedure documentation and automated recovery script for
when the VWAP bootstrap fails partway through (e.g. second recenter
reverts due to insufficient price movement).

- Add "Recovery from failed mid-sequence bootstrap" section to
  docs/mainnet-bootstrap.md with diagnosis steps and manual recovery
- Create scripts/recover-bootstrap.sh to automate diagnosis and retry
- Add warning comments in BootstrapVWAPPhase2.s.sol, DeployBase.sol,
  and bootstrap-common.sh referencing the recovery procedure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-19 22:24:05 +00:00
parent 9cfffa5cea
commit fbe8384342
5 changed files with 291 additions and 0 deletions

View file

@ -121,6 +121,9 @@ fund_liquidity_manager() {
bootstrap_vwap() {
detect_swap_router
# WARNING: If the second recenter() below fails mid-sequence, the LM is left
# with positions deployed but cumulativeVolume == 0 (partial bootstrap).
# For mainnet recovery see docs/mainnet-bootstrap.md or scripts/recover-bootstrap.sh.
# Idempotency guard: if a previous run already bootstrapped VWAP, skip.
local cumvol
cumvol="$(cast call --rpc-url "$ANVIL_RPC" \