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

[Merged by Bors] - Metrics for sync aggregate fullness #2439

Closed
wants to merge 3 commits into from

Conversation

paulhauner
Copy link
Member

Issue Addressed

NA

Proposed Changes

Adds a metric to see how many set bits are in the sync aggregate for each beacon block being imported.

Additional Info

NA

@paulhauner paulhauner added the ready-for-review The code is ready for review label Jul 8, 2021
paulhauner added a commit that referenced this pull request Jul 8, 2021
commit 8847bd0
Author: Paul Hauner <paul@paulhauner.com>
Date:   Thu Jul 8 18:24:00 2021 +1000

    Add metrics for sync committee fullness
@paulhauner paulhauner mentioned this pull request Jul 8, 2021
@paulhauner paulhauner changed the title Sync metrics for sync aggregate fullness Metrics for sync aggregate fullness Jul 8, 2021
@paulhauner
Copy link
Member Author

Blocked on #2279. After it mergers I'll change the base to unstable.

@paulhauner paulhauner added blocked and removed ready-for-review The code is ready for review labels Jul 9, 2021
@paulhauner paulhauner changed the base branch from altair-vc to unstable July 12, 2021 00:27
@paulhauner paulhauner added low-hanging-fruit Easy to resolve, get it before someone else does! ready-for-review The code is ready for review and removed blocked labels Jul 12, 2021
@paulhauner
Copy link
Member Author

This is unblocked and ready for review :)

Copy link
Member

@michaelsproul michaelsproul left a comment

Choose a reason for hiding this comment

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

Happy to merge with or without suggested fix

block.body().attestations().len() as f64,
);

if let Ok(block) = block.as_altair() {
Copy link
Member

Choose a reason for hiding this comment

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

This would be good as block.body().sync_aggregate() so that it works for all post-Altair block types, but I realise that the sync_aggregate method doesn't exist yet in unstable.

When we implement the next fork we should audit all uses of as_altair anyway, so I'm happy to merge without fixing this.

The definition of sync_aggregate is:

impl<'a, T: EthSpec> BeaconBlockBodyRef<'a, T> {
    /// Access the sync aggregate from the block's body, if one exists.
    pub fn sync_aggregate(self) -> Option<&'a SyncAggregate<T>> {
        match self {
            BeaconBlockBodyRef::Base(_) => None,
            BeaconBlockBodyRef::Altair(inner) => Some(&inner.sync_aggregate),
        }
    }
}

in beacon_block_body.rs

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, great idea. I hadn't considered this problem before. I've added this function in 0dc02e5. Thanks for laying it all out nicely for me 🙂

Copy link
Member

Choose a reason for hiding this comment

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

Noice 😎

@paulhauner
Copy link
Member Author

bors r+

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed low-hanging-fruit Easy to resolve, get it before someone else does! labels Jul 13, 2021
@michaelsproul michaelsproul removed the ready-for-review The code is ready for review label Jul 13, 2021
bors bot pushed a commit that referenced this pull request Jul 13, 2021
## Issue Addressed

NA

## Proposed Changes

Adds a metric to see how many set bits are in the sync aggregate for each beacon block being imported.

## Additional Info

NA
@bors bors bot changed the title Metrics for sync aggregate fullness [Merged by Bors] - Metrics for sync aggregate fullness Jul 13, 2021
@bors bors bot closed this Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants