feat: index pay.sh channel payouts (add facilitator, fix payout matching) - #1097
Open
fmhall wants to merge 2 commits into
Open
feat: index pay.sh channel payouts (add facilitator, fix payout matching)#1097fmhall wants to merge 2 commits into
fmhall wants to merge 2 commits into
Conversation
Top signer of payment-channels program transactions on mainnet (BcdwLA62UPEAvRn7AWauMUXKtYMXxdLzTPaSQg5tNaFc, active since the program's 2026-06-24 launch). Attribution: the payment-channels README names pay.sh as the protocol built on the program, and the wallet appears as the fee payer in solana-foundation/explorer fixtures. Claude-Session: https://claude.ai/code/session_01NaND1Bpv2PCyAiDa1v6t4K
Live pay.sh distributes pass the merchant's ATA as treasury_token_account, so the same address is accounts[6] and the recipient tail — the old exclude-accounts-4-6 heuristic dropped the genuine payout. Payouts are exactly the escrow legs destined to the dynamic recipient tail (accounts 11..): refunds, the payee implicit remainder, and treasury residuals are never in the tail. Verified against pay.sh mainnet tx J4fFspqR… (extracts the 36,968-unit upto payout; payee remainder and refund excluded); adds a regression test for the treasury==recipient shape. Claude-Session: https://claude.ai/code/session_01NaND1Bpv2PCyAiDa1v6t4K
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Follow-up to #1091. The channels sync deployed cleanly but indexed 0 rows — investigation showed both causes and this PR fixes them:
No configured facilitator signs payment-channels transactions. Sampling all 4,651 mainnet program txs, the top signer is
BcdwLA62UPEAvRn7AWauMUXKtYMXxdLzTPaSQg5tNaFc— pay.sh (Solana Foundation), per the payment-channels README and solana-foundation/explorer fixtures. Added as a facilitator (Solana USDC, first tx window from the program's 2026-06-24 mainnet launch).Extractor bug on real pay.sh transactions: pay.sh passes the merchant's ATA as
treasury_token_account, so the same address is accounts[6] and the recipient tail. The exclude-accounts-4-6 heuristic from feat(svm): index x402 upto and batch-settlement channel payouts #1091 dropped the genuine payout. Payouts are now matched as escrow legs destined to the dynamic recipient tail (accounts 11..), which per the program source is exactly the merchant payout set — refunds, the payee implicit remainder, and treasury residuals are never in the tail.Testing
J4fFspqR…(settle_and_seal + distribute): extracts oneuptopayout of 36,968 units, payer3CaVdQ…→ merchantCs2zdf…; payee remainder and payer refund excluded.pnpm checkgreen.Once merged, the sync-state cutover backfills pay.sh channel history from 2026-06-24 automatically.
https://claude.ai/code/session_01NaND1Bpv2PCyAiDa1v6t4K