Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Allow random and defined activity simulation #161

Open
carlaKC opened this issue Dec 12, 2023 · 4 comments
Open

Feature: Allow random and defined activity simulation #161

carlaKC opened this issue Dec 12, 2023 · 4 comments
Labels
feature New feature or request
Milestone

Comments

@carlaKC
Copy link
Contributor

carlaKC commented Dec 12, 2023

Right now, the type of activity that we will simulate is determined by the sim-file:

  • activity specified: run the user-defined set of activities.
  • No activity: run random activity for all of the nodes provided.

We should allow users to specify both random and defined activity to support more complicated use cases, while still preserving the "easy start" nature of just being able to specify nodes for random activity.

Suggested Sim File Interpretation

Random Activity - All Nodes

sim.json:

nodes {
    A ...
    B ...
}

Action: run default random activity on A and B.

Defined Activity

sim.json:

nodes {
    A ...
    B ....
}
activity{
    A -> B 10 sats
}

Action: run only the defined activity specified between A and B.

Defined and Random Activity

sim.json:

nodes {
    A ...
    B ....
    C ....
}
activity{
    A -> B 10 sats
}
no_random{
    B
}

Action: run defined activity specified between A and B and random activity between A and C.

Rationale for no_random is that I think the likely use case is specifying a few specific activity flows and then wanting those nodes to be excluded from the random activity.

Eg: Running a jamming simulation

  • I want D and E to run a jamming attack.
  • I don't want D and E to send random payments.
  • I want all other nodes to be processing random payments, so I just set D and E in no_random.
@sr-gi
Copy link
Member

sr-gi commented Dec 13, 2023

Eg: Running a jamming simulation

I want D and E to run a jamming attack.
I don't want D and E to send random payments.
I want all other nodes to be processing random payments, so I just set D and E in no_random.

Can you provide an example of how the file would look for this?

@carlaKC
Copy link
Contributor Author

carlaKC commented Dec 13, 2023

Can you provide an example of how the file would look for this?

The following sim file would:

  • Send random payments between A/B/D
  • Send 100 sats between D/E
nodes {
   A...
   B...
   C...
   D...
   E...
}
activity{
   D -> E (100sats / 100 seconds)
}
no_random{
    D,
    E,
}

Not sure that this is the best way to express it tbh, I specifically want to keep the feature that only specifying nodes runs random activity (good quick start). Very open to suggestions for other/better ways to express the rest!

@sr-gi
Copy link
Member

sr-gi commented Dec 13, 2023

I'm trying to think about the implications that this will have in the codebase. Would the no_random section translate to anything there won't be picked as source, anything there won't be picked as destination, or both?

I guess in the case of the former we can simply filter the node collection to remove whatever is in no_radom before passing it to the RandomActivityGenerator, in the case of the latter we can create a exclude list that will extend the current policy (do not send to yourself) and if you meant both just do both.

All in all, I think it makes sense, it should be less work to define an exclusion list as far as we assume that the default behavior for channels is to be sending payments between them instead of being stale (which it's a reasonable assumption for me at least)

@carlaKC
Copy link
Contributor Author

carlaKC commented Dec 15, 2023

Would the no_random section translate to anything there won't be picked as source, anything there won't be picked as destination, or both?

Both - our current implementation of random activity is that each node sends and receives, so we'd just exclude no_random completely.

we can simply filter the node collection to remove whatever is in no_radom before passing it to the RandomActivityGenerator

Yeah exactly what I was thinking 👍

@carlaKC carlaKC added this to the V3 milestone Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants