Closed michielbdejong closed 5 years ago
This is all still harder than it seemed...
Should I add randomized retry delays to avoid deadlocks like that? Maybe bandwidth should be divided between the number of candidate loops, that would be a first step.
Am I wasting time on the current simple routing scheme? Some of these issues will be different when I introduce probe replies.
what happens if your peer sends both a FULFILL and a REJECT? the second message should be ignored. Would be good to have unit tests for the Ledger layer to ensure this. That's where the split between Ledger and Loops should offer benefit, so actually it's a nice opportunity that I now have a real examples where ledgers get out of sync :)
There are still some issues with the current code, but I'll resolve those in follow-up PRs:
Hubbie+Ledger part is working, unconditional transfers get adminstered correctly in the in-browser demo, and it's sending probes around now.
Next step to fix: it now detects loop when it notices a repeat-send in the same direction; should already detect one if the same routeId comes in from different directions, maybe? Or is this setup enough?