clboss/Boss/Mod/PeerJudge
2024-08-19 15:04:30 -07:00
..
AgeTracker.cpp Boss/Mod/PeerJudge/AgeTracker.cpp: Sub-module to track age of channels. 2021-08-13 18:54:00 +08:00
AgeTracker.hpp Boss/Mod/PeerJudge/AgeTracker.cpp: Sub-module to track age of channels. 2021-08-13 18:54:00 +08:00
Algo.cpp Boss/Mod/PeerJudge/: Start creating replacement for current PeerComplaintsDesk. 2021-08-12 13:58:02 +08:00
Algo.hpp Boss/Mod/PeerJudge/: Start creating replacement for current PeerComplaintsDesk. 2021-08-12 13:58:02 +08:00
DataGatherer.cpp Insert exception what() value in logging messages 2024-08-19 15:04:30 -07:00
DataGatherer.hpp Boss/Mod/PeerJudge/DataGatherer.cpp: Add code to gather data for peer judgment. 2021-08-13 17:01:09 +08:00
Executioner.cpp Boss/Mod/PeerJudge/Executioner.cpp: Implement channel closure for new module. 2021-08-14 20:47:53 +08:00
Executioner.hpp Boss/Mod/PeerJudge/Executioner.cpp: Implement channel closure for new module. 2021-08-14 20:47:53 +08:00
Info.hpp Boss/Mod/PeerJudge/: Start creating replacement for current PeerComplaintsDesk. 2021-08-12 13:58:02 +08:00
README.md Boss/Mod/PeerJudge/: Start creating replacement for current PeerComplaintsDesk. 2021-08-12 13:58:02 +08:00
Unmanager.cpp Boss/Mod/PeerJudge/: Start creating replacement for current PeerComplaintsDesk. 2021-08-12 13:58:02 +08:00
Unmanager.hpp Boss/Mod/PeerJudge/: Start creating replacement for current PeerComplaintsDesk. 2021-08-12 13:58:02 +08:00

This module handles peer judgment and whether to close on a peer or not.

Specifically, the algorithm implemented in Boss::Mod::PeerJudge::Algo goes this way:

  • First, we determine a "reasonable average expected rate of earnings".
    • Average: Specifically, we use a weighted median. We weight it according to channel size.
    • Reasonable: We get this data from the channels we currently have. We sample from a specific recent past timeframe.
    • Rate of earnings: We get all earned fees (incoming and outgoing) and divide by the size of the channel.
    • More specifically, we get the rate-of-earnings of all channels, sort the channels according to rate-of-earnings, then get the weighted median of the channels.
  • All channels whose rate of earnings is lower than the median are subject to possible closure. These are put in a set of candidates-to-close.
  • Next, we determine the cost-of-reopen.
    • The cost of reopening channels is equal to the cost of a close plus the cost of an open plus the cost of getting incoming capacity.
  • For each candidate:
    • Determine the expected earnings.
      • Multiply the median rate-of-earnings we got above, with the size of the channel.
    • If the expected earnings is less than or equal to the cost-of-reopen, do not close the channel.
    • Else close the channel.