Fix critical bugs and harden error handling for production readiness#51
Open
vincenzopalazzo wants to merge 1 commit into
Open
Fix critical bugs and harden error handling for production readiness#51vincenzopalazzo wants to merge 1 commit into
vincenzopalazzo wants to merge 1 commit into
Conversation
…eadiness - Fix P2P graph builder using node1 ID for both endpoints (node2 was never added to the graph, breaking topology) - Fix LDK route conversion computing wrong amounts and delays per hop (was accumulating fees instead of computing correct forward amounts) - Replace all panic-prone unwrap/expect calls with proper error propagation in probabilistic strategy, plugin init, and pay handler - Fix misleading error messages in amount_msat validation (both conflict and missing cases showed same message) - Generate time-based random seed bytes instead of hardcoded zeros for probabilistic route scoring - Handle GossipChannel conversion gracefully when satoshi value or wire serialization is unavailable - Fix clippy warnings (clone_on_copy, derivable_impls, unused imports) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
add_channelusednode1ID for both endpoints, so node2 was never added to the graph — completely breaking P2P topology for probabilistic routingunwrap()/expect()with proper error propagation in probabilistic strategy (construct_route_params,convert_route_to_output), pluginon_init, pay handler (cln_rpc_path), and gossip channel conversion[0; 32]with time+payment-based entropy for route randomizationclone_on_copy,derivable_impls, unused importProduction readiness plan
These fixes address the critical correctness and crash bugs. Remaining work for feature-complete production readiness:
P1 — Must have for real-money testing:
WIRE_TEMPORARY_*failures)maxfeeparameter with hard ceiling enforcement)waitsendpaytimeout (currently blocks indefinitely)P2 — Required for production:
5. Multi-part payments (MPP) — without this, payments > single channel capacity always fail
6. Gossip map caching in plugin state (currently reloads
gossip_storeon every call)7. Migrate from deprecated
decodepaytodecodeRPC8. Implement
barqrouteinfofor dry-run route inspectionP3 — Competitive with renepay:
9. Liquidity learning from payment attempt results (Bayesian updates)
10. Payment splitting via MCF optimization
11. Shadow routing for privacy
12. Configurable scoring parameters
Test plan
cargo buildpassescargo clippy --all --testspasses (remaining warnings are pre-existing: unusedroot_pathfield, unimplementedroute_infodead code)cargo test --all— 2/3 pass, 1 pre-existing failure (test_rapid_gossip_sync_network_not_emptyfails on main too due to empty Testnet gossip data)🤖 Generated with Claude Code