# Summary: Consensus Layer Networking (libp2p) Lecture **Presenter:** Lion (Lighthouse team, formerly Lodestar) ## Topics Covered **libp2p Connection Stack** - Layered architecture: TCP → Noise encryption → multiplexing (mplex/yamux) → application streams - Multiplexer tradeoffs: mplex simpler but no backpressure; yamux complex but proper flow control - QUIC mentioned as future replacement (blocked by JS implementation maturity) - Multistream-select for protocol negotiation at each layer **Gossipsub Protocol (Primary Focus)** - Dual-layer propagation: mesh (D=8 peers) for fast forwarding + IHAVE/IWANT gossip for coverage - Topic-based: each message type has own mesh, validation rules - Control messages: GRAFT/PRUNE for mesh management, IHAVE/IWANT for protocol-level announcements - Heartbeat interval: 0.7 seconds **Gossipsub 1.1 - Peer Scoring** - Walked through P1-P7 scoring parameters (mesh time, first delivery, message rate, invalid messages, IP collocation, etc.) - Scores are local/subjective, not persisted, not shared **Gossipsub 1.2 - IDONTWANT** - Bandwidth optimization for large messages (blobs = 131KB) - Cancel in-flight duplicates; noted results "a bit disappointing" **Ethereum-Specific Consensus Specs** - Validation rules: IGNORE vs REJECT (latter applies P4 penalty) - Attestation scaling: 64 subnets → aggregators → global topic - Blob handling challenges for home stakers; get-blobs optimization **Request-Response Protocols** - Separate from gossipsub (blocks_by_range, status, etc.) - Peer selection is implementation-specific **Not Covered** - Discovery v5 (noted as separate UDP protocol using Kademlia) - Gossipsub 2.0 (briefly mentioned - uses preemptive messaging) # Summary: Execution Layer Networking (devp2p) Lecture **Presenter:** Felix (Geth team, devp2p spec maintainer) ## Topics Covered **RLPx Transport Layer** - TCP-based encrypted/authenticated connections (~10 years old) - Noted encryption is technically broken, authentication still works - Capability negotiation system (eth, snap protocols) - Hello/Disconnect message handling **Eth Wire Protocol (eth/68)** - Post-merge role: block sync + transaction propagation only (no block announcements) - Status handshake: network ID, genesis, fork ID validation - Transaction pool messages (hashes, requests, pooled txs) - Block header/body/receipt request-response patterns - Briefly mentioned upcoming eth/69 changes (remove total difficulty, add history expiry) **Discovery v4 (Legacy)** - UDP-based modified Kademlia DHT (keys only, no values) - Clock synchronization dependency issues discussed in detail - ENR extension for richer node metadata **Discovery v5 (Current)** - Improvements: no clock dependency, working encryption, session-based replay protection - Shared with consensus layer - Adoption status: Geth/Erigon yes, Nethermind/Besu not yet - Topic advertisement system mentioned (not yet implemented) **Geth Implementation Tour** - Walked through `p2p/server.go`, `eth/backend.go`, protocol registration - Server config: MaxPeers (~50 default), DialRatio (1/3 outbound) - Handshake flow and validation logic **Security Discussion** - No reputation system by design (referenced Holesky incident where CL peer scoring hurt recovery) - Transaction pool identified as primary attack surface **Future Work** - Discovery v5.2: NAT hole punching - Portal Network collaboration for large data transfer over UDP - Verkle tree implications for snap protocol