{"slug": "dev-log-22-tearing-out-the-old-deleting-3800-lines-of-legacy-p2p-code", "title": "Dev log #22 Tearing out the old: Deleting 3,800 lines of legacy p2p code", "summary": "Developer Yash Saini removed the legacy Floodsub pubsub protocol from the Rust-based minip2p peer-to-peer networking stack, deleting 3,876 lines while adding 141 across 53 files and making Gossipsub the only available router. Saini also fixed flaky subprocess handling in py-libp2p's test_echo_thin_waist and opened a PR adding durable, swept file upload sessions to sixb's storage layer.", "body_md": "Hi, glad you found your way here. I'm Yash, a developer who contributes to open source, mostly p2p networking and AI tooling. Each week I write up what I shipped, what broke, and what fixing it taught me.\n\n[GitHub](https://github.com/yashksaini-coder) · [X](https://x.com/0xcrackedDev) · [LinkedIn](https://www.linkedin.com/in/yashksaini) · [Portfolio](https://yashksaini.vercel.app/)\n\nThere is no feeling quite like watching a PR diff show thousands of red lines and only a handful of green ones. This week was all about that catharsis. I spent my time simplifying the p2p stack, specifically by ripping out legacy protocols in Rust and hardening storage layers in Python. Across 5 commits and 3 PRs, I managed to delete nearly 4,000 lines of code while only adding about 160. It was a week for codebase health and architectural clarity.\n\nMost of my energy this week went into **minip2p**, a Rust-based peer-to-peer networking stack I've been contributing to. If you’ve spent any time in the libp2p ecosystem, you know that Floodsub is the \"old way\" of doing pubsub—it’s simple, but it’s incredibly noisy and inefficient because it just broadcasts everything to everyone. Gossipsub has been the standard for a long time now, and maintaining both in a \"mini\" implementation started to feel like unnecessary baggage.\n\nI pushed 3 commits to `minip2p` that effectively scrubbed Floodsub from the entire project. This wasn't just a \"delete the file\" kind of task; it was a breaking change that rippled through the public API and the documentation. I had to touch 53 files to make it happen. The commit messages tell the story: I started by dropping it from the README and the docs site, then moved into the core pubsub logic to make Gossipsub the only available router, and finally cleaned up the bindings so users don't even have to (or get to) select a router anymore. It’s a breaking change—marked with the `!` in my commit messages—but the codebase is so much leaner for it. We're talking 141 additions against 3,876 deletions. That is a lot of technical debt gone in one go.\n\nOn the Python side, I spent some time with **py-libp2p**. This was less about architectural shifts and more about the \"un-glamorous\" work that keeps a project viable: fixing flaky tests. I’ve been annoyed by `test_echo_thin_waist` for a bit because of how it handled subprocesses. If a test doesn't reap its children properly, you end up with zombie processes and weird CI failures that have nothing to do with your actual code. I pushed 2 commits to ensure we're reaping those echo subprocesses cleanly. It’s a small change—18 lines added—but it makes the local dev experience and the CI pipeline significantly more stable.\n\nI had three major PRs in flight this week, two of which are already merged.\n\nThe big one was [Remove Floodsub from every public layer (#199)](https://github.com/deepso7/minip2p/pull/199) in `minip2p`. This was the culmination of the work I mentioned above. Landing a PR that deletes 4,258 lines (including some generated code and docs) feels like a massive win. It simplifies the mental model for anyone new coming into the repo. You don't have to ask \"which pubsub should I use?\" anymore. There's only one, and it's the one that works at scale.\n\nI also landed a fix in `py-libp2p`: [test(examples): reap echo subprocess cleanly in test_echo_thin_waist (fixes #1541)](https://github.com/libp2p/py-libp2p/pull/1542). This addressed a specific issue where the echo example tests were leaving processes hanging. It’s a small fix but a necessary one for keeping the \"thin waist\" of the protocol stack actually thin and manageable.\n\nFinally, I have an open PR over at **sixb** titled [storage: durable, swept file upload sessions for pg and sqlite](https://github.com/sixb-ai/sixb/pull/612). This is a much heavier lift on the \"new feature\" side of things. I’m building out a more resilient way to handle file uploads, ensuring that sessions are durable across restarts and properly \"swept\" (cleaned up) when they expire. It’s currently at 1,493 additions, which is where most of my \"new\" code lived this week. I'm supporting both PostgreSQL and SQLite, which always adds a layer of complexity when you're trying to keep the abstraction clean. It’s still in review, but I’m looking forward to getting this landed to make the storage layer more robust.\n\nI managed to get into the reviewer's seat twice this week, which I always try to do to stay connected with what else is happening in the ecosystem.\n\nFirst, I looked at a PR in **agent-orchestrator**: [feat(packaging): support Arch Linux and stop self-updates on system installs](https://github.com/Untrivial-ai/agent-orchestrator/pull/5137). Packaging is one of those things that is easy to get wrong, especially when it comes to \"self-updating\" logic. You really don't want a binary trying to update itself if it was installed via `pacman`. I approved this one as it makes the tool a much better citizen on Linux systems.\n\nI also reviewed a PR in **py-libp2p**: [eg/1130-add-gossipsub-comparison-and-standalone-examples](https://github.com/libp2p/py-libp2p/pull/1139). This was a nice coincidence given my work on `minip2p`. It adds better examples and comparisons for Gossipsub, which is exactly what the project needs as we steer people away from older protocols. Good docs and examples are the best way to prevent people from reaching for the wrong tools.\n\nThis was a classic polyglot week for me, split between **Rust** and **Python**.\n\nThe Rust work was deep and structural. When you're working with p2p protocols, Rust’s type system is a godsend for making sure you don't leave any edge cases unhandled when ripping out a whole protocol layer. The net-negative line count this week is a badge of honor. Refactoring isn't always glamorous, but it’s how you keep a project from collapsing under its own weight.\n\nThe Python work was more about the glue and the storage logic. Python is great for iterating on things like storage sessions and test harnesses where you want to move fast. Even though I was adding code in my `sixb` PR, the overall week was still dominated by the massive deletions in `minip2p`.\n\nNext week, I’m hoping to get that `sixb` storage PR merged. It’s a big chunk of code, and I want to make sure the \"sweeping\" logic for old sessions is rock solid before it hits production. I'll also be keeping an eye on `minip2p` to see if my Floodsub removal caused any unexpected friction for downstream users—though, honestly, I think everyone will be happy to see it gone.\n\nThere's also some more work to do on the `py-libp2p` test suite. Now that the echo tests are stable, I want to look at some of the other long-running examples that occasionally time out in CI. It’s a never-ending battle, but someone’s gotta do it!", "url": "https://wpnews.pro/news/dev-log-22-tearing-out-the-old-deleting-3800-lines-of-legacy-p2p-code", "canonical_source": "https://dev.to/yashksaini/dev-log-22-tearing-out-the-old-deleting-3800-lines-of-legacy-p2p-code-3n0i", "published_at": "2026-09-21 04:00:59+00:00", "updated_at": "2026-09-21 04:23:10.228175+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Yash Saini", "minip2p", "py-libp2p", "sixb", "libp2p", "Floodsub", "Gossipsub", "GitHub"], "alternates": {"html": "https://wpnews.pro/news/dev-log-22-tearing-out-the-old-deleting-3800-lines-of-legacy-p2p-code", "markdown": "https://wpnews.pro/news/dev-log-22-tearing-out-the-old-deleting-3800-lines-of-legacy-p2p-code.md", "text": "https://wpnews.pro/news/dev-log-22-tearing-out-the-old-deleting-3800-lines-of-legacy-p2p-code.txt", "jsonld": "https://wpnews.pro/news/dev-log-22-tearing-out-the-old-deleting-3800-lines-of-legacy-p2p-code.jsonld"}}