Skip to content

refactor!: flatten event enum #73

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

Open
wants to merge 2 commits into
base: Frando/irpc-module-structure
Choose a base branch
from

Conversation

Frando
Copy link
Member

@Frando Frando commented Jun 2, 2025

Description

Based on #72

This flattens the Event enum to contain the variants from GossipEvent directly. Makes code that matches on the events much easier to read IMO.

Breaking Changes

  • iroh_gossip::api::GossipEvent is removed. Its variants are now directly available on iroh_gossip::api::Event
  • iroh_gossip::api::Event now contains the variants from GossipEvent in addition to Lagged. The Gossip variant is removed.

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

Copy link

github-actions bot commented Jun 2, 2025

Simulation report
GossipAll-n100-r5 with 4 seeds
        RMR    LDH  missed  duration 
 mean  1.01  10.00    0.00     715ms 
  max  1.02  11.00    0.00     788ms 
  min  1.00   9.00    0.00     490ms 

GossipAll-n20-r30 with 4 seeds
        RMR   LDH  missed  duration 
 mean  1.38  5.03    0.00     394ms 
  max  1.46  7.00    0.00     443ms 
  min  1.12  3.00    0.00     232ms 

GossipMulti-n100-r30 with 4 seeds
        RMR    LDH  missed  duration 
 mean  0.34  10.17    0.00     298ms 
  max  1.50  14.00    0.00     409ms 
  min  0.07   5.00    0.00     147ms 

GossipMulti-n1000-r30 with 4 seeds
        RMR    LDH  missed  duration 
 mean  0.44  20.43    0.00     583ms 
  max  2.06  26.00    0.00     718ms 
  min  0.04  12.00    0.00     319ms 

GossipMulti-n20-r30 with 4 seeds
        RMR   LDH  missed  duration 
 mean  0.27  3.97    0.00     146ms 
  max  1.61  6.00    0.00     264ms 
  min  0.06  2.00    0.00      83ms 

GossipSingle-n100-r30 with 4 seeds
        RMR   LDH  missed  duration 
 mean  0.08  5.00    0.00     147ms 
  max  1.50  5.00    0.00     147ms 
  min  0.01  5.00    0.00     147ms 

GossipSingle-n1000-r30 with 4 seeds
        RMR    LDH  missed  duration 
 mean  0.07  12.00    0.00     319ms 
  max  2.06  12.00    0.00     319ms 
  min  0.00  12.00    0.00     319ms 

GossipSingle-n20-r30 with 4 seeds
        RMR   LDH  missed  duration 
 mean  0.14  3.00    0.00      83ms 
  max  1.44  3.00    0.00      83ms 
  min  0.06  3.00    0.00      83ms 

comparing GossipAll-n100-r5
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 
comparing GossipAll-n20-r30
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 
comparing GossipMulti-n100-r30
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 
comparing GossipMulti-n1000-r30
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 
comparing GossipMulti-n20-r30
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 
comparing GossipSingle-n100-r30
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 
comparing GossipSingle-n1000-r30
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 
comparing GossipSingle-n20-r30
               RMR          LDH       missed     duration 
 mean       +0.00%       +0.00%       +0.00%       +0.00% 
 max        +0.00%       +0.00%       +0.00%       +0.00% 
 min        +0.00%       +0.00%       +0.00%       +0.00% 

Last updated: 2025-06-07T12:20:17Z

@n0bot n0bot bot added this to iroh Jun 2, 2025
@github-project-automation github-project-automation bot moved this to 🏗 In progress in iroh Jun 2, 2025
@Frando Frando marked this pull request as ready for review June 7, 2025 12:12
@Frando Frando requested a review from divagant-martian June 7, 2025 12:12
@Frando Frando force-pushed the Frando/flatten-events branch from 9aa773a to 3482a0d Compare June 7, 2025 12:18
@Frando Frando changed the title refactor: flatten event enum refactor!: flatten event enum Jun 7, 2025
Copy link

github-actions bot commented Jun 7, 2025

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-gossip/pr/73/docs/iroh_gossip/

Last updated: 2025-06-07T12:20:41Z

Copy link
Contributor

@divagant-martian divagant-martian left a comment

Choose a reason for hiding this comment

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

🖤 LGTM

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

Successfully merging this pull request may close these issues.

2 participants