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

badger-sarafu testing #31

Open
michielbdejong opened this issue Sep 17, 2024 · 5 comments
Open

badger-sarafu testing #31

michielbdejong opened this issue Sep 17, 2024 · 5 comments

Comments

@michielbdejong
Copy link
Member

michielbdejong commented Sep 17, 2024

First I'm testing with the minimal loop (edited for #32):

6 4 0.5   -> nothing should happen yet
3 6 100.0 -> nothing should happen still
4 3 2.0   -> 4 should send 3 a flood probe
          -> 3 forwards the probe to 6
          -> 6 forwards the probe to 4
          -> 4 would detect the loop and send a trace to both 6
          -> 6 forwards the trace to 3
          -> 3 forwards the trace to 4
          -> 4 announces a loop
@michielbdejong
Copy link
Member Author

The logging is now:

michiel-2:strategy-pit michiel$ npm run build ; node build/src/run.js

> [email protected] prebuild
> npm run lint


> [email protected] lint
> eslint . --ext .ts --ext .mts


> [email protected] build
> tsc -p tsconfig.json

This simulation will take about 60 seconds to complete.
Adding node 6
Adding node 4
Meeting "6" "4"
Adding node 3
Meeting "3" "6"

0: [6]->[4] meet
0: [6]->[4] probe 847c34c9
0: [3]->[6] meet
0: [3]->[6] probe 910d6f7f

1: [4]->[6] have-probes
1: [6]->[3] have-probes
1: [6]->[4] probe 910d6f7f

2: [6]->[4] okay-to-send-probes
2: [3]->[6] okay-to-send-probes

3: [6]->[3] probe 847c34c9

4: [3]->[6] have-probes

5: [6]->[3] okay-to-send-probes


Loops found:
3 []
4 []
6 []

I was a bit surprised that the probes are already created when a node meets its first contact, since in that situation the node can be sure to be on the edge of the network (i.e. a leaf and not part of a loop). I guess I can optimize this -> #32

@michielbdejong
Copy link
Member Author

michielbdejong commented Sep 19, 2024

20 transactions now run in 100ms, yields 17 paths:

0.3.4.0
0.3.6.4.0
0.3.6.5.7.4.0
0.3.6.7.4.0
0.3.7.4.0
0.3.7.5.6.4.0
3.4.6.3
3.4.6.5.7.3
3.4.6.7.3
3.4.7.3
3.4.7.5.6.3
3.6.5.7.3
3.6.7.3
3.6.7.4.3
4.6.5.7.4
4.6.7.4
5.6.7.5

and this example graph for probe possible (blue = probe, green = trace, red = announce):
Screenshot 2024-09-19 at 10 34 13

@michielbdejong
Copy link
Member Author

With less logging, 250 transactions take 10 seconds to simulate on my laptop (still the same 17 paths found).

@michielbdejong
Copy link
Member Author

with 1000 transactions it runs out of memory after 3:26 minutes

@michielbdejong
Copy link
Member Author

michielbdejong commented Sep 19, 2024

Transactions 19-7932 are all DISBURSEMENT ("faucet") lines, from 0 to some (often new) node. So probably easy to optimise!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant