feat(license-server): zidecar sync, env config, block-time expiry#3
Merged
Conversation
- Add tower-http CORS (permissive) so browser extensions can fetch - Use JS Number.MAX_SAFE_INTEGER (2^53-1) for friends permanent expiry instead of u64::MAX which loses precision in JSON.parse - Fix route syntax: `:zid` for axum 0.6 compat - Comment out missing workspace members (relay, poker) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous implementation called zebrad's z_listreceivedbyaddress, which doesn't exist — that RPC is zcashd-only. Zebrad is consensus-only with no wallet, so the scan silently returned nothing and licenses were never issued for real payments. Rewrite the payment scanner as a single-FVK watch-only wallet: - Connect to zidecar (gRPC-Web, HTTP/2) instead of zebrad JSON-RPC - Pull compact blocks, decrypt Orchard actions with the license FVK - For matched notes, fetch the full tx via GetTransaction and extract the 512-byte memo via zync-core's extract_enc_ciphertext - Memos starting with "zid" credit the corresponding pubkey - Persist sync height in sled so restarts resume from last block CLI changes: - --zebrad-rpc removed (no longer needed) - --fvk added (96-byte hex Orchard FullViewingKey, env LICENSE_FVK) - --zidecar-url added (default http://127.0.0.1:50051) - --sync-from added (initial sync start block for fresh DBs) Housekeeping: - Comment out bin/relay and bin/poker workspace members (not present) - Remove dead `auth` module declaration from zync-core Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
all important flags now can be input from env (with sensible defaults) .gitignore ignores .env / runtime state (license.db, friends.txt) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- block-time anchor: scanner now fetches the block timestamp via a new ZidecarClient::get_block_time helper (reads TreeState.time) and records it on each ReceivedMemo. - stacking renewals: each payment now adds its own days to the CURRENT expiry (or block time if already expired). - one extra RPC call per credited memo (get_tree_state); Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
Same CI fix as zcli — the local path dep breaks CI which only checks out the zcli repo.
The [patch] at workspace root silently redirected the git osst dep to a sibling zeratul checkout. Works locally, fails in CI which only clones zcli. Leave the patch commented out with a note; devs can uncomment for local zeratul work.
# Conflicts: # Cargo.lock
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.
Summary
.env+ docs — all flags env-backed (ZCLI_SIGNING_KEY,LICENSE_FVK,ZIDECAR_URL, etc.)..env.exampleexplains the signing-key ↔ROTKO_ZCASH_VERIFIERand FVK ↔ROTKO_LICENSE_ADDRESSrelationships;.gitignorecovers secrets + runtime state.ZidecarClient::get_block_timehelper +block_timeonReceivedMemo. Expiry anchors to on-chain block time, not `SystemTime::now()`. DB wipes + rescans no longer refresh the license clock.Test plan
🤖 Generated with Claude Code