feat(cow): source the registry address from module [config] - #666
Open
mfw78 wants to merge 1 commit into
Open
Conversation
mfw78
marked this pull request as ready for review
August 3, 2026 23:52
The keeper learns the ComposableCoW registry from its manifest [config] instead of the compiled cowprotocol::COMPOSABLE_COW constant. A missing or malformed registry key is a hard init error; there is no fallback of any kind. A manifest parity test pins [config].registry to the chain-log subscription address pins (and the test fixture constant) until the #652 cutover moves them together. Closes #651
mfw78
force-pushed
the
cow/651-registry-config
branch
from
August 3, 2026 23:56
1aa7891 to
acf0e06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Sources the ComposableCoW registry address from the twap-monitor manifest
[config]and deletes the compiledcowprotocol::COMPOSABLE_COWconstant from the module, with no fallback of any kind.modules/twap-monitor/src/keeper.rsgainsKeeperConfig { registry: Address }withparsemirroring cow-venue'sAdapterConfig::parse(unknown keys ignored, malformed value or missing key is a hardFault::InvalidInput), the sameRwLockstore/accessor shapes, and aregistryfield threaded throughTwapSourceintopoll_one'seth_call_params.modules/twap-monitor/src/lib.rsparses and stores ininit(a parse failure is the init error);on_blockbeforeinitis a typedFault::Unavailablerefusal.modules/twap-monitor/module.tomlgains[config]withregistry = "0xfdaFc9d1902f4e0b84f65F49f244b32b31013b74", the current Sepolia registry, so behaviour is unchanged.Why
Closes #651: the converged ccow-monitor knows exactly one contract, the registry, and hard-coding the constant coupled the module to a single network and put a cow-rs rev on the critical path. This is the first car of the convergence train and changes the mechanism only; the address cutover to the mainnet fork is #652's atomic swap. A new parity test pins
[config].registryto the chain-log subscription address pins and the test fixture constant so the #652 swap must move all three together.Testing
Gates (all via
nix develop -c, from the worktree, package-scoped per the train's light-CI rule):cargo fmt --check -p twap-monitor: clean.cargo clippy -p twap-monitor --all-targets: clean.cargo nextest run -p twap-monitor: 34 passed (25 before, 9 added: config parse valid/missing/malformed/unknown-keys, init-level wiring for the same three cases, a typed-refusal test foron_blockwithout config, a manifest parity test, and a poll-path test that stores a distinct registry and asserts the eth_calltocarries it, failing if the constant is reintroduced).cargo test -p twap-monitor --lib: 34 passed (the refusal test serialises config access behind a test guard, so the suite is runner-independent).AI Assistance: Claude Fable used for the implementation via a structured workflow; Claude Opus used for the red-team review (9 findings, 7 fixed, 1 duplicate-merged, 1 rejected as out-of-scope checksum policy).