Skip to content

docs: fix ops gaps and architecture.md accuracy (COW-1001 + COW-1002)#85

Merged
lgahdl merged 9 commits into
developfrom
luizhatem/cow-1001-cow-1002-docs-ops-gaps-and-architecture-accuracy
Jun 8, 2026
Merged

docs: fix ops gaps and architecture.md accuracy (COW-1001 + COW-1002)#85
lgahdl merged 9 commits into
developfrom
luizhatem/cow-1001-cow-1002-docs-ops-gaps-and-architecture-accuracy

Conversation

@lgahdl

@lgahdl lgahdl commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Grant Review Findings

[F14] Document remaining ops gaps — MINOR (docs/ops) (COW-1001)

Port discrepancy undocumented (pnpm dev → 42069, pnpm start → 3000, but docs only mention 42069); dev vs start restart behavior undocumented (ponder dev re-indexes from scratch on restart, ponder start resumes from checkpoint); default ordering: "multichain" behavior undocumented (one chain's backlog drains before the other gets cycles); ethGetLogsBlockRange per chain undocumented and unset (providers capping at 1000 blocks trigger retry storms); .env.example flag descriptions incomplete/stale.

[F21] Fix docs/architecture.md accuracy, hardcoded counts, and repeated owner-resolution sections — MINOR (docs accuracy/maintainability) (COW-1002)

Hardcoded counts ("Eight order types", "Five live-only block handlers") are doc-drift bait; data-flow diagram implies false sequential dependencies between independent event streams; handler section mixes concerns; owner-resolution details repeated across sections; candidateDiscreteOrder motivation under-explained (what it is, not why — a new maintainer must read 3 files to assemble the picture).


Summary

COW-1001 [F14] — Ops gaps:

  • .env.example: remove stale C1 ContractPoller / C5 DeterministicCancellationSweeper names; add # escape-hatch / # prod tags per flag
  • ponder.config.ts: add ethGetLogsBlockRange: 1000 per chain — prevents InvalidInputRpcError retry storms against providers with a 1k-block cap during backfill
  • docs/api-reference.md: document that pnpm dev uses port 42069, pnpm start/Docker uses port 3000
  • docs/deployment.md: new sections for pnpm dev vs pnpm start restart semantics, multichain ordering behavior, and RPC provider block-range limits table

COW-1002 [F21] — docs/architecture.md accuracy:

  • Replace all hardcoded counts ("Eight order types", "Five live-only block handlers", C1–C5 shorthand) with references to source files as canonical lists
  • Data-flow diagram redrawn as three independent parallel on-chain streams (ComposableCow, CoWShedFactory, GPv2Settlement) converging at the schema layer — not a sequential chain
  • Block handler section updated to semantic handler names (OrderDiscoveryPoller, CandidateConfirmer, OrderStatusTracker, OwnerBackfill, CancellationWatcher)
  • candidate_discrete_order: added "Why candidate orders?" motivational paragraph explaining the watch-tower posting gap and precompute-then-confirm pattern
  • Order types section restructured as deterministic vs non-deterministic rather than a hardcoded count

Test plan

  • pnpm typecheck — passes
  • pnpm test — 19/19 passing
  • Port 42069 (dev) / 3000 (prod) documented in api-reference.md
  • ponder.config.ts has ethGetLogsBlockRange: 1000 on both chains
  • No hardcoded counts remain in architecture.md

🤖 Generated with Claude Code

COW-1001 [F14]:
- .env.example: fix stale C1/C5 names, add escape-hatch tags per flag
- ponder.config.ts: set ethGetLogsBlockRange: 1000 per chain to prevent
  InvalidInputRpcError retry storms against providers with a 1k-block cap
- docs/api-reference.md: document that dev uses port 42069, prod uses 3000
- docs/deployment.md: add sections for dev vs start restart semantics,
  multichain ordering behavior, and RPC provider block-range limits

COW-1002 [F21]:
- docs/architecture.md: replace hardcoded counts ("Eight order types",
  "Five live-only block handlers", C1–C5 references) with links to source
- data-flow diagram: redraw as three parallel on-chain streams converging
  at the schema tables, rather than a single sequential chain of arrows
- block handler section: rename to semantic names (OrderDiscoveryPoller,
  CandidateConfirmer, OrderStatusTracker, OwnerBackfill, CancellationWatcher)
- candidate_discrete_order: add "Why candidate orders?" motivational paragraph
- order types section: restructure as deterministic vs non-deterministic
  rather than a hardcoded count

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

linear-code Bot commented Jun 1, 2026

Copy link
Copy Markdown

COW-1001

COW-1002

@lgahdl lgahdl changed the base branch from main to develop June 2, 2026 13:52
@lgahdl

lgahdl commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

The new data-flow diagram correctly reflects the three parallel event streams (ComposableCoW, CoWShedFactory, GPv2Settlement) and uses the new semantic handler names throughout — no C1–C5 references remain in docs/architecture.md. The docs/api-reference.md port correction and the candidate_discrete_order explanation are accurate.

One gap: the Debug / Performance Flags table in docs/deployment.md is not touched by this PR (or by #83), so it still names the old handler identifiers in three rows — C1 ContractPoller, C5 DeterministicCancellationSweeper, and "C1 and C5" in the MAX_GENERATORS_PER_BLOCK row. The rename landed in #83; one of these PRs should own updating that table. Currently neither does.

@lgahdl

lgahdl commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Documentation / CI review

docs/deployment.md — Debug/Performance Flags table still has old C1/C5 names.
Lines 33–35 of the current docs/deployment.md (which this PR does not touch) still reference C1 ContractPoller and C5 DeterministicCancellationSweeper. This PR targets COW-1001 [F14] ops gaps and is the right place to fix these stale entries. The three affected rows in the table should read OrderDiscoveryPoller and CancellationWatcher to match blockHandler.ts and ponder.config.ts.

docs/api-reference.md — one residual old name.
Line 129: the timestamp field matrix still says "Block timestamp at C1 discovery." Should be OrderDiscoveryPoller. This PR already touches api-reference.md (port documentation), so it is a natural addition.

.env.example — fully updated and clean. The new escape-hatch comments use the semantic handler names and add the # escape-hatch / # prod tags. No issues here.

ponder.config.tsethGetLogsBlockRange: 1000 added on both chains. Correct and documented.

docs/deployment.md new sections (pnpm dev vs start, multichain ordering, RPC block range) — accurate and complete. The port table, restart semantics, and provider limits table all look correct.

docs/architecture.md updates — thorough and accurate. The data-flow diagram rewrite and handler section updates correctly use the new semantic names. No stale C-number references remain in architecture.md.

Overall: Two items to fix before merge — update the three rows in the Debug/Performance Flags table in docs/deployment.md and the one C1 reference in docs/api-reference.md line 129.

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

@yvesfracari yvesfracari left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It seems to me that there is still something missing here:

  • "How to tell if the indexer is caught up" doc
  • Remove chain specific things from architecture

Comment thread docs/api-reference.md Outdated
Comment thread docs/architecture.md Outdated
Comment thread docs/deployment.md Outdated
Comment thread ponder.config.ts Outdated
lgahdl and others added 5 commits June 4, 2026 10:47
…up" section

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>
@lgahdl lgahdl requested a review from yvesfracari June 5, 2026 00:07
…001)

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

lgahdl commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Addressed both points:

"How to tell if the indexer is caught up" — Added a "Checking If the Indexer Is Caught Up" section to docs/deployment.md explaining: GET /ready (binary: 200 = synced, 503 = still syncing) vs GET /api/sync-progress (per-chain percentage + isSynced flag). Includes a sample JSON response.

"Remove chain-specific things from architecture" — Removed the hardcoded chain IDs, block numbers, and contract addresses from docs/architecture.md. Replaced with: "Currently active chains, their start blocks, and contract addresses are defined in src/chains/. To add a chain, create a chain file there and register it in src/chains/index.ts/."

… Known Limitations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lgahdl lgahdl merged commit 20febdf into develop Jun 8, 2026
4 checks passed
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