near rpc for the wallet: reads, transaction submission and status, off the mesh #73

Closed
opened 2026-10-09 08:46:16 +00:00 by grenade · 3 comments
Owner

Part of #71.

The operator's scripts read from gargravarr, frankie and quadbrat on the mesh, which users cannot reach. The wallet needs a NEAR endpoint for view calls (intents.near balances, Ref pool state), transaction submission and status. Options: a public near.blackbeard.observer like the Quantus one, throttled the same way, or public RPCs (FastNEAR, near.org, dRPC) with fallbacks. Operator decision on #71. A NearRpc port in wallet-core with the adapter in wallet-data, chosen by profile like the Quantus endpoint.

Part of #71. The operator's scripts read from gargravarr, frankie and quadbrat on the mesh, which users cannot reach. The wallet needs a NEAR endpoint for view calls (`intents.near` balances, Ref pool state), transaction submission and status. Options: a public `near.blackbeard.observer` like the Quantus one, throttled the same way, or public RPCs (FastNEAR, near.org, dRPC) with fallbacks. Operator decision on #71. A `NearRpc` port in wallet-core with the adapter in wallet-data, chosen by profile like the Quantus endpoint.
grenade added the child label 2026-10-09 08:46:16 +00:00
Author
Owner

Survey, 2026-10-09. There is already a public NEAR name, but it only covers part of what the wallet needs.

What exists

  • near.blackbeard.observer on oolon goes to near.internal on hanzalova, which goes to frankie only:
    • limits: 5 r/s per client, 30 r/s in total, 8 connections, client_max_body_size 64k;
    • only POST /, GET /status and GET /health are allowed;
    • hosting-provider networks are denied.
    • 64k is fine: an ML-DSA transaction is about 5.6 kB.
  • Our nodes, all nearcore 2.13.4 and synced, cover shards 4, 7, 8, 10 and 12 out of mainnet's 10. gargravarr and quadbrat are in no nginx upstream.
  • Mainnet shard layout V3, shards [10, 11, 1, 8, 9, 6, 7, 4, 12, 13], boundary accounts 650 | aurora | aurora-0 | earn.kaiching | game.hot.tg | game.hot.tg-0 | kkuuue2akv_1630967379.near | tge-lockup.sweat | wallet.ka.
account role in the route shard our node
intents.near verifier: balances, every leg 7 frankie
dclv2.ref-labs.near pool quotes and swaps 8 gargravarr
qtc.omft.near, near (registrar) QTC token, account creation 4 gargravarr
native USDC 17208628… USDC token 10 quadbrat
wrap.near wNEAR; wrapping, and topping up the gas float 13 none
eth-…omft.near etc. other chains' tokens; 1Click's side, not ours 9 none (not needed)
user accounts nonce and gas float for every transaction depends on the name partial

Probe: a node must track every shard a transaction touches to report its outcome

Transaction 6hPyBHEEZUjojJJFGtysmk8zwPaYxSUtjjcUrm3j5S5U: bbspike72.near (shard 8) calls wrap.near.storage_deposit (shard 13), submitted to gargravarr (shards 4 and 8).

  • gargravarr accepted it, and send_tx with wait_until: FINAL timed out (408).
  • Afterwards, gargravarr reports INCLUDED_FINAL, status Started, 0 receipts. It never learns the result.
  • frankie and quadbrat don't know the transaction.
  • A public RPC reports FINAL, SuccessValue, 4 receipts.

So for a node to report a transaction's outcome, it needs the sender's shard and the shard of every receipt. The pool leg alone runs 7 → 8 → 4 → 7.

What this means

  1. User accounts. An account's shard follows from its name, and implicit hex ids spread over shards 8, 9, 10 and 11. If the wallet assigns names in a range on a tracked shard (bbspike72.near sorts between aurora-0 and earn.kaiching, so shard 8), user accounts stay on shards we run. PQ implicit accounts (NEP-655, protocol 87) need the same check once their id format is final.
  2. One node, or a router. nginx cannot route JSON-RPC by shard. Either one node tracks every shard the route touches, {4, 7, 8, 10, 13} plus the user-account shard (nearcore can track by account: intents.near, dclv2.ref-labs.near, qtc.omft.near, near, wrap.near, USDC). Or a small router dispatches by account, which cannot assemble a transaction's outcome across nodes.
  3. Judging success from state. The wallet can judge most legs by reading the resulting balances on shard 7 rather than asking for the transaction outcome. That keeps it working when the node can't assemble an outcome, and against public RPCs as a fallback.

Operator decision: hardware for a node tracking {4, 7, 8, 10, 13}, or which of the three to grow.

Survey, 2026-10-09. There is already a public NEAR name, but it only covers part of what the wallet needs. ## What exists - `near.blackbeard.observer` on oolon goes to `near.internal` on hanzalova, which goes to **frankie only**: - limits: 5 r/s per client, 30 r/s in total, 8 connections, `client_max_body_size 64k`; - only `POST /`, `GET /status` and `GET /health` are allowed; - hosting-provider networks are denied. - 64k is fine: an ML-DSA transaction is about 5.6 kB. - Our nodes, all nearcore 2.13.4 and synced, cover shards 4, 7, 8, 10 and 12 out of mainnet's 10. gargravarr and quadbrat are in no nginx upstream. - Mainnet shard layout V3, shards [10, 11, 1, 8, 9, 6, 7, 4, 12, 13], boundary accounts `650 | aurora | aurora-0 | earn.kaiching | game.hot.tg | game.hot.tg-0 | kkuuue2akv_1630967379.near | tge-lockup.sweat | wallet.ka`. | account | role in the route | shard | our node | |---|---|---|---| | `intents.near` | verifier: balances, every leg | 7 | frankie | | `dclv2.ref-labs.near` | pool quotes and swaps | 8 | gargravarr | | `qtc.omft.near`, `near` (registrar) | QTC token, account creation | 4 | gargravarr | | native USDC `17208628…` | USDC token | 10 | quadbrat | | `wrap.near` | wNEAR; wrapping, and topping up the gas float | 13 | **none** | | `eth-…omft.near` etc. | other chains' tokens; 1Click's side, not ours | 9 | none (not needed) | | user accounts | nonce and gas float for every transaction | **depends on the name** | partial | ## Probe: a node must track every shard a transaction touches to report its outcome Transaction `6hPyBHEEZUjojJJFGtysmk8zwPaYxSUtjjcUrm3j5S5U`: `bbspike72.near` (shard 8) calls `wrap.near.storage_deposit` (shard 13), submitted to gargravarr (shards 4 and 8). - gargravarr accepted it, and `send_tx` with `wait_until: FINAL` timed out (408). - Afterwards, gargravarr reports `INCLUDED_FINAL`, status `Started`, 0 receipts. It never learns the result. - frankie and quadbrat don't know the transaction. - A public RPC reports `FINAL`, `SuccessValue`, 4 receipts. So for a node to report a transaction's outcome, it needs the sender's shard and the shard of every receipt. The pool leg alone runs 7 → 8 → 4 → 7. ## What this means 1. **User accounts.** An account's shard follows from its name, and implicit hex ids spread over shards 8, 9, 10 and 11. If the wallet assigns names in a range on a tracked shard (`bbspike72.near` sorts between `aurora-0` and `earn.kaiching`, so shard 8), user accounts stay on shards we run. PQ implicit accounts (NEP-655, protocol 87) need the same check once their id format is final. 2. **One node, or a router.** nginx cannot route JSON-RPC by shard. Either one node tracks every shard the route touches, `{4, 7, 8, 10, 13}` plus the user-account shard (nearcore can track by account: `intents.near`, `dclv2.ref-labs.near`, `qtc.omft.near`, `near`, `wrap.near`, USDC). Or a small router dispatches by account, which cannot assemble a transaction's outcome across nodes. 3. **Judging success from state.** The wallet can judge most legs by reading the resulting balances on shard 7 rather than asking for the transaction outcome. That keeps it working when the node can't assemble an outcome, and against public RPCs as a fallback. Operator decision: hardware for a node tracking `{4, 7, 8, 10, 13}`, or which of the three to grow.
Author
Owner

Live, 2026-10-09: s<id>.near.blackbeard.observer, one public name per shard our nodes track (blackbeard/observer commit 36bea6b, infra-setup.sh --role nodes):

name node answers for
s4.near.blackbeard.observer gargravarr qtc.omft.near, near (the registrar)
s7.near.blackbeard.observer frankie intents.near
s8.near.blackbeard.observer gargravarr dclv2.ref-labs.near, bbspike72.near
s10.near.blackbeard.observer quadbrat native USDC
s12.near.blackbeard.observer quadbrat v2.ref-finance.near
s13.near.blackbeard.observer frankie nothing yet: UNAVAILABLE_SHARD for wrap.near
  • Cloudflare CNAMEs to bl.thgttg.com; one Let's Encrypt lineage near-shards.blackbeard.observer, valid to 2027-01-07.
  • Limits: the same per-client budget as near.blackbeard.observer (shared with it), plus a ceiling of 30 r/s per node across all clients.
  • oolon reaches the nodes directly on 24403. That needed a near-rpc firewalld rule for 10.3.1.101 on frankie and gargravarr, and frankie/gargravarr.hanzalova.internal host overrides on the kosherinata router, which had been missing.

Shard 13 still needs a node. Adding wrap.near to frankie's tracked accounts and restarting stalled the node at the restart height: it stopped applying blocks, and the observer's swap indexer stopped with it. It was reverted after 13 minutes and both recovered. Shard 13 needs a fresh neard (an empty data dir syncs its shards at once), and that needs its own inbound P2P port for state sync.

For the wallet: read the shard layout (EXPERIMENTAL_protocol_config) from any of these names, map the account to its shard, and query s<shard>. Judge each leg by state, not tx_status. Fall back to a public RPC for a shard without a name.

Live, 2026-10-09: **`s<id>.near.blackbeard.observer`**, one public name per shard our nodes track (blackbeard/observer commit 36bea6b, `infra-setup.sh --role nodes`): | name | node | answers for | |---|---|---| | `s4.near.blackbeard.observer` | gargravarr | `qtc.omft.near`, `near` (the registrar) | | `s7.near.blackbeard.observer` | frankie | `intents.near` | | `s8.near.blackbeard.observer` | gargravarr | `dclv2.ref-labs.near`, `bbspike72.near` | | `s10.near.blackbeard.observer` | quadbrat | native USDC | | `s12.near.blackbeard.observer` | quadbrat | `v2.ref-finance.near` | | `s13.near.blackbeard.observer` | frankie | **nothing yet**: `UNAVAILABLE_SHARD` for `wrap.near` | - Cloudflare CNAMEs to `bl.thgttg.com`; one Let's Encrypt lineage `near-shards.blackbeard.observer`, valid to 2027-01-07. - Limits: the same per-client budget as `near.blackbeard.observer` (shared with it), plus a ceiling of 30 r/s per node across all clients. - oolon reaches the nodes directly on 24403. That needed a `near-rpc` firewalld rule for 10.3.1.101 on frankie and gargravarr, and `frankie`/`gargravarr.hanzalova.internal` host overrides on the kosherinata router, which had been missing. **Shard 13 still needs a node.** Adding `wrap.near` to frankie's tracked accounts and restarting stalled the node at the restart height: it stopped applying blocks, and the observer's swap indexer stopped with it. It was reverted after 13 minutes and both recovered. Shard 13 needs a fresh neard (an empty data dir syncs its shards at once), and that needs its own inbound P2P port for state sync. For the wallet: read the shard layout (`EXPERIMENTAL_protocol_config`) from any of these names, map the account to its shard, and query `s<shard>`. Judge each leg by state, not `tx_status`. Fall back to a public RPC for a shard without a name.
Author
Owner

Shard 13 is live. frankie's second neard instance (neard-s13) state-synced through the new WAN forward (24569 → frankie) and has answered for wrap.near since 14:19 on 2026-10-09, within a few blocks of the public RPC's head.

All six s<id>.near.blackbeard.observer names now answer for their shard's accounts.

Shard 13 is live. frankie's second neard instance (`neard-s13`) state-synced through the new WAN forward (24569 → frankie) and has answered for `wrap.near` since 14:19 on 2026-10-09, within a few blocks of the public RPC's head. All six `s<id>.near.blackbeard.observer` names now answer for their shard's accounts.
grenade referenced this issue from a commit 2026-10-09 21:38:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blackbeard/wallet#73