Conversation
Zebra calls throw a typed ZcashRpcError instead of returning empty data, retry after a 429 with backoff, and report unsupported methods so address pages can degrade on hosted gateways.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the Zcash data layer:
ZcashAdapterover the Zebra RPC.DataServicebuilds that adapter fortype: "zcash"networks.There is no UI yet; the pages land in the next PRs of the stack.
The adapter is designed around hosted gateway limits. Tatum allows about 5 requests per minute per IP and blocks the address index:
getblockas decimal strings, so one block costs one call, with nogetblockhashor header round trip.ZcashRpcError(unsupported,rateLimitedorfailed) instead of returning empty data.ok,unsupportedorerror), so pages can degrade when the address index is blocked.Related Issue
Part of #398. Stacked on #405.
Type of Change
Changes Made
src/types/index.ts:NetworkTypegains"zcash", plus new Zcash types for blocks, transactions, shielded bundles, the mempool and addresses. Amounts are zatoshi integers.src/services/adapters/ZcashAdapter/:src/utils/zcashUtils.ts:t1/t3/tm/t2,zs/ztestsapling,u/utest,zc/ztandtex/textestprefixes.src/utils/zcashFormatters.tsandsrc/config/zcashConstants.ts.AdapterFactory.createZcashAdapter.DataServicebuilds aZcashClientthroughClientFactory(registry routing), and exposesisZcash()andgetZcashAdapter().isZcashNetwork()helper.MetadataService: Zcash genesis hashes now map torpcs/zec/{mainnet,testnet}.json. Before, they were dropped because they didn't match the BTC mapping.rpcStorage: built-in Tatum zebrad defaults for both networks..claude/rules/architecture.md: documentsZcashClientandZcashAdapter.Screenshots (if applicable)
N/A (no UI changes)
Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsnpm run test:runAdditional Notes
36a167f6…ce2e3is Ironwood only, with emptyvinandvout. Fee: 10,000 zat.c973d2f1…4aa7dbis Sapling plus Ironwood. Fee: 20,000 zat.zcashUtils.test.ts, 16 inZcashAdapter.test.ts). The full suite passes with 148 tests.zecandtzecnetwork entries.trees.ironwoodaren't modelled.RPC errordrops the JSON-RPC error code.