Skip to content

Release: develop → main#77

Open
lgahdl wants to merge 94 commits into
mainfrom
develop
Open

Release: develop → main#77
lgahdl wants to merge 94 commits into
mainfrom
develop

Conversation

@lgahdl

@lgahdl lgahdl commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Promotes the current develop state to main. Includes:

  • COW-978: Modularize ponder config with per-chain src/chains/ files — all 12 CoW Protocol chains defined with verified ComposableCow, CowShedFactory, AaveV3AdapterFactory, GPv2Settlement, and FlashLoanRouter addresses
  • COW-985: Add GET /api/sync-progress endpoint with per-chain completion tracking
  • COW-987: Fix stale doc references and remove duplicated content

Test plan

  • Verify indexer is healthy on server (docker ps shows cow-programmatic-ponder-1 healthy)
  • Smoke-test /api/sync-progress and /graphql endpoints
  • Review chain config addresses for correctness before enabling additional chains

🤖 Generated with Claude Code

lgahdl and others added 30 commits May 28, 2026 10:20
The by_uids endpoint returns [{order: {...}}] but the code was treating
it as a flat OrderbookOrder[]. This caused order.uid to be undefined,
so fetchOrderStatusByUids returned an empty map for all candidates,
preventing C2 from ever promoting candidateDiscreteOrders to discreteOrders.
…ves (COW-977)

Replace manage.sh, deploy-remotely.sh, and static/start-db.sh with tsx scripts
and inline compose config. Adds deploy:up/down/remote pnpm scripts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (COW-978)

Extract per-chain addresses into src/chains/{mainnet,gnosis,arbitrum}.ts with
a central ACTIVE_CHAINS index. ponder.config.ts now derives all config with no
hardcoded addresses. Toggling a chain requires one line in src/chains/index.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Verify the { order } unwrap fix with a real HTTP server: 6 tests covering
correct uid→status mapping, executed amounts, multiple orders, HTTP errors,
and empty responses. Adds ponder/ponder:schema vitest stubs to resolve
virtual module imports without a running Ponder process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use SupportedChainId from @cowprotocol/cow-sdk for chainId typing in ChainConfig
- Derive contractPollerInterval from blockTime via pollerInterval() helper (~20s target)
- Add arbitrum, base, and sepolia chain config files (cowShedFactory/gpv2Settlement
  marked null until addresses are confirmed)
- Export ALL_DEFINED_CHAINS for ORDERBOOK_API_URLS; ACTIVE_CHAINS stays mainnet+gnosis
- Make cowShedFactory nullable in ChainConfig; filter in ponder.config.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eteorder-fulfilled-not-promoted-to

fix: unwrap order wrapper from POST /orders/by_uids response (COW-979)
Clarify that manage.ts and deploy-remotely.ts are tailored to Bleu's
internal deployment workflow, as requested in PR review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pts-in-deployment-with-typescriptnode-or

feat: replace deployment shell scripts with TS/Node alternatives (COW-977)
Returns per-chain historical sync progress as clean JSON:
totalBlocks, processedBlocks, progressPct (0-100), isRealtime,
isComplete. Reads from Ponder's Prometheus /metrics endpoint using
the request origin so it works on any port. Registered in OpenAPI/Swagger.

6 integration tests covering: status code, chain entries, processedBlocks
calculation, progressPct rounding, realtime/complete flags, and graceful
degradation when /metrics is unreachable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…W-985)

Add non-null assertions for Record<string, T> index access under noUncheckedIndexedAccess.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… (COW-976) (#68)

Moves deployment/docker-compose.yml to the root docker-compose.yml,
unifying dev and prod postgres into a single service. Production containers
run under the "deploy" profile. Updates manage.ts and deployment docs
accordingly. Default postgres credentials are env-var-substituted dev
fallbacks, not real secrets.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
deploy-remotely.sh was deleted by COW-977. Add Node/pnpm setup steps
and switch the run command to npx tsx deployment/deploy-remotely.ts.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Builds and pushes the image to ghcr.io on every push to main.
Tags: full git SHA (for Kubernetes to pin), branch name, and latest.
Uses GitHub Actions layer cache to speed up repeat builds.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…84) (#73)

Add "Is it working?" section explaining what to check during and after
backfill, how to distinguish stuck from slow, and what each health
endpoint signals. Addresses client feedback that the README should be
fool-proof for operators with no Ponder background.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: derive active chain descriptions from CHAIN_NAMES in data.ts (COW-982)

Add CHAIN_NAMES map to src/data.ts as single source of truth for chain
labels. ChainIdQuery description now derives from it dynamically. Update
docs/api-reference.md and docs/architecture.md to remove hardcoded
chain references and point to src/data.ts instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: verify CHAIN_NAMES drives ChainIdQuery description (COW-982)

4 tests: CHAIN_NAMES has expected entries, all names are non-empty,
ChainIdQuery.description contains every id+name pair from CHAIN_NAMES,
and the description is not the old hardcoded string.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: derive CHAIN_NAMES from cow-sdk, drop chain-names test (COW-982)

Addresses reviewer feedback: import chain labels from getChainInfo() instead
of hardcoding, and remove the low-value chain-names unit test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
#72)

* docs: document /ready /status /metrics endpoints and k8s probes (COW-983)

Add /ready, /status, and /metrics to the endpoints table with full
descriptions. Document Kubernetes liveness/readiness probe config.
Explain /status response shape and what "stuck" looks like vs normal
backfill. Addresses client feedback about underdocumented health endpoints.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: add unit tests for GET /healthz endpoint (COW-983)

3 tests: verifies 200 status, {"status":"ok"} body, and JSON content-type.
Matches the behaviour documented in docs/api-reference.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* refactor: remove redundant healthz test and probe doc sections (COW-983)

Addresses reviewer feedback: endpoint descriptions in the table are
sufficient; the dedicated sub-sections and the healthz unit test are overhead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
…W-978)

Every chain in cow-sdk's ALL_SUPPORTED_CHAIN_IDS now has a config file in
src/chains/. New stubs (BNB, Polygon, Lens, Plasma, Avalanche, Ink, Linea)
follow the same pattern as existing stubs — composableCow address is the
known CREATE2 deployment; all other addresses are null with TODOs pointing
to the relevant block explorer. None are active until addresses are confirmed
(tracked in COW-986).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add entry in REST endpoints section and a dedicated subsection with
example response and field descriptions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…der-config-per-chain-files-under-srcchains' into luizhatem/cow-986-support-all-cow-protocol-chain-ids-bnb-ink-linea-etc
Fix deploy-remotely.sh/.ts, manage.sh/.ts, remove deleted static/start-db.sh,
remove duplicate API Endpoints section, update chain config references from
src/data.ts to src/chains/index.ts, and update Adding a New Chain steps.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…(COW-986)

Add verified ComposableCoW deployment blocks where confirmed on-chain via
cowprotocol/composable-cow networks.json cross-referenced with block explorers
and public RPC nodes. Also verify orderbook API URLs against cow-sdk
ORDER_BOOK_PROD_CONFIG source.

Verified startBlocks:
- Arbitrum (42161):  204751436 (networks.json + arbiscan)
- Base (8453):        21794150 (basescan, 2024-10-31)
- Sepolia (11155111):  5072748 (networks.json + sepolia.etherscan.io, 2024-01-12)
- BNB (56):           48433175 (networks.json + bscscan.com, 2025-04-17)
- Polygon (137):      70406888 (polygonscan.com, 2025-04-17)
- Lens (232):          3516559 (networks.json + rpc.lens.xyz, 2025-09)
- Plasma (9745):       4810535 (networks.json + rpc.plasma.to)
- Avalanche (43114):  60434336 (snowscan.xyz, 2025-04-17)
- Ink (57073):        34878187 (Blockscout API + rpc-gel.inkonchain.com)
- Linea (59144):      25028474 (networks.json + lineascan.build)

Verified orderbook API URLs (all return HTTP 200 from api.cow.fi):
- bnb, polygon, plasma, avalanche, ink, linea — confirmed active
- lens — NOT yet in cow-sdk ORDER_BOOK_PROD_CONFIG; api.cow.fi/lens returns 404

Also restore CHAIN_NAMES export in src/data.ts (removed during merge conflict
resolution) — derived from ACTIVE_CHAINS.name instead of the old getChainInfo().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rbookApiUrl to orderbookApiPath (COW-978)

- Remove contractPollerInterval field from ChainConfig; compute inline in ponder.config.ts via pollerInterval()
- Rename orderbookApiUrl -> orderbookApiPath storing only the path suffix (e.g. "mainnet", "xdai")
- Update src/data.ts to construct full URL from path: https://api.cow.fi/${c.orderbookApiPath}
- Update all 12 chain files accordingly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…978)

Replace placeholder startBlocks (0 / rough estimates) with values verified
from cowprotocol/composable-cow networks.json and block explorers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…b-ink-linea-etc' into luizhatem/cow-978-modularize-ponder-config-per-chain-files-under-srcchains

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2Settlement for 5 chains (COW-978)

All addresses confirmed on-chain via ROUTER() call. Deployment blocks verified
by binary search on each chain's RPC.

Chains: arbitrum, base, avalanche, linea, polygon

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…2Settlement for BNB and Plasma (COW-978)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: modularize ponder config with per-chain src/chains/ (COW-978)
feat: add GET /api/sync-progress endpoint (COW-985)
docs: fix stale references and remove duplicated content (COW-987)
…d on RPC provisioning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lgahdl and others added 19 commits June 4, 2026 18:00
Handler was converted from db.execute(sql\`GROUP BY\`) to
db.select().from().where().groupBy() with count() from ponder.
Update mocks accordingly: ponder:api now exposes db.select, ponder
exports and/eq/count, and StatusRow.count is number not string.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-hygiene

fix: schema hygiene and SQL parameterization (COW-997, COW-998)
…OW-1005)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lean> and tighten orderType typing

- order-types.ts: replace DETERMINISTIC_ORDER_TYPES Set + isDeterministicOrderType()
  with DETERMINISTIC_ORDER_TYPE: Record<OrderType, boolean> — exhaustive record
  ensures TypeScript catches missing entries when new OrderTypes are added
- uidPrecompute.ts: orderType: string → OrderType in both function signatures;
  isDeterministicOrderType() → DETERMINISTIC_ORDER_TYPE[] lookup
- blockHandler.ts: NON_DETERMINISTIC_TYPES and SINGLE_SHOT_NON_DETERMINISTIC typed
  as readonly OrderType[]; three inline query result casts string → OrderType;
  removes as readonly string[] workaround on .includes()
- orderbookClient.ts: orderType: string → OrderType in ComposableOrder and query
  result cast; empty string placeholder → "Unknown"
- tests/utils/order-types.test.ts: rewrite to test DETERMINISTIC_ORDER_TYPE record

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove tests that duplicate TypeScript's static coverage (type check,
describe text, enum values). Keep only the two runtime regression guards
that safeParse-unknown cannot catch at compile time.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- docs/api-reference.md: document Ponder built-in /health and /ready endpoints
- docs/architecture.md: fix GPv2Settlement description — Settlement event triggers
  the handler; Trade logs in the receipt identify the adapter address
- docs/deployment.md: mark QuickNode block range as unverified; add ETH_GET_LOGS_BLOCK_RANGE_<chainId> entry
- ponder.config.ts: make ethGetLogsBlockRange configurable via ETH_GET_LOGS_BLOCK_RANGE_<chainId>
- .env.example: document ETH_GET_LOGS_BLOCK_RANGE_<chainId>

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
10k blocks on paid plans, 5 blocks on free trial (verified against
QuickNode docs). Free trial is effectively unusable for backfill.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nge and semantic handler names

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…reep

- Replace manual DiscreteStatus union with (typeof discreteOrderStatusEnum.enumValues)[number]
  so the type stays in sync with the schema automatically
- Delete cowLogger.ts — structured logging belongs in COW-994 (PR #87),
  not in this fix PR; replace the one cowLog call with a plain console.log

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l from develop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…readiness semantics

- Rename cowLogger.ts to logger.ts and cowLog() to log() — the module name
  already provides context; the cow prefix was misleading
- Rename `for (const log of receipt.logs)` loop variable to txLog to avoid
  shadowing the newly imported log function
- K8s liveness probe: use /health (Ponder built-in) instead of /healthz
- readinessProbe: fix misleading failureThreshold comment; add paragraph
  clarifying that NotReady does not kill the pod — cold-start sync takes hours

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ostgreSQL section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The new name is precise: it measures eth_getLogs block-fetch progress
(ponder_historical_completed_blocks + cached / total), not handler execution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Combines develop's ordersByOwnerHandler integration tests (mocked db.select)
with HEAD's GeneratorSummary and OrdersByOwnerResponse schema regression guards.
The "returns enriched orders" test gains an explicit gen["hash"] assertion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: minor cleanups from grant review (COW-996, COW-999, COW-1003)
…W-993)

feat: expose generator hash in REST /api/orders/by-owner response (COW-993)
@socket-security

socket-security Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtsx@​4.22.31001008293100

View full report

lgahdl and others added 10 commits June 8, 2026 09:46
Both sides added adjacent lines after the orderUid import: HEAD added the
DiscreteStatus derived type, develop added the OrderType import. Keep both.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…onfirmer (COW-990)

fix: preflight /by_uids before cascade-cancelled insert in CandidateConfirmer (COW-990)
…W-994)

Extends the log() migration from blockHandler.ts and settlement.ts to all
remaining call sites in composableCow.ts, setup.ts, orderbookClient.ts, and
uidPrecompute.ts. No console.log/warn/error remain in src/application/ outside
logger.ts itself. Documents the scope and usage convention in deployment.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-994)

Keep only path and port — the operator decides periodSeconds, failureThreshold,
and initialDelaySeconds based on their cluster SLOs. Add a note explaining this.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…001)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Known Limitations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-gaps-and-architecture-accuracy

docs: fix ops gaps and architecture.md accuracy (COW-1001 + COW-1002)
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.

1 participant