bitcoin-dev-project / sim-ln

Payment activity generator for the lightning network
MIT License
63 stars 28 forks source link

Use payment delay for offset if no start_secs is specified #189

Closed carlaKC closed 4 months ago

carlaKC commented 4 months ago

For defined activity, if we do not have start_secs set all of our payments will fire immediately on startup and thereafter run at regular intervals. Eg, if we have payments A running every 5 seconds and payment B every 10 seconds our payment dispatch will be:

This seems like undesirable behavior when the start_secs field isn't set in our simulation file. Ideally, we'd distinguish between:

So, using the example above when no start_secs is specified our payment dispatch should be:

This also impacts randomly generated payments - on startup all random payments will fire, then we'll take a look at the wait times that's been randomly generated and wait the appropriate amount of time. These should behave similarly to when no start_secs is defined in the sim file for defined behavior.

carlaKC commented 4 months ago

@bjohnson5 does this make sense to you? It's only sort of a bug because this is the start_secs field working as intended (firing after 0 seconds), but I think this approach is a good in between.

bjohnson5 commented 4 months ago

@carlaKC Yes, I think this makes a lot of sense. I can see that if a user does not specify a start time they would be surprised that any payments have gone out before the first interval time. I will take a look at the PR!