Commit Graph
43 Commits
Author SHA1 Message Date
DragonX DevelopersandClaude Opus 5 62358df198 frontend: stop an unconfirmed transaction from killing the daemon
GetTransaction asserted the height out of getrawtransaction's reply
without checking it:

    txHeight = txinfo.(map[string]interface{})["height"].(float64)

dragonxd emits "height" only for a transaction that is in a block --
rawtransaction.cpp puts it inside `if (!hashBlock.IsNull())` -- so every
mempool transaction comes back without the key. The assertion then runs
nil.(float64) and panics. Nothing recovers it: grpc-go v1.24.0 installs
no recovery interceptor (there is no recover() in its server.go) and
this daemon adds none, so the panic takes down the whole process and
every wallet connected to that endpoint with it.

Any client can trigger it deliberately: broadcast a transaction, then
ask for it before it is mined. GetMempoolStream, added in b1b0d45,
hands out unconfirmed txids by design, so ordinary 0-conf use walks
straight into it.

Verified against a live mempool transaction on this node, whose reply
has neither "height" nor "blockhash": the old expression panics with
"interface conversion: interface {} is nil, not float64"; the new one
returns cleanly.

An unconfirmed transaction is now reported as tip+1, which is what
GetMempoolStream already advertises for the same transactions
(mempool.go:109).

Also harden GetSaplingInfo, which had six more unchecked assertions on
the getblockchaininfo reply. Those run on the block-ingestor goroutine,
where a panic is equally fatal. The top-level object is asserted once
and every field is read with the comma-ok form; a missing field now
degrades instead of crashing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FU87LdsJZiZkfq1eXubpeo
2026-08-26 10:27:12 -05:00
DanSandClaude Opus 4.8 2bab58c6d2 lightwalletd: adaptive reorg-lag tip + non-blocking startup coinsupply
Adaptive-lag: advertise a tip that trails the real tip by a reorg-rate-driven
lag (GetLatestBlock/GetLightdInfo) so wallets anchor shielded spends at a
settled height during reorg churn. Configurable via
-adaptive-lag/-lag-min/-lag-max/-lag-window; monitor_lwd.sh runs
-lag-min 4 -lag-max 12 -lag-window 30.

Startup coinsupply: the informational startup coinsupply RPC (result used only
for a log line) blocked the gRPC bind for minutes on a node whose supply index
is cold, keeping the lite endpoint down on every restart while it also starved
the block-cache ingestor. Run it in a goroutine so the bind is never blocked;
clients still get coinsupply on demand via the GetCoinsupply RPC.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 01:05:10 -05:00
DanSandClaude Opus 4.8 b1b0d4559b feat(frontend): implement GetMempoolStream for 0-conf lightwallet txs
The CompactTxStreamer service did not implement any mempool RPC, so
lightwallets (SilentDragonXLite / ObsidianDragonLite) received UNIMPLEMENTED
from get_mempool_stream and permanently stopped their mempool monitor. As a
result the lite wallet could not see 0-confirmation transactions and only
surfaced incoming shielded chat messages after they were mined (~1 block).

Add GetMempoolStream(Empty) returns (stream RawTransaction). A single
process-wide monitor (frontend/mempool.go) polls the node's getrawmempool and
fetches each new tx via getrawtransaction (full serialized bytes, so shielded
memos are preserved -- CompactTx's 52-byte prefix would not carry a memo), then
fans the tx out to every subscribed stream. This avoids polling the node once
per connected wallet: N clients share one poll loop. The monitor starts lazily
on the first subscription, idles without touching the node when no clients are
connected, and closes all subscriber streams when a new block is mined (the
semantics the client's monitor loop expects; the client re-syncs and reconnects).

Purely additive and wire-compatible: RawTransaction field numbers and the
cash.z.wallet.sdk.rpc package match the deployed client; existing clients that
never call GetMempoolStream are unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 20:10:26 -05:00
DanS ec1c479156 Increase block cache size to 400k for faster wallet sync
- Increase default cache-size from 40,000 to 400,000 blocks
- Add Python gRPC protobuf bindings for testing
2026-03-21 03:50:55 -05:00
dan-s daab197a01 update for dragonx binary changes, added monitor script 2026-03-04 15:28:02 -06:00
jahway603 b33b4b476f working towards lightwalletd deb package 2021-09-29 02:04:48 -04:00
jahway603 0f21f457a6 changed DenioD's github lightwalletd links to git.hush.is lightwalletd links 2020-11-27 22:13:24 -05:00
Dennis Netterdon c952f7e3d9 tix taddr 2020-05-15 11:19:41 +02:00
Dennis Netterdon da68a5368b tix taddr 2020-05-15 10:56:29 +02:00
Denio 01e1d766a0 add coinsupply rpc to lightwalletd 2019-12-05 21:37:35 +01:00
Denio 0978322f62 add longestchain and notarized to lightinfod 2019-12-02 11:42:50 +01:00
Denio a269cd1e6b add difficulty to lightdinfo 2019-12-02 10:35:38 +01:00
DenioD a31dd97aa8 vendor rebranding 2019-10-26 21:39:27 +02:00
DenioD f6fa52fde1 port to hush 2019-10-15 14:38:55 +02:00
Larry Ruane 5f4334ff6d add bytestring tests 2019-09-26 11:33:24 -07:00
Aditya Kulkarni a8cc2424a2 Thread safe cache with separate ingestor 2019-09-25 21:15:32 -07:00
Aditya Kulkarni fbb75e8f20 Return consensusBranchId 2019-09-25 17:46:05 -07:00
Aditya Kulkarni 6f56b8b8e9 Store compactBlocks 2019-09-25 17:18:27 -07:00
Aditya Kulkarni d503752588 Block Cache 2019-09-25 15:55:37 -07:00
Aditya Kulkarni d56fe7bf1a Remove SQL from grpc server 2019-09-25 13:28:55 -07:00
Aditya Kulkarni 3eaabea547 GetTransaction from zcashd instead of store 2019-09-25 12:10:32 -07:00
Aditya Kulkarni 8421285313 Merge error codes 2019-09-25 11:44:42 -07:00
Aditya Kulkarni d59757571d Remove UTXOs call 2019-09-25 11:43:54 -07:00
Aditya Kulkarni f0ff091f7b Log sapling height error 2019-09-25 11:35:52 -07:00
Aditya Kulkarni cf0b87ac9b Log sapling height 2019-09-20 14:49:47 -07:00
Aditya Kulkarni 3b4573c4f0 Add chainname and activation height to getinfo 2019-09-18 21:16:15 -07:00
Aditya Kulkarni e723c4e1d8 Return tx heights 2019-09-17 13:26:23 -07:00
Aditya Kulkarni d36126ba9d Add transparent txns 2019-09-13 16:02:58 -07:00
Aditya Kulkarni 7644852fc6 Fix hash encoding, change module names 2019-09-12 12:08:53 -07:00
Aditya Kulkarni 8edf85483b Read UTXOs from RPC 2019-09-11 17:06:29 -07:00
Aditya Kulkarni b4796bc67e New RPC call 2019-09-10 16:34:01 -07:00
Aditya Kulkarni 0c85de50ad New RPC call 2019-09-05 11:48:32 -07:00
George Tankersley e910ee0475 frontend: increase GetBlockRange timeout to 30 seconds
The previous shorter timeout was causing failures in testing and
production.
2019-02-14 18:48:41 +00:00
George Tankersley 0cb0bb51af frontend: implement SendTransaction 2019-02-14 00:18:15 +00:00
George Tankersley d08abe82b4 walletrpc: improve protobuf/grpc package naming 2019-02-14 00:18:14 +00:00
George Tankersley 7726a6752d cleanup: rename package and vendor dependencies for old go versions
Fixes #8 and begins to address deployability.
2019-01-03 19:14:51 +00:00
George Tankersley 09007ad856 storage: small fixes and sqlite3-specific tuning 2018-12-15 20:01:28 +00:00
George Tankersley d4d991a191 frontend, storage: change naming convention for transactions 2018-12-14 21:20:18 -05:00
George Tankersley 0d84493db3 frontend, storage: improve GetBlockRange, fix tests 2018-12-14 20:51:05 -05:00
George Tankersley 313adc8432 frontend: implement GetBlockRange and GetTransaction 2018-12-14 19:19:12 -05:00
George Tankersley f0c2405593 cmd: fix inconsistent logging for binaries 2018-12-11 03:37:42 -05:00
George Tankersley 84e6de593f frontend: remember to close database connections on stop 2018-12-11 03:12:49 -05:00
George Tankersley f6def7cda8 frontend: implement GetLatestBlock, GetBlock; refactoring 2018-12-11 02:32:40 -05:00