Skip to content

docs: add integration note for SKALE network upstream blocker#486

Closed
Prateekiiitg56 wants to merge 8 commits into
GetBindu:mainfrom
Prateekiiitg56:Multiple-Payment
Closed

docs: add integration note for SKALE network upstream blocker#486
Prateekiiitg56 wants to merge 8 commits into
GetBindu:mainfrom
Prateekiiitg56:Multiple-Payment

Conversation

@Prateekiiitg56
Copy link
Copy Markdown
Contributor

@Prateekiiitg56 Prateekiiitg56 commented Apr 20, 2026

Summary

In PR #342, I added support for defining multiple payment options by allowing execution_cost to 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/x402 python package (which Bindu uses to format the payment headers) uses a hardcoded list of SupportedNetworks. 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.md
    • Added documentation showing how to use the new multi-option execution_cost arrays (from PR Multi-Option - Let Agents Accept Multiple Payment Currencies #342).
    • Added a Integration Note: SKALE Network Support (Pending / Upstream Blocker) section.
    • Explicitly documents that while Bindu's config is ready, users must restrict network values to those natively supported by x402 (e.g. base, ethereum) until an upstream contribution or a controlled local bypass is merged.

Linked Issue/PR

Checklist

  • Documentation updated
  • Human verification completed

Summary by CodeRabbit

  • Documentation
    • Added an integration note: SKALE network support is currently pending due to upstream network validation; restrict execution_cost.network to recognized networks with configured RPC URLs (examples: base, base-sepolia, ethereum). Other networks may require additional RPC setup; tracking upstream resolution or local patch options.
  • Tests
    • Marked certain hardcoded payment addresses in tests as allowlisted secrets for test hygiene.

Copilot AI review requested due to automatic review settings April 20, 2026 13:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added a docs note on SKALE network support limitations due to upstream x402 hardcoded networks, and annotated hardcoded pay_to_address literals in a unit test with # pragma: allowlist secret.

Changes

Cohort / File(s) Summary
Documentation Update
docs/PAYMENT.md
Added "Integration Note: SKALE Network Support (Pending / Upstream Blocker)" explaining that execution_cost[].network values must match networks recognized by upstream x402 (hardcoded SupportedNetworks); SKALE identifiers will cause process_price_to_atomic_amount to fail until upstream or local fixes and RPC configuration in Bindu are applied.
Test Annotation
tests/unit/test_execution_cost_multi_option.py
Appended # pragma: allowlist secret inline comments to hardcoded pay_to_address string literals in _SINGLE_COST, _COST_ETH, and the test_backward_compat_flat_args call. No functional changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I thumped a note upon the page,

SKALE skips past the upstream cage,
x402 keeps lists so tight,
I nudge configs by moonlight,
Patch or wait — I'll hop with glee.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description addresses the core problem and change, but omits several required template sections such as Change Type, Scope, Security Impact, Verification, and Human Verification details. Complete the missing template sections: mark Change Type (Documentation), Scope (Documentation), verify Security Impact section, and provide specific Human Verification details about what was tested.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding documentation about an upstream blocker for SKALE network support.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 x402 limitations.
  • Calls out that network values must be limited to what upstream x402 recognizes (until upstream is updated or a local workaround exists).

Comment thread docs/PAYMENT.md Outdated
Comment thread docs/PAYMENT.md Outdated
Comment thread docs/PAYMENT.md Outdated
Comment thread docs/PAYMENT.md
Prateekiiitg56 and others added 2 commits April 20, 2026 19:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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, and polygon may 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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eb01915f-e29b-443f-96f1-ac22f0560743

📥 Commits

Reviewing files that changed from the base of the PR and between aa3c420 and dbb3145.

📒 Files selected for processing (1)
  • docs/PAYMENT.md

@raahulrahl
Copy link
Copy Markdown
Member

Superseded by #534. The upstream blocker described doesn't exist after the x402 v2 migration.

@raahulrahl raahulrahl closed this May 12, 2026
Subhajitdas99 pushed a commit to Subhajitdas99/Bindu that referenced this pull request May 13, 2026
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>
@Prateekiiitg56
Copy link
Copy Markdown
Contributor Author

okay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants