Skip to content

feat(quoter-bot): deploy one railway service per chain - #203

Open
haydenshively wants to merge 1 commit into
mainfrom
feature/bots-63-featquoter-release-on-mainnet
Open

feat(quoter-bot): deploy one railway service per chain#203
haydenshively wants to merge 1 commit into
mainfrom
feature/bots-63-featquoter-release-on-mainnet

Conversation

@haydenshively

@haydenshively haydenshively commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

BOTS-63. The mainnet code path landed in #173; this is the deployment half: the quoter-bot Railway
project now runs one quoter-bot-<chainId> service per supported chain (quoter-bot-1,
quoter-bot-8453), the way the liquidation bots run bot-<chainId> (#193).

Shape

Unlike the liquidation bots, per-chain inputs are not _<chainId>-suffixed. The quoter has
about a dozen chain-specific inputs including two large JSON strategy arrays, so a full run keeps
every input under its runtime name and provisions the one chain named by CHAIN_ID. Run it once per
chain with that chain's environment.

  • Full run: CHAIN_ID is parsed with the bot's own chainIdValue, so the script rejects exactly
    what the runtime rejects (0x1, 1.0, unsupported ids) before touching Railway. It then
    provisions quoter-bot-<chainId>: service, /state volume, Dockerfile path, variables.
  • DEPLOY_ONLY (CI): the target set is SUPPORTED_CHAIN_IDS.map(railwayServiceName), so the
    deploy set cannot drift from the bot's chain set. It preflights that every service exists and
    names the missing ones (deploy-only holds no secrets and cannot create), then re-ships through
    reshipRailwayServices: every upload starts before any wait begins, a rejected start is recorded
    as START_FAILED and a failed status read as POLL_FAILED, and the run exits non-zero unless
    every service reaches SUCCESS. One chain's failure never blocks another's re-ship, which matters
    because mainnet is expected to halt at readiness until its market is listed.

No workflow job change: deploy-quoter-bot-production.yml already runs the script with
DEPLOY_ONLY=true and the Docker Hub / npm jobs hang off that single job. Only its header comment
changed. README and docs/reference.md deploy sections updated; the stale chainId: 8453 log claim
is now "the configured chainId".

Cutover (manual, not committed)

  1. The live quoter-bot service has been renamed to quoter-bot-8453: the service id is
    unchanged, and railway variable list still shows RAILWAY_VOLUME_ID / RAILWAY_VOLUME_MOUNT_PATH,
    so the /state volume and all variables survived. A DEPLOY_ONLY preflight against production
    from this branch now reports exactly: Not provisioned in production: quoter-bot-1.
  2. quoter-bot-1 still needs a full run with mainnet config (CHAIN_ID=1, mainnet RPC + archive
    RPC, mainnet MIDNIGHT_ADDRESS / RATIFIER_ADDRESS / USDC / MARKET_IDS / strategy arrays, its
    own funded maker with an unbounded USDC approval, a second BetterStack heartbeat URL).
  3. Merge without the release-quoter-bot label until step 2 is done: a labelled merge deploys
    immediately and DEPLOY_ONLY fails while quoter-bot-1 is unprovisioned.

Blocker outside this repo

No mainnet Midnight market is listed=true yet (/v0/midnight/markets?chain_ids=1&listed=true
returns []). getBook maps listed to allowlisted, setup-check reports not allowlisted, and a
non-transient readiness failure halts the monitor, so quoter-bot-1 will exit at startup until the
market is listed. Provisioning ahead of listing is safe; calling the release done is not.

Verification

  • pnpm --filter @morpho-org/quoter-bot run typecheck, jsdoc:check, root pnpm lint,
    pnpm format, pnpm knip clean.
  • Root pnpm test: 3030 pass; the only failures are the four fork suites that need RPC_URL_8453
    (CI has it). test/scripts/railway.utils.test.ts: 23 tests, including a runnable
    reshipRailwayServices test where one start rejects, another's poll fails, the third succeeds,
    and the aggregate is non-zero.
  • Codex (GPT Sol, high) reviewed the plan and the implementation; all findings incorporated except
    one deferred: binding the deploy poll to the railway up --json deployment id is pre-existing and
    serialized today by the workflow's concurrency group.

🤖 Generated with Claude Code

A full run provisions the chain named by CHAIN_ID as quoter-bot-<chainId>;
DEPLOY_ONLY re-ships every supported chain, naming any unprovisioned
service before uploading and starting all services before waiting on any.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Sep 7, 2026

Copy link
Copy Markdown

BOTS-63

BOTS-106

@haydenshively haydenshively self-assigned this Sep 7, 2026
@haydenshively
haydenshively marked this pull request as ready for review September 7, 2026 06:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T06:08:02.480261Z 4f6aa13 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@haydenshively

Copy link
Copy Markdown
Collaborator Author

@julien-devatom regarding cutover step 2 -- can you handle this, or let me know who I should coordinate with to get the proper config?

@julien-devatom

Copy link
Copy Markdown
Collaborator

@codex review

@julien-devatom

Copy link
Copy Markdown
Collaborator

@julien-devatom regarding cutover step 2 -- can you handle this, or let me know who I should coordinate with to get the proper config?

Will do this morning

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 4f6aa133aa

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants