From 79a2e2ee5e0ada5b4416555355ab1bad4fa8619b Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 20 Mar 2026 09:48:00 +0000 Subject: [PATCH 1/4] fix: deployments-local.json committed to repo (#589) - Add onchain/deployments-local.json to .gitignore so it is no longer tracked - Remove the stale committed file from git - Update fitness.sh to read LM address from forge broadcast JSON (DeployLocal.sol's run-latest.json) instead of the potentially stale deployments-local.json, matching the approach deploy-optimizer.sh already uses Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 3 +++ onchain/deployments-local.json | 8 -------- tools/push3-evolution/fitness.sh | 29 ++++++++++++++++++----------- 3 files changed, 21 insertions(+), 19 deletions(-) delete mode 100644 onchain/deployments-local.json diff --git a/.gitignore b/.gitignore index 5fece8b..ad9e774 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ logs/ # Holdout scenarios (cloned at runtime by evaluate.sh) .holdout-scenarios/ + +# Local deployment addresses (generated per-run by bootstrap scripts) +onchain/deployments-local.json diff --git a/onchain/deployments-local.json b/onchain/deployments-local.json deleted file mode 100644 index 0868236..0000000 --- a/onchain/deployments-local.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "contracts": { - "Kraiken": "0xff196f1e3a895404d073b8611252cf97388773a7", - "Stake": "0xc36e784e1dff616bdae4eac7b310f0934faf04a4", - "LiquidityManager": "0x33d10f2449ffede92b43d4fba562f132ba6a766a", - "OptimizerProxy": "0x1cf34658e7df9a46ad61486d007a8d62aec9891e" - } -} diff --git a/tools/push3-evolution/fitness.sh b/tools/push3-evolution/fitness.sh index be5a3c0..3b1b083 100755 --- a/tools/push3-evolution/fitness.sh +++ b/tools/push3-evolution/fitness.sh @@ -178,22 +178,29 @@ fi log "Optimizer deployed and upgraded" # ============================================================================= -# Step 4 — Read deployment addresses +# Step 4 — Read deployment addresses from broadcast JSON # -# DeployLocal.sol writes deterministic addresses to deployments-local.json when -# run against a fresh Anvil + standard mnemonic. +# deploy-optimizer.sh runs DeployLocal.sol which writes a broadcast JSON file. +# We read contract addresses from there rather than relying on a potentially +# stale committed deployments-local.json. # ============================================================================= -DEPLOYMENTS="$ONCHAIN_DIR/deployments-local.json" -[ -f "$DEPLOYMENTS" ] || fail2 "deployments-local.json not found — did DeployLocal.sol run?" +CHAIN_ID="$(cast chain-id --rpc-url "$RPC_URL")" +BROADCAST_JSON="$ONCHAIN_DIR/broadcast/DeployLocal.sol/$CHAIN_ID/run-latest.json" +[ -f "$BROADCAST_JSON" ] || fail2 "Broadcast JSON not found at $BROADCAST_JSON — did DeployLocal.sol run?" -LM_ADDR=$(python3 -c " -import json -d = json.load(open('$DEPLOYMENTS')) -print(d['contracts']['LiquidityManager']) -" 2>/dev/null) || fail2 "Failed to read LiquidityManager from deployments-local.json" +LM_ADDR="$(python3 - "$BROADCAST_JSON" <<'PYEOF' +import json, sys +with open(sys.argv[1]) as f: + data = json.load(f) +for tx in data.get('transactions', []): + if (tx.get('contractName') or '').lower() == 'liquiditymanager': + print(tx.get('contractAddress', '')) + break +PYEOF +)" || fail2 "Failed to read LiquidityManager from broadcast JSON" -[ -n "$LM_ADDR" ] || fail2 "LiquidityManager address is empty in deployments-local.json" +[ -n "$LM_ADDR" ] || fail2 "LiquidityManager address not found in broadcast JSON" log "LiquidityManager: $LM_ADDR" # ============================================================================= From de8cf65d065b38b92f5c13277b99c5675ea0c212 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 20 Mar 2026 09:54:33 +0000 Subject: [PATCH 2/4] fix: push3-evolution tsconfig rootDir too narrow for cross-project imports Widen rootDir from "." to ".." and include push3-transpiler sources so tsc can resolve the ../push3-transpiler/src imports that mutate.ts and test files use. Co-Authored-By: Claude Opus 4.6 (1M context) --- tools/push3-evolution/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/push3-evolution/tsconfig.json b/tools/push3-evolution/tsconfig.json index 37fbbf2..fa8d639 100644 --- a/tools/push3-evolution/tsconfig.json +++ b/tools/push3-evolution/tsconfig.json @@ -7,8 +7,8 @@ "esModuleInterop": true, "skipLibCheck": true, "outDir": "dist", - "rootDir": "." + "rootDir": ".." }, - "include": ["./**/*.ts"], + "include": ["./**/*.ts", "../push3-transpiler/src/**/*.ts"], "exclude": ["node_modules", "dist"] } From 282ac72c14fbe1bbd0a3bff518e272bd9289c539 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 20 Mar 2026 10:34:41 +0000 Subject: [PATCH 3/4] fix: handle missing deployments-local.json in CI/production Use import.meta.glob with eager loading instead of a static import so config.ts degrades gracefully when the file is absent (gitignored). Fixes the node-quality CI failure introduced when the file was removed from the repo in this PR. Co-Authored-By: Claude Sonnet 4.6 --- web-app/src/config.ts | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/web-app/src/config.ts b/web-app/src/config.ts index 1b62651..e36e364 100644 --- a/web-app/src/config.ts +++ b/web-app/src/config.ts @@ -1,5 +1,3 @@ -import deploymentsLocal from '../../onchain/deployments-local.json'; - const env = import.meta.env; const LOCAL_PONDER_PATH = '/api/graphql'; @@ -16,8 +14,20 @@ interface DeploymentInfrastructure { weth?: string; } -const localContracts = (deploymentsLocal as { contracts?: DeploymentContracts })?.contracts ?? {}; -const localInfra = (deploymentsLocal as { infrastructure?: DeploymentInfrastructure })?.infrastructure ?? {}; +interface DeploymentsLocal { + contracts?: DeploymentContracts; + infrastructure?: DeploymentInfrastructure; +} + +// deployments-local.json is gitignored (local dev only); fall back to empty if absent (CI, production) +const _localFiles = import.meta.glob('../../onchain/deployments-local.json', { + eager: true, + import: 'default', +}); +const deploymentsLocal: DeploymentsLocal = _localFiles['../../onchain/deployments-local.json'] ?? {}; + +const localContracts = deploymentsLocal.contracts ?? {}; +const localInfra = deploymentsLocal.infrastructure ?? {}; const LOCAL_KRAIKEN = (env.VITE_KRAIKEN_ADDRESS ?? localContracts.Kraiken ?? '').trim(); const LOCAL_STAKE = (env.VITE_STAKE_ADDRESS ?? localContracts.Stake ?? '').trim(); const LOCAL_LM = (env.VITE_LIQUIDITY_MANAGER ?? localContracts.LiquidityManager ?? '').trim(); From cee79eedb3a9856740f10b56859e731c0210cbf4 Mon Sep 17 00:00:00 2001 From: openhands Date: Fri, 20 Mar 2026 10:45:13 +0000 Subject: [PATCH 4/4] fix: web-app config.ts fails when deployments-local.json is absent Use brace expansion in import.meta.glob pattern so Vite treats it as a dynamic glob (returns {} when no files match) instead of compiling it to a static import that errors when the gitignored file is absent in CI. Co-Authored-By: Claude Opus 4.6 (1M context) --- web-app/src/config.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web-app/src/config.ts b/web-app/src/config.ts index e36e364..fffa964 100644 --- a/web-app/src/config.ts +++ b/web-app/src/config.ts @@ -19,8 +19,10 @@ interface DeploymentsLocal { infrastructure?: DeploymentInfrastructure; } -// deployments-local.json is gitignored (local dev only); fall back to empty if absent (CI, production) -const _localFiles = import.meta.glob('../../onchain/deployments-local.json', { +// deployments-local.json is gitignored (generated per-run by bootstrap scripts). +// Use a glob pattern (brace expansion) so Vite treats it as dynamic — returns {} +// when the file is absent (CI, production) instead of a hard import error. +const _localFiles = import.meta.glob('../../onchain/deployments-local{.json}', { eager: true, import: 'default', });