Remove nested spawns and error handling - #8568
Conversation
| // 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( |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
It's a suggestion, up to you
sure, taking a look |
|
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. |
|
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. |
Issue Addressed
Fixes #8520
Proposed Changes
Added a spawn at the top level, got rid of nested
spawn -> await -> spawnand made the attestation service function async, and usedjoin_allfor parallel execution