Replies: 1 comment
-
Well since isssue 1 and 2 is already being implemented in #698 , moving on directly to issue 3 is it a good idea to have fallback mechanisms if scored selection fails, try simpler strategies like random selection from available relays. And for issue 4 , my rationale for choosing the simple A is because rust and go impls do not use them |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
TODO Analysis: Circuit v2 Relay Issues
Overview
This document analyzes four TODO/FIXME issues in the circuit_v2 relay module:
libp2p/relay/circuit_v2/resources.py:97
( WORK IN PROGRESS )libp2p/relay/circuit_v2/resources.py:193
( WORK IN PROGRESS )libp2p/relay/circuit_v2/transport.py:222
libp2p/relay/circuit_v2/transport.py:279
Issue 1: Signature Generation for Production
Issue Location
File:
libp2p/relay/circuit_v2/resources.py:97
Method:
to_proto()
TODO Comment:
# TODO: For production use, implement proper signature generation
Current Status Analysis
Current Implementation
The
to_proto()
method currently returns a protobuf reservation with an empty signature:The Problem
What Must Be Done
Required Changes
Implementation Options
Option A: Simple Voucher Signing
Option B: Comprehensive Data Signing
Impact Analysis
Issue 2: Voucher and Signature Verification
Issue Location
File:
libp2p/relay/circuit_v2/resources.py:193
Method:
verify_reservation()
TODO Comment:
# TODO: Implement voucher and signature verification
Current Status Analysis
Current Implementation
The
verify_reservation()
method only performs basic checks without cryptographic verification:The Problem
What Must Be Done
Required Changes
Implementation Options
Option A: Basic Verification
Option B: Comprehensive Verification
Impact Analysis
Issue 3: Sophisticated Relay Selection
Issue Location
File:
libp2p/relay/circuit_v2/transport.py:222
Method:
_select_relay()
TODO Comment:
# TODO: Implement more sophisticated relay selection
Current Status Analysis
Current Implementation
The
_select_relay()
method currently uses a simple "first available" strategy:The Problem
What Must Be Done
Required Changes
Implementation Options
Option A: Simple Round-Robin Selection
Option B: Score-Based Selection
Option C: Advanced Load Balancing
Impact Analysis
Issue 4: Reservation Storage and Refresh Mechanism
Issue Location
File:
libp2p/relay/circuit_v2/transport.py:279
Method:
_make_reservation()
TODO Comment:
# TODO: Implement reservation storage and refresh mechanism
Current Status Analysis
Current Implementation
The
_make_reservation()
method currently doesn't store or manage reservations:The Problem
What Must Be Done
Required Changes
Implementation Options
Option A: Simple In-Memory Storage
Option B: Persistent Storage with Database
Option C: Advanced Reservation Management
Impact Analysis
Summary and Recommendations
Priority Order
High Priority: Signature generation and verification (Issues 1 & 2)
Medium Priority: Reservation storage and refresh (Issue 4)
Low Priority: Sophisticated relay selection (Issue 3)
Implementation Strategy
Testing Requirements
Documentation Needs
Beta Was this translation helpful? Give feedback.
All reactions