feat(tools): add scorer-inspect CLI with text/csv/json output#79
Draft
feat(tools): add scorer-inspect CLI with text/csv/json output#79
Conversation
scorer-inspect is a small standalone CLI for offline diagnostics of LDK serialized scorer files - both the `latest.bin` style payloads served at URLs like api.blocktank.to/scorer-prod or scores.zeusln.com/latest.bin and the bytes returned by Node::export_pathfinding_scores. Both wire formats are identical in current LDK (ProbabilisticScorer::write just delegates to ChannelLiquidities::write), so the parser is a single ChannelLiquidities::read; the --source flag is metadata only. Output is configurable as plain text (default), CSV, or pretty-printed JSON, optionally written to disk via --save. The summary section reports entry count, history-populated percentage, and offset / bucket weight distributions; the per-channel section can be limited via --top or fully dumped via --all, and sorted by narrowest offset window, recency, or historical bucket weight. Depends on the diagnostics() accessors added to ChannelLiquidities and ProbabilisticScorer in the synonymdev/rust-lightning fork. The ldk-node [patch.crates-io] block is unchanged here; the rust-lightning PR must land first and the rev pin must be bumped before this branch can merge. For local development of this crate, point [patch.crates-io] at a checkout of synonymdev/rust-lightning that has the diagnostics accessors applied.
This was referenced Apr 28, 2026
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.
This PR adds a
scorer-inspectworkspace member — a small standalone CLI for offline diagnostics of LDK serialized scorer files. Same parser handles both the servedlatest.binpayloads (e.g.https://api.blocktank.to/scorer-prod,https://scores.zeusln.com/latest.bin) and the bytes returned byNode::export_pathfinding_scores, since both formats are wire-identical in current LDK.Depends on:
diagnostics()accessors this CLI consumes. Must merge first; the[patch.crates-io]rev pin inCargo.tomlthen needs bumping to the merged commit.Summary
crates/scorer-inspect/(binary, no library).scorer-inspect <FILE> [--source served|exported] [--output text|csv|json] [--save PATH] [--top N] [--all] [--sort narrow|recent|history].text(default) — short summary block + top-N channel rows for human review.csv— summary row, blank line, then one row per channel (Sublime Text / spreadsheet friendly on multi-MB files).json—{ summary, channels }for tooling.narrow(smallest offset window first; highest-information entries),recent(most recently updated first),history(largest historical-bucket weight first; most probe-derived signal).ChannelLiquidities-encoded today, the--sourceflag is metadata only.Why a standalone crate instead of a method on
Node: the user-facing question is "compare these.binfiles" — including ones that didn't come from a live node (Zeus's served file, archived snapshots). A separate binary keeps the API surface clean and skips needing UDL bindings.Test plan
cargo build -p scorer-inspect --releasesucceeds against the diagnostics-bearing rust-lightning branch.curl -o /tmp/zeus.bin https://scores.zeusln.com/latest.bin(1.42 MB)curl -o /tmp/blocktank.bin https://api.blocktank.to/scorer-prod(~80 KB)--top,--all,--sortflags all work.cargo test --workspacefrom the ldk-node root — no regressions.[patch.crates-io]rev bumped to the merged commit. Until then this branch is buildable only against a local override.Empirical findings already produced by this tool
A 3-way comparison (Zeus served file vs Blocktank served file) using the new CLI:
has_historypopulatedThe 17.4× size ratio matches the 17.4× entry count exactly — there's no encoding trick. Zeus runs broad-but-shallow probing (44% of entries with single-observation history), Blocktank runs narrow-but-deep on a curated whitelist (only 20% single-observation, the rest with rich history).
🤖 Generated with Claude Code