Skip to content

Add celestia (Celestia DA JSON-RPC) - #894

Open
l0gun0v wants to merge 2 commits into
masterfrom
add-celestia
Open

Add celestia (Celestia DA JSON-RPC)#894
l0gun0v wants to merge 2 commits into
masterfrom
add-celestia

Conversation

@l0gun0v

@l0gun0v l0gun0v commented Sep 1, 2026

Copy link
Copy Markdown

Adds native support for the Celestia DA chain (celestia-node JSON-RPC API): celestia (mainnet) and celestia-mocha.

Why native and not suppressed-to-ETHEREUM

The aptos/stellar-style "celestia" -> BlockchainType.ETHEREUM suppression is not enough for a JSON-RPC chain served through nodecore: the ETHEREUM method allowlist rejects every header.*/blob.* call with -32601, and the generic head poll calls eth_getBlockByNumber which the DA node does not serve. So celestia follows the aztec pattern: its own BlockchainType, methods and ChainSpecific.

Changes

  • foundation BlockchainType.kt: CELESTIA(ApiType.JSON_RPC); codegen maps type: celestia to it (submodules bumped to the revisions carrying celestia 1175/10209)
  • upstream/celestia/CelestiaChainSpecific.kt: head via header.LocalHead polling (CometBFT encoding: height is a decimal string, hashes bare hex; commits are final). WS explicitly unsupported — celestia-node subscriptions use the go-jsonrpc channel protocol (xrpc.ch.val), not JSON-RPC subscriptions
  • upstream/celestia/CelestiaLowerBoundBlockDetector.kt: BLOCK lower bound via header.Tail (the node reports its DA pruning window directly; archive bridge reports 1); cached-bound retention on errors, aztec pattern
  • calls/DefaultCelestiaMethods.kt: the 31-method read-only DA surface (header.*, blob.Get*, share.*, das.*, blobstream.*, read-only state.*, node.Ready); write/admin methods excluded — they spend or expose the node's own wallet
  • validators: node.Ready health; chain-id via header.LocalHead → header.chain_id (empty/mismatch is fatal)
  • dispatch: ChainSpecificRegistry, CallTargetsHolder

Testing

  • compileKotlin / compileTestKotlin green; chainscodegen emits CELESTIA__MAINNET(1_175, …, BlockchainType.CELESTIA)
  • live local chain dshackle (proxy) → nodecore → QuickNode DA endpoint: header.NetworkHead returns live mainnet headers, blob.GetAll passes through, blob.Submit rejected with -32601, the head is tracked natively (State of CELESTIA_MAINNET: height=…, status=[OK/1], lag=[0])

Note

Mocha is migrating mocha-4mocha-5 (the live testnet already reports mocha-5; current celestia-node releases cannot join mocha-4 at all). The chain-id fix is a companion PR in drpcorg/public and reaches dshackle with the next routine submodule bump.

Companion PRs: https://github.com/drpcorg/dproxy/pull/2829, drpcorg/nodecore#326, drpcorg/emerald-grpc#168 (merged), drpcorg/public#246 (merged)

denis added 2 commits September 1, 2026 22:56
- bump emerald-grpc (CHAIN_CELESTIA__MAINNET=1175, CHAIN_CELESTIA__MOCHA=10209) and chains.yaml
- codegen type map: celestia served via nodecore, suppressed to ETHEREUM like aptos/stellar
- BlockchainType.CELESTIA + codegen mapping (was suppressed to ETHEREUM)
- CelestiaChainSpecific: head via header.LocalHead polling (CometBFT: height is a
  decimal string, commits are final, no ws subscriptions - go-jsonrpc channels)
- DefaultCelestiaMethods: the 31-method read-only DA surface
- chain-id validation via header.chain_id (empty/mismatch is fatal)
- BLOCK lower bound via header.Tail (archive bridge reports 1)
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