lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.58k stars 2.06k forks source link

[bug]: Cannot import pairs directly from QueryMissionControl #8778

Closed beetodateetodasee closed 1 month ago

beetodateetodasee commented 2 months ago

Background

I am doing some benchmarking to compare the performance of LNDs pathfinding against custom methods. For the sake of reproducibility, it is necessary to export the initial state of mission control so that it can be reimported into LND between trials. However, when I go to import the pairs from a QueryMissionControlResponse using XImportMissionControl, I get an error. I believe this is because PairHistory concerning failure does not always have an amount, so it can't be imported.

Example:

pairs = [
...
, node_from: _____
node_to: _____
history {
  success_time: 1716537571
  success_amt_sat: 1000
  success_amt_msat: 1000000
}
, node_from: _____
node_to: _____
history {
  fail_time: 1716516058
}
]

Your environment

Steps to reproduce

Export PairHistory using QueryMissionControl. Import PairHistory using XImportMissionControl.

Expected behaviour

Importing PairHistory list directly from QueryMissionControl without error.

Actual behaviour

Cannot import.

Error:

grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
    status = StatusCode.UNKNOWN
    details = "pair: ______ -> ______: invalid failure: non-zero timestamp requires non-zero amount"
    debug_error_string = "UNKNOWN:Error received from peer ipv4:______:443 {created_time:"2024-05-24T12:35:49.939938-04:00", grpc_status:2, grpc_message:"pair: ______ -> ______: invalid failure: non-zero timestamp requires non-zero amount"}"
>