Re-add ASmap support (followup to #146 / #217)

未关闭
#807 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
28/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
冷清
技术栈
docker

调研方向

先从 resources/images/bitcoin/addrman.patch 和两个 Dockerfiles 开始,以了解无条件应用的补丁,然后检查 bitcoincore chart,查找缺失的 -asmap plumbing 和 mounts。将提议的 plugin 方案与 pod.yaml 中的 loadSnapshot.enabled 模式以及 network.yaml 中的 annotations 进行比较。完成的标准是就架构达成一致,并确定是否应在实现之前将条件补丁分离出来。

由索引模型根据 Issue 内容生成。

描述

Quick motivation: I'd like to experiment a bit with -asmap effectiveness and netgroup-bucketing on a realistic topology and warnet seems like the natural substrate, but -asmap= isn't currently reachable through the chart.

Picking back up the ASmap question that willcl-ark parked in #217 with "we can revisit if needed." With ASmap now embedded in Bitcoin Core v31.0 it's worth another look at warnet, and I'd appreciate input on the right architectural shape before any PR.

What's actually disabled today

resources/images/bitcoin/addrman.patch is applied unconditionally in both Dockerfiles. It extends the netgroup vector with the lower two IPv4 bytes, turning bucketing from /16 into /32. Because both the default /16 path and any ASmap path share GetGroup(), the patch silently disables both. So even leaving ASmap aside, scenarios that reason about peer diversity at the netgroup level aren't exercising the production codepath.

On top of that, the bitcoincore chart has no -asmap= plumbing and no mount slot for an asmap file.

Two plausible shapes

I'd rather decide direction before writing code:

A) postNetwork plugin that reads per-tank ASN annotations from network.yaml, builds a synthetic asmap from scheduled pod IPs, and exposes it as a ConfigMap. Tanks gate on it via an init-container. The same pattern already used for loadSnapshot.enabled in pod.yaml. Closest to m3dwards' #217 sketch, adapted to the current architecture.

B) Minimal -asmap= plumbing only in the chart, with users supplying their own asmap. Pod IPs stay unmapped (fall back to /16 bucketing for them), but it's a small, single-PR change that covers use cases where pod-IP-to-ASN mapping isn't the point.

Both share a prerequisite: making addrman.patch conditional via build-arg, since nothing downstream of GetGroup() matters until that's lifted.

What I'm asking

  1. Does A or B (or some other shape) match how warnet should evolve?
  2. Is the conditional addrman.patch worth a separate small PR first? It independently unblocks any netgroup-aware testing, ASmap or not.

Happy to drop this if there's no appetite right now. Wanted to surface the design question before investing implementation time.

主要语言
Python
星标
153
派生
87
平均合并
5 天 7 小时
30 天内合并 PR
3

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bitcoin-dev-project/warnet 的其他 Issue

查看 bitcoin-dev-project/warnet 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。