ledgerloops / jerboa

A state-driven Ledger Loops node in TypeScript. Successor of strategies in https://github.com/ledgerloops/strategy-pit
Apache License 2.0
1 stars 0 forks source link

balance disputes when scout messages happen in parallel #19

Closed michielbdejong closed 1 month ago

michielbdejong commented 1 month ago
found loop (6:585) [] [ '1', '5', '1168', '4982', '1' ]
found loop (7:0) [] [ '1', '11', '4', '2', '1' ]
found loop (8:0) [] [ '1', '11', '4', '5', '1' ]
backtracked (9:0) [ '1', '11' ] [ '4' ]
file:///Users/michiel/gh/ledgerloops/jerboa/build/src/Jerboa.js:129
                throw new Error('balance dispute!');
                ^

Error: balance dispute!
michielbdejong commented 1 month ago

Temporary balance disputes are inevitable due to the Two Generals Problem. So maybe loop scouting should just play it safe, and take the minimum of incoming and outgoing. This does mean that it might take several sweeps to clear a loop, but eventually all transfers will settle, a zero balance will appear somewhere on the loop, and probes will move on.

michielbdejong commented 1 month ago

done