Skip to content

fix(tasks): renew expired unused funding authorizations - #131

Closed
vapi-development wants to merge 2 commits into
mainfrom
fix/expired-signed-funding-authorization
Closed

vapi-development wants to merge 2 commits into
mainfrom
fix/expired-signed-funding-authorization

Conversation

@vapi-development

Copy link
Copy Markdown
Contributor

Problem

vapi task fund on a V2 pool order: once a signed EIP-3009 funding authorization expired unused (the first run failed after signing, before funding), every rerun failed forever with v2_plan_mismatch (elapsed time window). Seen on Base mainnet 12-03 (order b9813077, pool 6).

Cause

v2-execution.ts: journal.signed made the run "started", and only an unstarted expired intent was renewed; the signed one always reached verifyV2TypedData, which refuses the elapsed window.

Fix

A signed (or reserved-but-interrupted) funding authorization with no saved v2-fund transaction is replaced only after proof that it can never move money:

  • hosted operation known: the run recovers/reconciles it to its current step (no signing), then asks vAPI to abandon with proof: "expired-authorization"; vAPI abandons only after a complete chain scan and a confirmed-block check that the authorization expired and its nonce is unused. recovered continues without a new signature; scanning is polled, then stops with "nothing new was signed".
  • no hosted operation: USDC authorizationState read at a confirmed block past validBefore, block hash rechecked.
    Then the old spend reservation is released (also legacy rows without a task key) and the run asks for a new authorization under a fresh key. A saved create-pool transaction no longer blocks this.

Tests

packages/core/src/tasks/v2-execution.test.ts: red first (15 failed on 0.17.4), 178 pass; core suite 2,627 pass (--testTimeout=15000; two unrelated swarm tests time out at 5 s under load); typecheck, lint, prettier, lint:copy, build pass.

Review

Built by Codex (gpt-6.2-sol); cross-family review by Claude Opus: 2 blocking + 5 non-blocking → one repair → narrow re-review: all fixed, no new blocking finding.

follow-up: if the signature upload reached vAPI but its response was lost before the hosted operation id was saved locally, the chain proof still holds, but a hosted operation that keeps the slot can refuse the fresh prepare.

🤖 Generated with Claude Code

vapi-development and others added 2 commits December 3, 2026 16:48
A signed V2 funding authorization that expired before it was used blocked every rerun
of vapi task fund (v2_plan_mismatch on the elapsed window). Once vAPI abandons the
hosted operation with proof expired-authorization, or USDC shows the nonce unused at a
block past validBefore, the run releases that reservation and asks for a new signature
under a fresh key. A recovered operation continues without signing again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: vAPI Development <336934719+vapi-development@users.noreply.github.com>
Review repair: a saved create-pool transaction no longer keeps the expired funding
authorization; abandonment names the operation's current step after recovering it;
the chain proof reads a confirmed block and rechecks its hash; a scanning answer is
polled; an interrupted signer takes the same proof path; legacy reservations
without a task key are released.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: vAPI Development <336934719+vapi-development@users.noreply.github.com>
@vapi-development
vapi-development force-pushed the fix/expired-signed-funding-authorization branch from 9d2dcfb to 3f2088c Compare December 3, 2026 15:48
@ztsrdev ztsrdev mentioned this pull request Dec 3, 2026
5 of 6 tasks
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