Repository navigation
fix(market): no sales to Tier A jurisdictions - #30
Merged
Merged
Conversation
Nirium's Restricted Jurisdictions & Sanctions Policy (§2) gives Tier A no access to any Nirium service, paid or free, and the market sells data for real USDC on mainnet with no IP check. The market now answers 451 to Cuba, Iran, North Korea, Syria, Afghanistan, Myanmar, Russia, Belarus and China on every route except /health, with the same countries and geoip-lite data as the Nirium node. Tier B is not restricted here (the policy closes only Payouts and Treasury there). trust proxy 1 reads the client IP from Fly's X-Forwarded-For hop. geoip-lite pinned at 2.0.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
M0nsxx
approved these changes
Nov 27, 2026
M0nsxx
left a comment
Member
There was a problem hiding this comment.
AI-assisted review (Claude)
Read the diff: market/geo.mjs adds blockTierA with the same Tier A countries and geoip-lite 2.0.3 as the node, mounted before every route except /health with trust proxy 1, and the Dockerfile now copies geo.mjs. Tests show Iran, North Korea and China get 451 on the info and paid routes and the US and Mexico get 200. npm test 7/7, and CI including market-image is green. Approve.
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.
Found in the 27 Nov legal check: Nirium's Restricted Jurisdictions & Sanctions Policy gives Tier A no access to any Nirium service, paid or free, and this market sells data for real USDC on mainnet with no IP check at all.
avalanche/market/geo.mjs:blockTierA()answers 451 (same JSON as the Nirium node) to Cuba, Iran, North Korea, Syria, Afghanistan, Myanmar, Russia, Belarus and China, on every route except/health(Fly's checks). Same country set and the samegeoip-litedata as the node (Eras256/nirium-core-private#293). Unknown country passes, as the policy's §7 says geolocation is imperfect.server.mjs:app.set("trust proxy", 1)soreq.ipis the client from Fly'sX-Forwarded-Forhop, thenapp.use(blockTierA())before every route.geoip-litepinned at 2.0.3 (same as the node); the Dockerfile copiesgeo.mjs.test/geo.test.mjs, real app and real geoip data): Iran, North Korea and China get 451 on/,/v1/market/infoand the paid/v1/market; the US and Mexico get 200;/healthstays 200 from Iran; the country list matches the node.npm test7/7.Needs a market redeploy (bluegreen) to take effect.
🤖 Generated with Claude Code