Skip to content

[codex] Fix facilitator RNG and settlement response inconsistencies#1861

Draft
ayushozha wants to merge 1 commit intocoinbase:mainfrom
ayushozha:combined-contrib-1845-1817-574-894-clean
Draft

[codex] Fix facilitator RNG and settlement response inconsistencies#1861
ayushozha wants to merge 1 commit intocoinbase:mainfrom
ayushozha:combined-contrib-1845-1817-574-894-clean

Conversation

@ayushozha
Copy link
Copy Markdown
Contributor

Summary

Root Cause

  • the Go SVM facilitator still used math/rand for fee-payer selection in financial infrastructure code
  • settlement response types and examples treated missing failure data as required empty strings, which drifted across SDKs and docs
  • the Express query-param bug was fixed at the adapter layer, but there was no higher-level regression coverage guarding the paywall URL flow

Impact

  • Go SVM fee-payer selection now uses cryptographic randomness
  • failed settlement responses no longer need empty-string transaction hashes and can omit payer information when unknown
  • client, server, and spec behavior is aligned across the reference SDKs
  • paywall generation keeps full resource URLs, including query strings

Validation

  • go test ./mechanisms/svm/exact/facilitator ./mechanisms/svm/exact/v1/facilitator ./http
  • uv run pytest tests/unit/http/test_utils.py
  • pnpm --filter @x402/core exec vitest run test/unit/http/httpFacilitatorClient.test.ts test/unit/http/x402HTTPResourceService.test.ts
  • pnpm --filter @x402/paywall exec vitest run src/builder.test.ts

@cb-heimdall
Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

@ayushozha is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added specs Spec changes or additions typescript go sdk Changes to core v2 packages python labels Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go python sdk Changes to core v2 packages specs Spec changes or additions typescript

Development

Successfully merging this pull request may close these issues.

2 participants