Skip to content

Remove nested spawns and error handling - #8568

Closed
PoulavBhowmick03 wants to merge 3 commits into
sigp:unstablefrom
PoulavBhowmick03:remove_nested_spawns
Closed

Remove nested spawns and error handling#8568
PoulavBhowmick03 wants to merge 3 commits into
sigp:unstablefrom
PoulavBhowmick03:remove_nested_spawns

Conversation

@PoulavBhowmick03

Copy link
Copy Markdown
Contributor

Issue Addressed

Fixes #8520

Proposed Changes

Added a spawn at the top level, got rid of nested spawn -> await -> spawn and made the attestation service function async, and used join_all for parallel execution

@chong-he chong-he added val-client Relates to the validator client binary ready-for-review The code is ready for review code-quality labels Dec 16, 2025
// Create and publish `SignedAggregateAndProof` for all aggregating validators.
let aggregate_futures = aggregate_duties_by_committee_index.into_iter().map(
|(committee_index, validator_duties)| {
self.clone().handle_aggregates(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Since the perform attestation duties is spawn and its completition time doesn't matter you can move the
sleep_until(aggregate_production_instant).await;
outside of before handle_aggregates call to await once

let _aggregates_timer = validator_metrics::start_timer_vec(
            &validator_metrics::ATTESTATION_SERVICE_TIMES,
            &[validator_metrics::AGGREGATES],
        );

inside self.produce_and_publish_aggregates and then handle_aggregates can be dropped to simply code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

so i should drop the handle_aggregates completely, move the timer inside the produce_and_publish_aggregates fn and the sleep_until() before the previous handle_aggregates call, which will now be changed to self.produce_and_publish_aggregates directly?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's a suggestion, up to you

@macladson macladson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unfortunately #7892 has changed some of the behaviour in this file so there are some conflicts. Are you able to resolve them? I'll give it a proper review once it's fixed

@macladson macladson added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Mar 5, 2026
@PoulavBhowmick03

Copy link
Copy Markdown
Contributor Author

Unfortunately #7892 has changed some of the behaviour in this file so there are some conflicts. Are you able to resolve them? I'll give it a proper review once it's fixed

sure, taking a look

@mergify mergify Bot closed this Apr 4, 2026
@mergify

mergify Bot commented Apr 4, 2026

Copy link
Copy Markdown

Hi @PoulavBhowmick03, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

@mergify mergify Bot added the stale Stale PRs that have been inactive and is now outdated label Apr 4, 2026
@chong-he chong-he reopened this Apr 26, 2026
@mergify mergify Bot closed this May 27, 2026
@mergify

mergify Bot commented May 27, 2026

Copy link
Copy Markdown

Hi @PoulavBhowmick03, this pull request has been closed automatically due to 30 days of inactivity. If you’d like to continue working on it, feel free to reopen at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-quality stale Stale PRs that have been inactive and is now outdated val-client Relates to the validator client binary waiting-on-author The reviewer has suggested changes and awaits thier implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants