Skip to content

fix(intuition): read mainnet Safe messages so mainnet delegations publish - #16

Open
jeremie-olivier wants to merge 1 commit into
mainfrom
fix/tx-service-mainnet
Open

fix(intuition): read mainnet Safe messages so mainnet delegations publish#16
jeremie-olivier wants to merge 1 commit into
mainfrom
fix/tx-service-mainnet

Conversation

@jeremie-olivier

Copy link
Copy Markdown
Member

Problem

POST /intuition/publish rejects every Ethereum mainnet delegation with:

400 {"error":"message not found on the Safe Transaction Service"}

The message is there and finalized — we just never look for it. TX_SERVICE_URL (src/lib/safe-messages.ts) maps Base Sepolia, Sepolia and Base but not chain 1, so txServiceUrl(1) returns null and getSafeMessage bails before issuing a request. The publisher surfaces that as "not found", which points the reader at the tx-service rather than at our map.

Ethereum is in both SUPPORTED_CHAINS and SELECTABLE_CHAINS, so this affects every mainnet delegation, not just the one that surfaced it.

Change

One entry:

1: 'https://safe-transaction-mainnet.safe.global',

Legacy per-chain host, to match the existing entries. It 308-redirects to api.safe.global/tx-service/eth, fetch follows it transparently, and no API key is required (verified). The comment above the map now states the invariant — it must cover every signable chain in SUPPORTED_CHAINS — so the next chain added doesn't repeat this.

Verification

Ran the publisher's pipeline locally against a real finalized mainnet delegation, stopping short of the mint (Safe 0x39d84e41EAc6F94709d3715fe5E367F4e6B83f80, message 0x82009c44ad31833c6eb904c6e808c4b4543ebf18bd51097e33c46517584b7131):

Step Result
Fetch from tx-service 200, finalized, 2/2 confirmations
Reconstruct DelegationStruct salt + aggregated signature intact
EIP-1271 against the Safe on mainnet 0x1626ba7e — pass
Token metadata USDC, 6 decimals
Decode details stream / 3001.536 USDC / month
Build DelegationJson ok

Everything downstream of the map already worked; this was the only blocker.

Checks: tsc -b clean, bun run build ok, lint clean on the changed file. bun run test:unit shows 138 pass / 1 fail — the failure (test/unit/stream-amounts.test.ts:109, streamedAvailable) is pre-existing on main, reproduces with this change stashed, and is untouched here.

Deploy note

The fix only takes effect on https://hourglass.box after a redeploy. Worth flagging before anyone re-pokes: /intuition/health reports "network":"mainnet", so a publish spends real $TRUST, not testnet tTRUST — server/README.md frames the accepted abuse risk (ADR 0005) on the assumption of a testnet-only attestor. That assumption is now stale and probably deserves its own look.

🤖 Generated with Claude Code

…lish

TX_SERVICE_URL had no entry for chain 1, so txServiceUrl(1) returned null
and getSafeMessage bailed before any request. The publisher then rejected
a perfectly valid mainnet delegation with "message not found on the Safe
Transaction Service" — a misleading error, since the message exists and is
finalized; we simply never looked for it.

Ethereum is in SUPPORTED_CHAINS and SELECTABLE_CHAINS, so every mainnet
delegation hits this, not just the one that surfaced it.

The legacy per-chain host is used to match the existing entries; it
308-redirects to api.safe.global/tx-service/eth and fetch follows that
with no API key.

Verified against a real finalized mainnet delegation (Safe
0x39d84e41EAc6F94709d3715fe5E367F4e6B83f80, message
0x82009c44ad31833c6eb904c6e808c4b4543ebf18bd51097e33c46517584b7131) by
running the publisher pipeline short of the mint: message fetched, struct
reconstructed with the salt and aggregated signature intact, EIP-1271
returned 0x1626ba7e against the Safe on mainnet, token resolved to USDC,
and the DelegationJson document built.

Verified: tsc -b clean, bun run build, lint clean on the changed file. The
one failing unit test (stream-amounts) is pre-existing on main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@host-intuition-box

host-intuition-box Bot commented Jul 25, 2026

Copy link
Copy Markdown

The preview deployment for Hourglass is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-07-25 16:46:21 CET

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.

1 participant