Skip to content

[vouch score] refactor walk to find all simple paths#406

Merged
dboreham merged 25 commits into
0LNetworkCommunity:mainfrom
0o-de-lally:reverse-walk
May 23, 2025
Merged

[vouch score] refactor walk to find all simple paths#406
dboreham merged 25 commits into
0LNetworkCommunity:mainfrom
0o-de-lally:reverse-walk

Conversation

@sasuke0787

@sasuke0787 sasuke0787 commented May 23, 2025

Copy link
Copy Markdown
Contributor
  • refactor so that we walk from target back to roots
  • add improved clear test cases for branching patterns
  • patch infinite loop issue not aborting on max processed
  • refactor early exits for performance

@sasuke0787 sasuke0787 requested a review from hemulin May 23, 2025 19:11
@0o-de-lally 0o-de-lally changed the title Reverse walk [vouch score] refactor walk to find all simple paths May 23, 2025
Rupert Von Cony and others added 2 commits May 23, 2025 15:55
@0o-de-lally

Copy link
Copy Markdown
Contributor

For future reference here's the result of some benchmarking with production data:

## forward walk
#### from roots to target

| Depth |   Score   | Max Depth Reached | Accounts Processed |
|------:|----------:|------------------:|-------------------:|
|     2 |         0 |                 2 |                 28 |
|     3 |   100000  |                 3 |                 87 |
|     4 |   250000  |                 4 |                324 |
|     5 |   587500  |                 5 |               1368 |
|     6 | EXECUTION_LIMIT_REACHED |    |                    |

---

## reverse walk
#### from target to roots of trust

| Depth |   Score   | Max Depth Reached | Accounts Processed |
|------:|----------:|------------------:|-------------------:|
|     2 |         0 |                 2 |                  4 |
|     3 |   100000  |                 3 |                 12 |
|     4 |   250000  |                 4 |                 49 |
|     5 |   562500  |                 5 |                217 |
|     6 |   981250  |                 6 |               1235 |
|     7 | EXECUTION_LIMIT_REACHED |    - |                  - |

@sirouk sirouk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@0o-de-lally

Copy link
Copy Markdown
Contributor

For completness, we also tested a breadth first approach. While the numbers come out the same in the tests, with production data it's quick to exceed memory limits. This is what we would expect from a BFS vs DFS. Though it's possible it can be revisited in the future and tuned.

https://github.com/0o-de-lally/libra-framework/blob/breadth-first/framework/libra-framework/sources/ol_sources/tests/page_rank_bfs.test.move#L116

@dboreham dboreham merged commit d59aad3 into 0LNetworkCommunity:main May 23, 2025
14 checks passed
dboreham pushed a commit that referenced this pull request May 23, 2025
Co-authored-by: Lucietta De Staccato <lucietta_de_staccato@github.com>
Co-authored-by: Archibald Fitz Hind <archibald_fitz_hind@github.com>
Co-authored-by: Bea O'Tempo <bea_o'tempo@github.com>
Co-authored-by: Gabi Beaver <gabi_beaver@github.com>
Co-authored-by: Franci Tempo <franci_tempo@github.com>
Co-authored-by: Rosina Fitz Lento <rosina_fitz_lento@github.com>
Co-authored-by: Beauregard O'Sforzando <beauregard_o'sforzando@github.com>
Co-authored-by: Basil Saint Urchin <basil_saint_urchin@github.com>
Co-authored-by: Vale De Bittern <vale_de_bittern@github.com>
Co-authored-by: Beauregard Legato <beauregard_legato@github.com>
Co-authored-by: Chiaretta Saint Adagio <chiaretta_saint_adagio@github.com>
Co-authored-by: Sandra Stag <sandra_stag@github.com>
Co-authored-by: Vale McPiano <vale_mcpiano@github.com>
Co-authored-by: Sofi Forte <sofi_forte@github.com>
Co-authored-by: Archibald De Bittern <archibald_de_bittern@github.com>
Co-authored-by: Paoletta De Lento <paoletta_de_lento@github.com>
Co-authored-by: Mariella Legato <mariella_legato@github.com>
Co-authored-by: Rosina Von Stag <rosina_von_stag@github.com>
Co-authored-by: Rosina Fortissimo <rosina_fortissimo@github.com>
Co-authored-by: Isa Saint Bittern <isa_saint_bittern@github.com>
Co-authored-by: Isa McMezzo <isa_mcmezzo@github.com>
Co-authored-by: Crispin Accelerando <crispin_accelerando@github.com>
Co-authored-by: Mariella De Tempo <mariella_de_tempo@github.com>
Co-authored-by: Rupert Von Cony <rupert_von_cony@github.com>
Co-authored-by: Sofi Hart <sofi_hart@github.com>
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

Successfully merging this pull request may close these issues.

4 participants