-
Notifications
You must be signed in to change notification settings - Fork 23
Feature: python protocol sdk #626
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
base: main
Are you sure you want to change the base?
Conversation
…we have dht support
There was a problem hiding this 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 implements a Python protocol SDK for the Prime Protocol system, providing Python bindings for worker, validator, and orchestrator clients. The implementation enables Python applications to interact with the Prime Protocol's P2P network and blockchain functionality.
- Adds Python bindings for worker nodes that can join compute pools and handle P2P messaging
- Implements validator client functionality with node validation capabilities and discovery service integration
- Creates orchestrator client for managing compute pools, inviting nodes, and handling pool operations
Reviewed Changes
Copilot reviewed 93 out of 96 changed files in this pull request and generated 8 comments.
Show a summary per file
File | Description |
---|---|
crates/worker/src/services/discovery.rs | Refactored discovery service to use shared implementation, removed duplicate code |
crates/worker/src/operations/node_monitor.rs | Simplified node monitoring operations, removed Console usage in favor of log macros |
crates/shared/src/discovery/mod.rs | New shared discovery utilities for fetching and uploading node information |
crates/prime-protocol-py/src/ | Complete Python SDK implementation with worker, validator, and orchestrator clients |
Various test files | Updated string formatting to use modern Rust string interpolation syntax |
crates/shared/src/web3/contracts/implementations/compute_pool_contract.rs
Outdated
Show resolved
Hide resolved
crates/shared/src/web3/contracts/implementations/compute_pool_contract.rs
Outdated
Show resolved
Hide resolved
bugbot run |
Skipping Bugbot: BugBot is disabled for this repository |
bugbot run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: P2P Library Debug Print Removal
Accidentally committed debug print statement println!("multi addrs: {listen_addrs:?}");
in the P2P library crate. This prints multiaddresses to stdout every time the P2P service starts, which is inappropriate for a library and clutters application output. It should be removed.
crates/p2p/src/lib.rs#L276-L278
protocol/crates/p2p/src/lib.rs
Lines 276 to 278 in 203f21b
println!("multi addrs: {listen_addrs:?}"); | |
Bug: Worker Pool ID Comparison Fails
The worker client's pool ID comparison incorrectly casts self.config.compute_pool_id
(u64) to u32
when checking invite.pool_id
(u32). This truncation can cause workers to accept invites for the wrong compute pool or reject valid invites if the compute_pool_id
exceeds u32::MAX
. The comparison should cast invite.pool_id
to u64
instead.
crates/prime-protocol-py/src/worker/client.rs#L173-L174
protocol/crates/prime-protocol-py/src/worker/client.rs
Lines 173 to 174 in 203f21b
// Verify pool ID matches | |
if invite.pool_id != self.config.compute_pool_id as u32 { |
Was this report helpful? Give feedback by reacting with 👍 or 👎
No description provided.