feat: add scorer-kit#20
Draft
ovitrif wants to merge 1 commit into
Draft
Conversation
4 tasks
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.
Context
This PR moves the offline scorer-file tooling previously introduced via synonymdev/ldk-node#79 into the scorer repo as
scorer-kitand enhances its functionality with merging and decoding capabilities.The tool is intended for local/operator workflows around serialized LDK
ChannelLiquiditiesfiles: inspect them, decode them to JSON, compare two snapshots, validate bytes, and merge multiple scorer files into a new scorer binary.The
scorer-kitbinary uses the scorer merge/diagnostics API exposed in synonymdev/rust-lightning#2 via an aliased dependency pinned to the commit in the branch of that branch, so the existing scorer node/prober dependency graph remains on its current LDK crate set.What Changed
src/bin/scorer-kit.rswith subcommands:inspectdecodecomparemergevalidatemerge:richer-historyprefer-first,prefer-last,combine,newertest_data/scorer-kit/.scorer-kitflows in the README.Current Sample Result
Using the current two source samples,
scorer-kit mergeproduced a 16,609-entry merged scorer file. The audit report recorded 1,184 duplicate short-channel-id decisions: 389 kept from the existing input, 795 replaced by the incoming input, and 0 blindly combined under the defaultricher-historypolicy.Notes
The default merge policy avoids blindly combining duplicate short-channel-id entries. Unique entries are preserved, and overlaps choose the entry with stronger historical signal unless another policy is explicitly requested.
Test Plan
cargo check --bin scorer-kitcargo checkcargo testscorer-kit validate <source-a.bin> <source-b.bin>scorer-kit inspect <source-a.bin> --label source-a --top 5scorer-kit inspect <source-b.bin> --label source-b --top 5scorer-kit compare <source-a.bin> <source-b.bin> --left-label source-a --right-label source-bscorer-kit compare <source-a.bin> <source-b.bin> --left-label source-a --right-label source-b --output csvscorer-kit merge <source-b.bin> <source-a.bin> --label source-b --label source-a --output target/scorer-kit/merged.bin --report target/scorer-kit/merge-report.json --policy richer-historyscorer-kit validate target/scorer-kit/merged.bin