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

Simulations overlay topo info #479

Merged
merged 4 commits into from
Oct 26, 2023
Merged

Simulations overlay topo info #479

merged 4 commits into from
Oct 26, 2023

Conversation

bacv
Copy link
Member

@bacv bacv commented Oct 25, 2023

Collecting and saving overlay information during the simulations runs, mainly to visualize the overlay using some other methods.

Tested on a temp branch rebased on #478, example output:

{
   "committees":[
      "0x02974c9e8c198578be860dcb020b429bd3deea540549eb0012a689c2dc6d42c8",
      "0x6e050cf62d9ed7f6a97833c6a1aeb663f8bbbe4b3ebb731e7bfba4cfd988cd94",
      "0xd567dae8d1c8163959f3577cbb44c9dc051af265a89f49009efada79623efb5f"
   ],
   "committee_sizes":{
      "0x02974c9e8c198578be860dcb020b429bd3deea540549eb0012a689c2dc6d42c8":3,
      "0xd567dae8d1c8163959f3577cbb44c9dc051af265a89f49009efada79623efb5f":3,
      "0x6e050cf62d9ed7f6a97833c6a1aeb663f8bbbe4b3ebb731e7bfba4cfd988cd94":4
   },
   "edges":[
      [
         "0x6e050cf62d9ed7f6a97833c6a1aeb663f8bbbe4b3ebb731e7bfba4cfd988cd94",
         "0x02974c9e8c198578be860dcb020b429bd3deea540549eb0012a689c2dc6d42c8"
      ],
      [
         "0x6e050cf62d9ed7f6a97833c6a1aeb663f8bbbe4b3ebb731e7bfba4cfd988cd94",
         "0xd567dae8d1c8163959f3577cbb44c9dc051af265a89f49009efada79623efb5f"
      ]
   ],
   "next_leader":"0x0000000000000003000000000000000000000000000000000000000000000000",
   "root_id":"0x6e050cf62d9ed7f6a97833c6a1aeb663f8bbbe4b3ebb731e7bfba4cfd988cd94"
}

@bacv bacv added this to the Simulation App milestone Oct 25, 2023
@bacv bacv self-assigned this Oct 25, 2023
pub root_id: CommitteeId,
}

pub trait OverlayInfoExt {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can make it require Overlay as well to constrain it more, but it ok like that if we want to have some mock at some point:

pub trait OverlayInfoExt : Overlay

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm leaning towards leaving it as is for now, until it's required. As I understand, the implementation definition (impl<T: Overlay> OverlayInfoExt for T {) wouldn't change with pub trait OverlayInfoExt : Overlay?

Comment on lines +20 to +21
impl<T: Overlay> OverlayInfoExt for T {
fn info(&self) -> OverlayInfo {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@bacv bacv force-pushed the simulations-overlay-topo-info branch from 4ac2377 to 814637e Compare October 26, 2023 15:44
@bacv bacv merged commit 54dd96d into master Oct 26, 2023
6 of 7 checks passed
@bacv bacv deleted the simulations-overlay-topo-info branch October 26, 2023 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants