Summary
tools/webhooks/webhook_server.py advertises a large_tx webhook event, but its poller reads balances from /api/balances without any node admin credential support. On the current production node, that URL returns nginx 404; the maintained all-balances endpoint is /wallet/balances/all, which returns a balances envelope and requires X-Admin-Key.
As a result, deployments pointed at the live RustChain node cannot populate _prev_balances, so large_tx events silently never fire.
Steps to reproduce
- Check the endpoint currently used by the webhook dispatcher:
curl -sk -i "https://rustchain.org/api/balances?limit=5"
-
Observe that the live node returns an nginx 404 HTML response.
-
Check the current all-balances endpoint:
curl -sk -i "https://rustchain.org/wallet/balances/all"
- Observe the endpoint exists but correctly requires admin auth:
{"ok":false,"reason":"admin_required"}
- Review the dispatcher source:
_check_large_tx() calls _get("/api/balances"), and RustChainPoller has no way to send a node X-Admin-Key for admin read endpoints.
Expected behavior
The webhook dispatcher should be able to poll the current batch-balance endpoint when configured with a node admin key, parse the current balance response envelope, and emit large_tx events when a miner balance delta crosses large_tx_threshold.
Public node reads such as /health, /headers/tip, /api/stats, and /api/miners should not receive the admin key unnecessarily.
Actual behavior
large_tx polling requests a stale/non-routed /api/balances path and receives no usable balance list. Since _prev_balances remains empty or unchanged, balance-change notifications are effectively disabled for live-node deployments.
Impact
Low-to-medium operational reliability issue: one of the webhook dispatcher's documented event types is non-functional against the current node routing/auth shape. Operators relying on large_tx notifications would miss large wallet movements without an explicit error.
Fix PR
#7062
The PR:
- adds optional
RUSTCHAIN_NODE_ADMIN_KEY / --node-admin-key support;
- sends
X-Admin-Key only for explicit admin node reads;
- switches
large_tx polling to /wallet/balances/all;
- parses current
balances envelopes and amount_i64 micro-RTC rows;
- adds focused regression tests.
Validation
PYTHONPATH=tools/webhooks python -m pytest -q tools/webhooks/test_webhook_server.py
# 6 passed
python -m py_compile tools/webhooks/webhook_server.py tools/webhooks/test_webhook_server.py
git diff --check -- tools/webhooks/webhook_server.py tools/webhooks/test_webhook_server.py
Payout handle if accepted under #305: github:pqmfei.
Summary
tools/webhooks/webhook_server.pyadvertises alarge_txwebhook event, but its poller reads balances from/api/balanceswithout any node admin credential support. On the current production node, that URL returns nginx404; the maintained all-balances endpoint is/wallet/balances/all, which returns abalancesenvelope and requiresX-Admin-Key.As a result, deployments pointed at the live RustChain node cannot populate
_prev_balances, solarge_txevents silently never fire.Steps to reproduce
curl -sk -i "https://rustchain.org/api/balances?limit=5"Observe that the live node returns an nginx 404 HTML response.
Check the current all-balances endpoint:
curl -sk -i "https://rustchain.org/wallet/balances/all"{"ok":false,"reason":"admin_required"}_check_large_tx()calls_get("/api/balances"), andRustChainPollerhas no way to send a nodeX-Admin-Keyfor admin read endpoints.Expected behavior
The webhook dispatcher should be able to poll the current batch-balance endpoint when configured with a node admin key, parse the current balance response envelope, and emit
large_txevents when a miner balance delta crosseslarge_tx_threshold.Public node reads such as
/health,/headers/tip,/api/stats, and/api/minersshould not receive the admin key unnecessarily.Actual behavior
large_txpolling requests a stale/non-routed/api/balancespath and receives no usable balance list. Since_prev_balancesremains empty or unchanged, balance-change notifications are effectively disabled for live-node deployments.Impact
Low-to-medium operational reliability issue: one of the webhook dispatcher's documented event types is non-functional against the current node routing/auth shape. Operators relying on
large_txnotifications would miss large wallet movements without an explicit error.Fix PR
#7062
The PR:
RUSTCHAIN_NODE_ADMIN_KEY/--node-admin-keysupport;X-Admin-Keyonly for explicit admin node reads;large_txpolling to/wallet/balances/all;balancesenvelopes andamount_i64micro-RTC rows;Validation
Payout handle if accepted under #305:
github:pqmfei.