docs: add integration note for SKALE network upstream blocker#486
docs: add integration note for SKALE network upstream blocker#486Prateekiiitg56 wants to merge 8 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdded a docs note on SKALE network support limitations due to upstream Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds documentation clarifying that SKALE network usage is currently blocked by upstream coinbase/x402 network validation, despite Bindu supporting multi-option execution_cost configs.
Changes:
- Adds an “Integration Note” section documenting SKALE support as pending due to upstream
x402limitations. - Calls out that
networkvalues must be limited to what upstreamx402recognizes (until upstream is updated or a local workaround exists).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/PAYMENT.md (1)
107-107: Link to x402 supported networks documentation instead of hardcoding examples.The x402 library is actively evolving (current version 2.7.0; project uses early-alpha 0.2.1), so hardcoded network examples like
base,base-sepolia,ethereum, andpolygonmay become outdated. Reference the CDP facilitator's official network support documentation at https://docs.cdp.coinbase.com/x402/network-support instead, which maintains the authoritative list.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/PAYMENT.md` at line 107, Replace the hardcoded network examples in the line that mentions restricting `network` values (the bullet referencing `network` values such as `base`, `base-sepolia`, `ethereum`, `polygon`) with a single clear instruction to rely on the upstream x402 supported networks and add the authoritative link: "Refer to x402 network support: https://docs.cdp.coinbase.com/x402/network-support" so the doc points readers to the live, maintained list instead of listing example networks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@docs/PAYMENT.md`:
- Line 107: Replace the hardcoded network examples in the line that mentions
restricting `network` values (the bullet referencing `network` values such as
`base`, `base-sepolia`, `ethereum`, `polygon`) with a single clear instruction
to rely on the upstream x402 supported networks and add the authoritative link:
"Refer to x402 network support:
https://docs.cdp.coinbase.com/x402/network-support" so the doc points readers to
the live, maintained list instead of listing example networks.
# Conflicts: # tests/unit/test_execution_cost_multi_option.py
|
Superseded by #534. The upstream blocker described doesn't exist after the x402 v2 migration. |
x402 v2 ships built-in pricing for Base mainnet and Base Sepolia only.
Reaching SKALE / Polygon / Avalanche / Ethereum mainnet etc. needs two
things to line up — a facilitator that supports the chain, and asset
metadata so the price parser maps `"0.01"` to the right ERC-20 contract.
This commit lands the second piece as an operator-extensible config
surface, and ships SKALE Europa as the worked example.
What's new
----------
* `bindu/settings.py::ExtraNetwork`
Pydantic model carrying CAIP-2 + asset address + EIP-712 domain bits
(`asset_name`, `asset_eip712_version`, `asset_decimals`). Field
validators reject malformed CAIP-2 / non-hex asset addresses at
settings-load time so misconfiguration fails early.
* `bindu/settings.py::X402Settings.extra_networks`
Dict keyed on friendly network slug ("skale-europa"). Default ships
one entry — SKALE Europa Hub bridged USDC — mirroring
facilitator.x402.fi's `/supported` metadata exactly. Operators add
more chains by extending the dict.
* `bindu/server/applications.py::_create_payment_requirements`
Plumbed the two ways `extra_networks` matters:
- The friendly → CAIP-2 normaliser now merges built-in mappings
(base, ethereum, …) with operator-supplied ones. Built-ins win
collisions, on purpose — operators can't accidentally re-route
`base-sepolia`.
- For each extra network, registers a money parser on
`ExactEvmServerScheme` via `register_money_parser`. The parser
claims requests for its specific CAIP-2 and returns `None` for
everything else, so the SDK's built-in Base parser still wins
for Base.
Why this shape (not the four open PRs that tried something else)
----------------------------------------------------------------
* GetBindu#486 documented SKALE as blocked by `x402.types.SupportedNetworks` —
a symbol that no longer exists after v2. The doc was a snapshot of a
problem v2 removed.
* GetBindu#507 added SKALE to `rpc_urls_by_network` — the dict the v2
migration removed because the facilitator owns RPC now.
* GetBindu#528 added hardcoded `skale_*` fields to `X402Settings`. It works
for one chain but doesn't generalise — and it re-introduced the dead
RPC dict. Plus settings alone don't help: `parse_price()` would still
raise on SKALE because the SDK has no built-in entry for chain
1187947933.
* GetBindu#496 wrapped a stubbed HTTP `GET /supported` health check around a
RAG agent and called it "SKALE integration". No payment actually
gated.
The right shape is operator-extensible networks + a money parser per
chain — same surface works for SKALE today and Polygon / Avalanche / any
EVM tomorrow with no code changes.
Live facilitator situation
--------------------------
Only one public facilitator advertises SKALE chains today:
`https://facilitator.x402.fi`. Coinbase's own facilitator at
`https://x402.org/facilitator` lists Base + non-EVM chains only.
`facilitator.x402.fi`'s cert is currently expired — documented in
`bugs/known-issues.md` as `skale-facilitator-cert-expired` (low/ops).
The shipped Bindu defaults still point at Coinbase; operators that want
SKALE set `X402__FACILITATOR_URL` themselves after reading the doc.
Tests
-----
* `tests/unit/server/middleware/x402/test_extra_networks.py` (11 tests)
Schema validation (CAIP-2 format, hex asset, decimal cap), money parser
registration, network-falls-through behavior, decimal-other-than-6
scaling (WETH 18-decimals case), independence of multiple parsers,
and confirmation that the shipped SKALE Europa default matches
facilitator.x402.fi's advertised asset.
* `tests/integration/x402/test_skale_facilitator_supported.py` (2 tests)
Live smoke against `facilitator.x402.fi/supported`. Opt-in
(`X402_NETWORK_TESTS=1`) so CI doesn't depend on a third-party with
an expired cert. Asserts (a) facilitator still advertises SKALE
Europa at the CAIP-2 we ship, (b) the asset metadata
(decimals/name/version) matches our `ExtraNetwork` default — if any
of those drift the test fires before agents start collecting
signature mismatches in prod.
* `pytest.ini`: new `network` marker for opt-in live-external tests.
Verified
--------
* 980 unit + integration tests pass (969 baseline + 11 new).
* ty: All checks passed (0 diagnostics).
* ruff clean.
* Pre-commit hooks all pass end-to-end (no --no-verify).
* Live smoke against facilitator.x402.fi confirms our shipped SKALE
Europa defaults match what the facilitator advertises.
Closes-out: GetBindu#486 (stale upstream-blocker note), GetBindu#507 (dead RPC dict
re-add), GetBindu#528 (hardcoded one-chain settings) — this PR is the
operator-extensible alternative all three were reaching toward.
Related: GetBindu#496 RAG router agent — the routing example is still useful,
but its SKALE story should be rewritten on top of this commit (drop
the stub health check, use the `X402Middleware` directly on the
premium endpoint).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
okay |
Summary
In PR #342, I added support for defining multiple payment options by allowing
execution_costto accept a list. While the Bindu agent framework is now completely future-ready to handle any combination of networks and assets (like SKALE or Ethereum), direct SKALE support is currently blocked by an upstream dependency.This PR adds an Integration Note to the payments documentation explaining that limitation.
Problem
The upstream
coinbase/x402python package (which Bindu uses to format the payment headers) uses a hardcoded list ofSupportedNetworks. If an agent configures"network": "skale-europa", the upstream package crashes before the payment can be routed because it does not recognize the chain ID or token contract.Changes
docs/PAYMENT.mdexecution_costarrays (from PR Multi-Option - Let Agents Accept Multiple Payment Currencies #342).Integration Note: SKALE Network Support (Pending / Upstream Blocker)section.networkvalues to those natively supported byx402(e.g.base,ethereum) until an upstream contribution or a controlled local bypass is merged.Linked Issue/PR
execution_costoptions)Checklist
Summary by CodeRabbit