Author(s)
zynorr (GitHub: zynorr)
Point of contact: zynorlawes@gmail.com
Experiences and qualifications:
Relevant public work:
- Fiber Merchant Kit — Payment API with invoice lifecycle, webhooks, and automated tests.
- CCIP-Read & Signed Offchain Data Starter Kit — EIP-3668/EIP-712 signed offchain data integrations.
- Hardhat Starknet — Developer tooling for Starknet build, deploy, and call workflows.
- terminal3-private-travel-agent — Rust project.
Grant Description:
Proposed grant category: Protocol infrastructure / reliability.
This proposal addresses CoW Services issue #5032. The issue describes an on-chain order invalidation that is removed by a chain reorganization while its derived Cancelled event remains in order_events. The /api/v1/orders/{uid}/status endpoint can then report Cancelled even though the canonical invalidation has been removed and regular order metadata may show the order as open.
The goal is to correct that inconsistent lifecycle status and add regression coverage in the upstream cowprotocol/services repository. The work will first confirm the intended behavior and implementation path with a CoW reviewer. Depending on reviewer guidance, the fix could associate derived lifecycle events with their source chain event or remove/neutralize the derived cancellation when that source event is reverted.
Objectives and outcomes
- A reverted on-chain invalidation no longer leaves an order falsely reported as cancelled by the status endpoint.
- Canonical invalidations and replacement-block events continue to produce the correct status.
- The behavior is covered by an automated regression test and submitted as an upstream pull request.
This is a bounded correctness improvement to CoW’s order service. It benefits users and integrations that rely on order-status data. It is tied to a documented CoW issue and has a testable outcome; it does not claim a direct increase in trading volume. Funding is contingent on confirmation that this work is not already owned or planned internally.
Type of Grant:
Milestone-based grant.
Milestones:
| Milestones | Title | Due date (*) | Funding request |
|---|---|---|---|
| Milestone 1 | Reproduction, regression test, and reviewer-aligned fix plan | 1 week after commencement, subject to reviewer availability | $2,000 USD |
| Milestone 2 | Reorg-safe status fix and completed validation | 3 weeks after commencement | $2,000 USD |
(*) The proposed start is upon successful Snapshot approval, unless the Grants Committee specifies otherwise.
Specifics: Milestone 1
Tasks and deliverables
- Confirm with the assigned reviewer that issue #5032 remains unowned, external implementation is welcome, and what behavior the status endpoint should expose after a reorg.
- Reproduce the issue in the repository’s test environment.
- Add a regression test for this sequence: an invalidation at block N is indexed; the reorg replacement removes it; the latest lifecycle status is no longer
Cancelledsolely because of that reverted event. - Submit a draft pull request containing the reproduction, regression test, and concise fix plan agreed with the reviewer.
Acceptance criteria
- The reviewer can reproduce the stale-status behavior using the test.
- The test and fix plan reflect the reviewer’s agreed expected behavior and implementation direction.
- The draft pull request is scoped to issue #5032.
Specifics: Milestone 2
Tasks and deliverables
- Implement the smallest maintainable correction in the reorg/event-handling path, following the reviewer-approved approach.
- Complete regression coverage for the reverted invalidation, canonical invalidations, and replacement-block events.
- Update the draft pull request with the implementation, test results, and a concise explanation of the behavior change.
Acceptance criteria
- Automated coverage demonstrates that a reverted invalidation no longer leaves a stale cancelled status.
- Coverage confirms canonical invalidation and replacement-event behavior, as agreed with the reviewer.
- The CoW reviewer approves the completed change for merge; milestone payment follows the Grants Program’s normal technical review process.
Out of scope: redesigning order-status APIs, addressing unrelated reorg cases, changing client interfaces, or building a separate monitoring product.
Length
Up to three weeks from commencement after successful Snapshot approval and reviewer alignment. Milestone 1 is due after one week and Milestone 2 after three weeks, subject to reviewer availability.
Funding Request:
Total requested: $4,000 USD
The request is split evenly across two deliverable-based milestones: $2,000 USD equivalent for the reviewed reproduction and regression test, then $2,000 USD equivalent for the fix and completed validation. The amount should be checked against the named implementer’s estimate before posting. No additional work is included without an agreed scope update. The current grants guidance says CIP-82 governs where older template or process materials conflict; confirm the token conversion and payment terms with the committee before the Snapshot submission.
Ethereum Mainnet Address
0x9D56b3867e080910FBE502791C4767fBf377EaD8
Terms and Conditions
By submitting this grant application, I acknowledge and agree to be bound by the CoW DAO Participation Agreement and the CoW DAO Grant Agreement Terms.