diff --git a/libp2p/transport/quic/config.py b/libp2p/transport/quic/config.py index 80b4bdb1..a46e4e20 100644 --- a/libp2p/transport/quic/config.py +++ b/libp2p/transport/quic/config.py @@ -1,5 +1,3 @@ -from typing import Literal - """ Configuration classes for QUIC transport. """ @@ -9,7 +7,7 @@ from dataclasses import ( field, ) import ssl -from typing import Any, TypedDict +from typing import Any, Literal, TypedDict from libp2p.custom_types import TProtocol diff --git a/libp2p/transport/quic/listener.py b/libp2p/transport/quic/listener.py index 8ee5c656..b1c13562 100644 --- a/libp2p/transport/quic/listener.py +++ b/libp2p/transport/quic/listener.py @@ -500,7 +500,7 @@ class QUICListener(IListener): try: quic_conn.tls._request_client_certificate = True logger.debug( - "request_client_certificate set to True in server TLS context" + "request_client_certificate set to True in server TLS" ) except Exception as e: logger.error(f"FAILED to apply request_client_certificate: {e}") @@ -694,7 +694,7 @@ class QUICListener(IListener): if dest_cid in self._connections: logger.debug( - f"⚠️ PROMOTE: Connection {dest_cid.hex()} already exists in _connections!" + f"⚠️ Connection {dest_cid.hex()} already exists in _connections!" ) connection = self._connections[dest_cid] else: diff --git a/libp2p/transport/quic/security.py b/libp2p/transport/quic/security.py index d09aeda3..568514d5 100644 --- a/libp2p/transport/quic/security.py +++ b/libp2p/transport/quic/security.py @@ -292,15 +292,15 @@ class LibP2PExtensionHandler: return signature else: logger.debug( - f"❌ Cannot extract 64 bytes from {len(signature_data)} byte signature" + f"Cannot extract 64 bytes from {len(signature_data)} byte signature" ) return signature_data @staticmethod def _extract_secp256k1_signature(signature_data: bytes) -> bytes: """ - Extract Secp256k1 signature. - Secp256k1 can use either DER-encoded or raw format depending on the implementation. + Extract Secp256k1 signature. Secp256k1 can use either DER-encoded + or raw format depending on the implementation. """ logger.debug("🔧 Extracting Secp256k1 signature") @@ -445,11 +445,12 @@ class LibP2PExtensionHandler: return signature elif len(signature) > expected_total_length: logger.debug( - f"🔧 Truncating DER signature from {len(signature)} to {expected_total_length} bytes" + "Truncating DER signature from " + f"{len(signature)} to {expected_total_length} bytes" ) return signature[:expected_total_length] else: - logger.debug(f"⚠️ DER signature is shorter than expected, using as-is") + logger.debug("DER signature is shorter than expected, using as-is") return signature @@ -823,7 +824,7 @@ class QUICTLSSecurityConfig: return {"error": str(e)} def debug_config(self) -> None: - """print debugging information about this configuration.""" + """Print debugging information about this configuration.""" print(f"=== TLS Security Config Debug ({self.config_name or 'unnamed'}) ===") print(f"Is client config: {self.is_client_config}") print(f"ALPN protocols: {self.alpn_protocols}")