Repository navigation
fix: never split to a builder payout USDC refuses - #60
Merged
Merged
Conversation
A PushSplit pays every recipient in one distribute and is ownerless, so a builder payout that USDC refuses (the USDC contract itself, or a blacklisted address) would make every distribute revert and leave each payment carrying that code stuck in the split, the seller's share too. Screen the registry payout before building the split (Python and TS): the zero address and the USDC contract are blocked outright, anything else is checked with USDC.isBlacklisted. A blocked payout pays the seller in full with a new "blocked" status, held in the short-TTL negative cache. A failed screen read falls back to the seller with status "error", like other lookup failures. Also run the Python Affiliation.pay_to resolve in a worker thread, so its blocking RPC reads no longer stall the event loop.
Merged
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.
What
A builder payout that USDC will not pay (the USDC contract itself, or an address USDC has blacklisted) could become a recipient of the per-pair PushSplit. The split pays every recipient in one
distributeand is ownerless, so every distribute would revert and each payment carrying that code would stay in the split, the seller's share included.Fix (Python and TS)
resolver.payout_blocked/Affiliation.payoutBlocked: the zero address and the USDC contract are blocked outright; any other payout is checked withUSDC.isBlacklisted(on Base, USDC reports its own address as blacklisted too).resolver.resolvereturnspayout_blocked;split.resolve_and_plandrops a blocked payout, so the seller is paid in full.X-Builder-Code-Statusvalueblocked. It sits in the short-TTL negative cache likeunregistered, so a fixed payout is picked up after the TTL.error, like other lookup failures.Affiliation.pay_tonow runs the resolve in a worker thread (asyncio.to_thread), so its blocking RPC reads no longer stall the event loop.Tests
blockedand no split address is predicted; blocked codes come from the negative cache; a failed screen read giveserror. Plus resolver unit tests for the screen and a test thatpay_tokeeps the event loop free.Not in scope: the positive cache has no TTL, so a payout blacklisted after it was cached is only re-screened on restart or
clear_cache().Need help on this PR? Tag
@codesmith-botwith what you need.