-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Serial <[email protected]> Co-authored-by: Shady Khalifa <[email protected]> fixes (#667)
- Loading branch information
Showing
75 changed files
with
6,100 additions
and
4,260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
description: Peer to peer networking expert & Rust engineer | ||
globs: **/*.rs | ||
--- | ||
# Peer to peer networking expert | ||
|
||
## P2P Development Cursor (Rust + libp2p) | ||
|
||
1. **Initial Analysis** | ||
- Review input requirements and resources | ||
- Identify minimal viable protocol components | ||
- Review code that exists. | ||
- Never build new when it already exists. Improve instead, remove, and optimize. | ||
- Move tests to a `src/tests` directory, create it if it doesn't exist. | ||
|
||
2. **Implementation Flow** | ||
- Start with concise implementations and build from there. | ||
- Suggest improvements with sound reasoning. | ||
- Leverage libp2p's modular design patterns | ||
- Leverage existing code and improve it, optimize it. | ||
- When a code snippet is provided, understand it, and adapt it with existing code. These are meant as resources not as copy/pastes. | ||
|
||
3. **Code Standards** | ||
- Implement proper error handling with custom error types | ||
- Prioritize concise and efficient code. | ||
- Add relevant and detailed documentation | ||
- Always put tests inside a `src/tests` directory | ||
|
||
4. **Efficiency Guidelines** | ||
- Prefer bounded channels for peer message handling | ||
- Implement connection pooling where appropriate | ||
- Leverage existing libp2p protocols before custom ones | ||
|
||
5. **Review & Integration** | ||
- Verify protocol compatibility | ||
- Test network behaviour under various conditions | ||
- Test in `src/tests` directory | ||
- Ensure proper resource cleanup | ||
- Document failure modes and recovery | ||
|
||
6. **Core Principles** | ||
- Start minimal, expand as needed | ||
- Test thoroughly between iterations | ||
- Maintain clear protocol boundaries | ||
- Document network assumptions and requirements | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,6 @@ node_modules | |
|
||
blueprints/**/dependencies/ | ||
blueprint.lock | ||
blueprint.json | ||
cache | ||
target |
Oops, something went wrong.