refactor: rename block handlers to semantic namespaced names (COW-1000)#83
Conversation
Renames all five Ponder block-handler entries from opaque C1–C5 shorthand to self-documenting composableCow.* names that match their responsibility. Updates ponder.config.ts keys, ponder.on() call names, section headers, log prefixes, and all in-file cross-references. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ot-namespace conflict)
Ponder 0.16.x treats dots in block interval names as namespace separators,
causing ponder.on('composableCow.OrderDiscoveryPoller:block') to fail validation.
Block intervals must use simple names without dots.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The handler rename is consistent throughout
These should be updated to |
|
Code review — block handler rename (COW-1000) Ponder app fingerprint / schema drop risk Ponder 0.16.x tracks block sources by name in its internal Name consistency
Leftover old names
Overall: PR is operationally safe. No schema changes, no logic changes, no orphaned |
Documentation / CI review
Lines 33–35 of
This PR renames those handlers to
Breaking change / schema drop notice missing from PR body.
|
…-1000) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
This PR applies the suggestions but didn't answer other questions of Anxo with my take bellow them:
- The flashloan orders flow aren't well documented. Shouldn't we have different handlers for composable cow and aave flash loan orders?
Flash loan orders are not handle by block handlers, we monitor directly events for it. However, we need to improve the documentation about it. The blockhandlers that have specific composable cow logic should mention it to make sure we separate what is generic (e.g. order status change that is valid for any kind of order)
- We have around 11% unknown types. Are they really unknown?
Doing a quick search, no they are not unknown and we could identify (at least the main ones), example: (1, 2, 3)
- Why is
orderbook_cacheretained vs dropped?
I think that is only to not check order API twice between deployments for orders that are already on its final state. Would double check if we're documenting this properly.
- TWAP
nPartsupper bound.
Nice catch. He mention that UI only accept TWAPs with 365 parts. On contracts side they are validated to be lower than
uint32.max, what is a really giant number of rows to insert into the DB. In addition, this validation happens after the conditional order is emitted, on the query / execution path. This means that thenPartsupper bound on the contract perspective is actuallyuint256.max. Looking at the code I don't find any kind of guard against it. This means that someone could use it of a DDoS attack.
WRT this PR I would only address points 1 and 3 here. The others are big enough to be executed alone.
| | `DISABLE_POLL_RESULT_CHECK` | No | Disables the C1 ContractPoller block handler. Skips RPC multicalls for non-deterministic generators. Saves RPC calls during initial sync at the cost of not detecting poll results until re-enabled. | | ||
| | `DISABLE_DETERMINISTIC_CANCEL_SWEEP` | No | Disables the C5 DeterministicCancellationSweeper. Skips periodic `singleOrders()` reads on deterministic generators. While disabled, on-chain `ComposableCoW.remove()` calls on TWAP/StopLoss/CirclesBackingOrder generators will not be detected and those generators stay `Active`. | | ||
| | `MAX_GENERATORS_PER_BLOCK_<chainId>` | No | Per-block cap on how many generators C1 and C5 will touch on the given chain (e.g. `MAX_GENERATORS_PER_BLOCK_1=200`, `MAX_GENERATORS_PER_BLOCK_100=400`). Default is 200. Excess generators defer to the next block, prioritized by oldest `lastCheckBlock` first. | | ||
| | `DISABLE_POLL_RESULT_CHECK` | No | Disables the OrderDiscoveryPoller block handler. Skips RPC multicalls for non-deterministic generators. Saves RPC calls during initial sync at the cost of not detecting poll results until re-enabled. | |
There was a problem hiding this comment.
nit: would use inline code format to make it clear it is talking a about a code component
| | `DISABLE_POLL_RESULT_CHECK` | No | Disables the OrderDiscoveryPoller block handler. Skips RPC multicalls for non-deterministic generators. Saves RPC calls during initial sync at the cost of not detecting poll results until re-enabled. | | |
| | `DISABLE_POLL_RESULT_CHECK` | No | Disables the `OrderDiscoveryPoller` block handler. Skips RPC multicalls for non-deterministic generators. Saves RPC calls during initial sync at the cost of not detecting poll results until re-enabled. | |
| ACTIVE_CHAINS.map((c) => [c.name, { startBlock: "latest" as const }]), | ||
| ), | ||
| // OrderStatusTracker — polls API for open discrete order status. | ||
| "OrderStatusTracker": { |
There was a problem hiding this comment.
nit:
| "OrderStatusTracker": { | |
| OrderStatusTracker: { |
Summary
composableCow.*names that match their responsibility (OrderDiscoveryPoller,CandidateConfirmer,OrderStatusTracker,OwnerBackfill,CancellationWatcher)ponder.config.tsblock keys andponder.on()call names inblockHandler.ts[COW:C1]→[COW:OrderDiscoveryPoller]), and all in-file cross-references to old namesTest plan
pnpm typecheck— passespnpm test— 19/19 passingponder.on()names exactly🤖 Generated with Claude Code