PoC probes: enforceable-hooks / wrapper support on Gnosis#16
Draft
anxolin wants to merge 5 commits into
Draft
Conversation
anxolin
marked this pull request as draft
July 23, 2026 21:04
anxolin
force-pushed
the
feat/post-enforceable-hook-order
branch
from
July 23, 2026 21:11
05c1d25 to
477ce8b
Compare
Adds src/scripts/gnosis/postHookOrder.ts: posts a CoW order on Gnosis Chain carrying CoW hooks in the order's appData, and prints the full appData document + hash + order URL so we can inspect how the real backend/solvers convey and treat hooks. This is to validate the transport assumption behind an enforceable-hooks wrapper (cow-shed): that pre/post interactions and wrapper routing travel via appData. This SDK version exposes standard CoW hooks (metadata.hooks) but no wrapper/Atomic-Bundles field, so the script probes the hooks-in-appData path (the closest existing mechanism). Also adds WXDAI/COW Gnosis token constants and registers the script as the active JOBS entry.
anxolin
force-pushed
the
feat/post-enforceable-hook-order
branch
from
July 23, 2026 21:41
477ce8b to
c44640a
Compare
The docs describe conveying a settlement wrapper via a top-level
`wrappers` array in appData, but that field is absent from released
@cowprotocol/app-data (3.3.1) and cow-sdk (9.2.2). This script uploads a
control appData doc and one with a `wrappers` entry to the Gnosis
orderbook app-data endpoint (PUT /app_data/{hash}) to see whether the
server schema accepts it. No wallet/RPC needed.
wrappers isn't in the deprecated @cowprotocol/app-data; it lives in
@cowprotocol/sdk-app-data (5.3.1, schema v1.15.0), re-exported by
cow-sdk 9.2.2 as MetadataApi. It's under metadata.wrappers with fields
{ address, data?, is_omittable? } (the docs' root-level {target,
isOmittable} is stale). Probe now uses the typed builder + correct
shape.
Replace the deprecated @cowprotocol/app-data package with the new @cowprotocol/sdk-app-data across all scripts. The `latest` type namespace is now exported as `cowAppDataLatestScheme`.
…g + wrappers? Deploys a minimal Mock1271Signer on Gnosis (isValidSignature returns magic only when valid==true; false mimics an unblessed shed), then posts three 1271 orders owned by it and compares acceptance: A) valid=false, no wrappers -> expect reject (orderbook validates 1271 at post) B) valid=false, with wrappers -> the question (does it defer validation?) C) valid=true, with wrappers -> expect accept (sanity) This is the make-or-break gate for the wrapper-blesses-at-settlement design. Env: PRIVATE_KEY, RPC_URL_100 (+ a little xDAI to deploy); set MOCK_1271 to reuse a deployed stub.
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
Gnosis probe scripts investigating whether CoW's order flow can support an "enforceable hooks" wrapper for cow-shed. Each is a
JOBSentry insrc/index.ts(uncomment the one you want).probeWrappersAppData.ts— uploads an appData doc withmetadata.wrappers(built with the wrappers-awareMetadataApifrom@cowprotocol/sdk-app-data, re-exported by cow-sdk) to the orderbook's app-data endpoint, vs a control, to confirm the field is accepted. No wallet needed.probeOrder1271Wrapper.ts— deploys a minimal EIP-1271 stub and posts 1271 orders owned by it (with/withoutwrappers, sig valid/invalid) to test whether the orderbook accepts an order whose signature only validates at settlement.postHookOrder.ts— posts an order with standard CoW hooks in appData (earlier probe).Why
Validate, against the live Gnosis system, the two assumptions behind the wrapper design: (1) an order can carry a settlement wrapper via
metadata.wrappers, and (2) the orderbook defers 1271 signature validation to settlement for wrapper orders (so a shed only "blessed" at settle-time can still get its order accepted).Run