Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Improvement: concurrent node invitation#294

Merged
JannikSt merged 1 commit into
PrimeIntellect-ai:developfrom
gsegatti:improv/invites
Apr 28, 2025
Merged

Improvement: concurrent node invitation#294
JannikSt merged 1 commit into
PrimeIntellect-ai:developfrom
gsegatti:improv/invites

Conversation

@gsegatti
Copy link
Copy Markdown
Contributor

Resolves #232.

This PR changes process_uninvited_nodes so that invites are sent concurrently instead of one-by-one.

It introduces a constant DEFAULT_INVITE_CONCURRENT_COUNT to limit the number of futures created at once, preventing potential DoS scenarios. The value is somewhat arbitrary, feel free to suggest a better default or remove it altogether if we're not worried about large count of invitations.

- Leverage asynchronism instead of awaiting for every invitation
- Remove some copies
- Solves PrimeIntellect-ai#232
@JannikSt JannikSt requested a review from Copilot April 26, 2025 23:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the node invitation process by sending invitations concurrently rather than sequentially and introduces a constant to limit the number of futures running at once.

  • Modified _generate_invite and _send_invite to take references instead of owning their node parameter
  • Replaced sequential processing in process_uninvited_nodes with a futures stream to limit concurrency using DEFAULT_INVITE_CONCURRENT_COUNT

Comment thread crates/orchestrator/src/node/invite.rs
Comment thread crates/orchestrator/src/node/invite.rs
gsegatti added a commit to gsegatti/protocol that referenced this pull request Apr 27, 2025
- Much like PrimeIntellect-ai#294, but also applied to discovery and node.
@JannikSt JannikSt merged commit 1525775 into PrimeIntellect-ai:develop Apr 28, 2025
1 check passed
gsegatti added a commit to gsegatti/protocol that referenced this pull request Apr 30, 2025
- Much like PrimeIntellect-ai#294, but also applied to discovery and node.
gsegatti added a commit to gsegatti/protocol that referenced this pull request May 24, 2025
- Much like PrimeIntellect-ai#294, but also applied to discovery and node.
gsegatti added a commit to gsegatti/protocol that referenced this pull request May 24, 2025
- Much like PrimeIntellect-ai#294, but also applied to discovery and node.
gsegatti added a commit to gsegatti/protocol that referenced this pull request May 24, 2025
- Much like PrimeIntellect-ai#294, but also applied to discovery and node.
gsegatti added a commit to gsegatti/protocol that referenced this pull request May 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Orchestrator: Use proper threads in node inviter

3 participants