Skip to content

feat: Starknet family support (starknet, starknet-sepolia)#285

Open
artemrootman wants to merge 4 commits into
arootman/ripple-supportfrom
arootman/starknet-support
Open

feat: Starknet family support (starknet, starknet-sepolia)#285
artemrootman wants to merge 4 commits into
arootman/ripple-supportfrom
arootman/starknet-support

Conversation

@artemrootman

Copy link
Copy Markdown
Contributor

What

Adds the Starknet blockchain family (BlockchainType = "starknet"). Also fixes the current half-registered state where a configured starknet upstream fails at startup with no method spec with name ''.

Design doc: docs/superpowers/specs/2026-07-17-starknet-support-design.md.

Stacked on #284 (ripple family); will retarget as the stack merges.

How

The most standard family so far — plain JSON-RPC 2.0, no envelope quirks, no translations:

  • starknet_specific: poll-based latest head via starknet_getBlockWithTxHashes("latest"); poll-only (spec-v0.8 WS subscriptions are a follow-up).
  • starknet_validations: real chain-id validation via starknet_chainId (dshackle hardcodes the response and validates nothing) — the hex-felt values (SN_MAIN/SN_SEPOLIA) already live in chains.yaml; syncing health handles all three result forms (bare false/true and the sync object with hex-or-numeric block fields) with the lag threshold.
  • starknet_labels: two-probe client identity (pathfinder_versionjuno_version fallback) as a direct LabelsDetector implementation.
  • starknet_bounds: verified-archive bound — probes block 1 and emits STATE/BLOCK=1 only on success (dshackle hardcodes 1 blindly, which misroutes against pruned nodes); pruned nodes fall back to UnknownBound.
  • Method spec: 25-method dshackle-parity surface, not-null dispatch on block/tx reads and the three add*Transaction submits — deliberately not broadcast: starknet answers identical resubmission with DUPLICATE_TX=59 (an error, unlike EVM's success echo), so fan-out manufactures errors; this is the very reason dshackle's starknet broadcast is broken ("fix broadcast on starknet" TODO).

Testing

  • Unit tests across all new packages (incl. hex-vs-numeric sync fields, mainnet-vs-sepolia chain-id cross-check, pruned-node bound fallback).
  • Live corpus against the production sepolia node: 28/29 identical byte-exact (the one "FAIL" was a wrong test premise — juno_version is internal-only, matching dshackle). Mainnet corpus impossible today (no node deployed); SN_MAIN covered by unit tests. Details in the design doc.

Fixes the half-registered state where a starknet upstream died with
"no method spec with name ''" - the BlockchainType existed but nothing else.

- starknet_specific: poll-based latest head via getBlockWithTxHashes
  (dshackle parity), poll-only (spec-v0.8 WS is a follow-up).
- starknet_validations: real chain-id validation via starknet_chainId
  (dshackle hardcodes the response and validates nothing) and syncing
  health handling all three result forms (false/true/sync object, hex or
  numeric block fields, lag threshold).
- starknet_labels: two-probe client identity (pathfinder_version ->
  juno_version fallback) as a direct LabelsDetector implementation.
- starknet_bounds: verified-archive bound - probes block 1 and emits
  STATE/BLOCK=1 only on success (dshackle hardcodes 1 blindly); pruned
  nodes fall back to UnknownBound with a logged follow-up.
- starknet method spec: the 25-method dshackle-parity surface, not-null
  dispatch on block/tx reads and the three add*Transaction submits - NOT
  broadcast: starknet returns DUPLICATE_TX=59 on identical resubmission,
  fan-out would manufacture errors (the very reason dshackle's broadcast
  is broken there).
- registry: getMethodSpecName starknet case + factory case.
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.

1 participant