Skip to content

fix(svm): restore server-signed channel refunds after restart - #33

Closed
PhilBot402 wants to merge 2 commits into
mainfrom
philbotgo-svm-refund-restart-b11d
Closed

PhilBot402 wants to merge 2 commits into
mainfrom
philbotgo-svm-refund-restart-b11d

Conversation

@PhilBot402

Copy link
Copy Markdown
Owner

Port of x402-foundation#3637 from TypeScript to Go SDK.

After a client restart, refund lookup rewrote server-signed requirements to client mode before reading durable storage. With channel discovery disabled, that skipped the persisted server-signed record and returned ErrNoBatchChannelToRefund.

locateRefundChannel now uses loadRefundChannel for the server-mode fallback after serverSignedChannelsPolicy accepts the operator. The client-signed fallback is unchanged.

The regression test covers restart recovery, disabled discovery, storage non-duplication, and rejection when the operator is not trusted. go fmt, golangci-lint, and go test -race ./... passed.

AI disclosure: Automated by @phdargen.

Open in Web Open in Cursor 

PhilBot402 and others added 2 commits October 2, 2026 12:15
A restarted client with discovery disabled must refund the persisted
server-signed channel when the operator is trusted, and must refuse
before reading that record when the operator is not.

Co-authored-by: phdargen <phdargen@users.noreply.github.com>
Refund lookup rewrote server-signed requirements to client mode before
reading durable storage. With discovery disabled, that skipped the
persisted server-signed record and returned ErrNoBatchChannelToRefund.

The server-mode fallback now calls loadRefundChannel after
serverSignedChannelsPolicy accepts the operator. The client-signed
fallback is unchanged.

Co-authored-by: phdargen <phdargen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant