Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add network graph, broadcasting, route path and multi-hop payment #152

Merged
merged 140 commits into from
Sep 12, 2024

Conversation

chenyukang
Copy link
Collaborator

@chenyukang chenyukang commented Sep 11, 2024

This PR add the MVP implementation of multi-hop payment.

broadcasting

  • DEFAULT_ANNOUNCE_NODE_INTERVAL_SECONDS controls the interval to reannounce NodeAnnouncement, and DEFAULT_AUTO_ANNOUNCE_NODE controls whether a node will announce when starting up.

network graph

  • use rocksdb as storage layer
  • network actor and channel actor will broadcasting proper message to add nodes or edges in graph

Routing algorithm

  • A Dijkstra variant from tagert to source, with several considerations
    • Fee and timeLockDelta, converted to weight
    • Then combined with the estimated success rate to convert to the distance dist of the evaluation function
    • Feerate
  • Each hop uses its own fee rate to calculate the forwarding fee. This parameter can be specified when OpenChannel. If not specified, the default inbounding_tlc_fee_proportional_millionths is used.

Multi-hop payment

  • Now we use a temporary OnionPacket for forwarding payment in multiple hops, it is a mock one and will be replaced after the our own onion packet implementation finished.
  • The last hop will automatically remove_tlc if the proper invoice preimage is found

Also fixes #149

contrun and others added 30 commits August 13, 2024 19:51
Fix compilation because of message change

Convert between molecule and rust types

Add AnnoucementSignature to message union

use a dedicated type for announced node name

Broadcast node announcement messages

Refactor peer id in channel state

Save peer pubkeys to channel

Make signature field in channel {announcement, update} optional

Get channel announcement message from channel state

Return complete tx status on TraceTx

Do not panic on node announcement command

Define CFNBroadcastMessage for broadcast messages
@chenyukang chenyukang force-pushed the multihop-graph branch 2 times, most recently from b02df29 to 34fac77 Compare September 11, 2024 17:08
src/fiber/graph.rs Outdated Show resolved Hide resolved
@chenyukang chenyukang changed the title [WIP] Add network graph, broadcasting, route path and multi-hop payment Add network graph, broadcasting, route path and multi-hop payment Sep 12, 2024
@quake quake merged commit 6ca986e into main Sep 12, 2024
26 checks passed
@chenyukang chenyukang deleted the multihop-graph branch September 26, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto close tx should use original pubkey as lock script
3 participants