bitcoin-dev-project/sim-ln

Feature: Simulation Time

Opened this issue · 1 comments

Some use cases may want to use simulation time rather than seconds. Steps to complete:

  1. Abstract time usage to trait (implemented by system time)
  2. Add implementation time trait implementation (this possibly exists already - do some googling)
  3. Update user config to be able to opt into sim time (high level parameter / config interval_secs -> more generic interval?)

As a first step for this, we can pull out the time based functionality in sim-ln into a Clock trait.

There's some debate as to whether simulation time will work with real nodes, because we can only go as fast as the underlying node can process payments. That said, with the addition of #165 we'd be interested in simulation time (as the simulated nodes are incredibly cheap to run) so I'd like to start down this path.

This will probably need some forward thinking as to what simulated time we're going to use to minimize refactoring. I took a brief look at game_time which looked promising but haven't done a deep dive.