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

Handle private channel hop hints #487

Merged
merged 41 commits into from
Mar 6, 2025

Conversation

contrun
Copy link
Collaborator

@contrun contrun commented Jan 17, 2025

This PR depends on Use the fee rate in oubound channel to calculate the TLC fee by contrun · Pull Request #489 · nervosnetwork/fiber.

The migration code is not well-tested. I only tried the following.

  1. Run git checkout v0.3.1 to checkout to the v0.3.1 version code.
  2. Run REMOVE_OLD_STATE=y ./tests/nodes/start.sh to start a few fnn nodes with all new states.
  3. Run (cd ./tests/bruno; npm exec -- @usebruno/[email protected] run e2e/router-pay -r --env test) to create a few payment sessions.
  4. Run ldb --db=tests/nodes/1/fiber/store --secondary_path=/tmp/test/ dump --hex | awk '/0xC0/ {print $1}' | sed 's/0xC0/0x/g' to see all the payment sessions created.
  5. Run ldb --db=tests/nodes/1/fiber/store --secondary_path=/tmp/test/ dump --hex | awk '/0xC0/ {print $1}' | sed 's/0xC0/0x/g' | xargs -I __ curl -sS --json '{"id": "42", "jsonrpc": "2.0", "method": "get_payment", "params": [{"payment_hash": "__"}]}' http://127.0.0.1:21714/ | jq -s to see all the payment session detailed information.
  6. Stop the nodes created in step 2.
  7. Run git checkout handle-private-channel-hop-hints to checkout the code of this PR.
  8. Run (cd migrate; cargo run -- --path ../tests/nodes/1/fiber/store) to start migration.
  9. Run cargo build && (clear; cd ./tests/nodes/; ../../target/debug/fnn -d 1) to start node 1.
  10. Run ldb --db=tests/nodes/1/fiber/store --secondary_path=/tmp/test/ dump --hex | awk '/0xC0/ {print $1}' | sed 's/0xC0/0x/g' | xargs -I __ curl -sS --json '{"id": "42", "jsonrpc": "2.0", "method": "get_payment", "params": [{"payment_hash": "__"}]}' again to check the payment session data have been migrated (by eyes).

@contrun contrun force-pushed the handle-private-channel-hop-hints branch from 8f14f6b to 3dd662a Compare January 22, 2025 06:58
@contrun contrun marked this pull request as ready for review January 23, 2025 05:52
@contrun contrun force-pushed the handle-private-channel-hop-hints branch 2 times, most recently from 454289d to 5ae0dfe Compare February 26, 2025 11:30
@contrun contrun force-pushed the handle-private-channel-hop-hints branch from 5ae0dfe to 2b5c9a2 Compare February 27, 2025 04:23
@contrun contrun force-pushed the handle-private-channel-hop-hints branch 2 times, most recently from 00853af to 55b2764 Compare March 4, 2025 13:57
@contrun contrun force-pushed the handle-private-channel-hop-hints branch from 9529349 to 08c64cd Compare March 4, 2025 14:13
@quake quake merged commit 2b0bd71 into nervosnetwork:develop Mar 6, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants