{
  "base_url": "https://talk.nervos.org",
  "generated_at": "2026-04-27T18:04:04.515171+00:00",
  "since": "2026-04-26T18:03:54.084841+00:00",
  "until": "2026-04-27T18:03:54.084841+00:00",
  "window_hours": 24,
  "topics": [
    {
      "topic_id": 10045,
      "title": "Spark Program | fiber-checkout — A \"Stripe-Style\" React Payment Library for Fiber Network",
      "slug": "spark-program-fiber-checkout-a-stripe-style-react-payment-library-for-fiber-network",
      "url": "https://talk.nervos.org/t/spark-program-fiber-checkout-a-stripe-style-react-payment-library-for-fiber-network/10045",
      "created_at": "2026-03-08T15:01:59.345000+00:00",
      "last_posted_at": "2026-04-27T16:45:59.880000+00:00",
      "category_id": 49,
      "tags": [
        "Completion",
        "Spark-Program"
      ],
      "posters": [
        "Original Poster",
        "Frequent Poster",
        "Frequent Poster",
        "Most Recent Poster"
      ],
      "recent_posts": [
        {
          "post_id": 24048,
          "post_number": 27,
          "topic_id": 10045,
          "topic_title": "Spark Program | fiber-checkout — A \"Stripe-Style\" React Payment Library for Fiber Network",
          "topic_slug": "spark-program-fiber-checkout-a-stripe-style-react-payment-library-for-fiber-network",
          "author": "xingtianchunyan",
          "created_at": "2026-04-27T16:45:59.880000+00:00",
          "updated_at": "2026-04-27T16:45:59.880000+00:00",
          "reply_to_post_number": 26,
          "url": "https://talk.nervos.org/t/spark-program-fiber-checkout-a-stripe-style-react-payment-library-for-fiber-network/10045/27",
          "content_text": "Spark Program｜fiber-checkout —— 结项报告\n1. 结项评价 / Final Evaluation\n完成日期 / Completion Date：2026年4月22日\n评价摘要 / Evaluation Summary：\nfiber-checkout 项目在 Spark Program 的资助周期内完成并发布了一个面向 Web/React 开发者的 Fiber 支付接入组件库（React 组件 + Hooks），并提交了可公开访问的关键交付物：开源仓库、npm 包、在线 demo、测试网可复现验证材料与演示视频等。\n该项目补齐了 Fiber 生态“前端接入工具链”的关键一环：在 fiber-js 与 Fiber 协议能力已具备的前提下，把开发者实际会踩的最后一公里问题（编码/状态机/错误处理/部署安全边界/可复现验收）产品化为可复用组件与参考实现，从而显著降低集成门槛。\n主要成果 / Key Achievements：\n交付可复用的前端接入层：发布 fiber-checkout npm 包（React 18+，TypeScript strict，CJS+ESM 双构建），提供 <FiberCheckout /> 组件与 useFiberInvoice / useFiberPayment hooks。\n交付可复现验收证据：提供测试网验证说明与证据材料（含验证证据文档与演示视频），使第三方可较低成本复核“端到端支付”与接口行为；同时在文档中明确了 Fiber 的“支付 hash ≠ CKB L1 交易”这一关键口径。\n交付生产部署参考实现与安全边界说明：提供 Next.js proxy 参考实现，并进一步厘清“同域 path 代理 / 跨域 HTTPS 反向代理 / raw IP 直连”三类场景的风险分层与默认推荐。\n补齐可维护性关键点：在资产扩展方面提供 customAssets 思路，避免“每新增资产都要发版”的维护陷阱；并承诺一定周期的兼容性维护与对上游 breaking change 的响应方式。\n补齐两项结项阶段增值交付：按委员会要求将配套指南以 Markdown 形式沉淀到 repo（docs/nextjs-guide.md），并在帖子中将完成报告重写为“开发者回顾/工程叙事”（Post #26）。\n创新点与价值 / Innovation & Value：\n生态工具链补位：把“协议可用”转译为“产品团队可用”的接入范式（组件 / hooks / 代理 / 验证证据），降低 Fiber 支付走向真实应用的 friction。\n可验收交付标准化：将 How-to-Verify 与证据链作为交付物一部分推进完善，为 Spark 后续工具类项目提供了更清晰的验收路径示范。\n安全边界意识：在“浏览器直连 RPC”易误用的场景下，通过默认代理与方法白名单、以及 dangerouslyAllowDirectRpc 的风险标识，主动把安全责任边界写清楚、做出来。\n2. 评审过程 / Review Process\n2.1 立项前预审：把“能做”变成“可验收、可长期复用”\n委员会在预审阶段集中提出了 5 类补充要求（对应贴内讨论）：\n预算与项目分类：将预算调整到纯技术项目上限口径，并给出匹配的拆分。\n团队背景证据：补充过往项目/开源链接，降低交付不确定性。\nHow to Verify（可复现验收）：要求给出低成本可复核的验收路径（脚本/清单/覆盖率/端到端证据）。\n维护计划：由于 fiber-js 与 Fiber 仍处在快速演进期，需要明确 grant 结束后的维护窗口、breaking change 响应方式与后续可持续路径。\n部署架构与安全边界：重点审阅“浏览器是否需要直连 RPC”，要求给出代理/中间层方案并说明安全影响。\n2.2 Pending 阶段：依赖库项目必须补齐“长期维护”与“交付物细化”\n委员会曾将项目置于 Pending（非拒绝），核心原因在于：fiber-checkout 属于依赖库/组件库，生态会强依赖其维护质量，这与 Spark 更偏“短周期 MVP + 初步验证”的定位存在张力。委员会要求项目方进一步补齐：\n6 个月之后的长期维护安排；\n更细粒度的交付物定义（API/兼容性/验收方式/长期可用性等）。\n在项目方补齐上述材料并将预算调整到合规口径后，委员会批准项目进入执行与周同步。\n2.3 执行与验收：把“争议点”落为“证据链与边界条件”\n执行期与结项阶段，委员会对“可验证性”和“边界条件”提出的关键点包括：\n支付证据不足：要求在视频/材料中明确展示“使用的钱包 + 交易后金额变化”，或提供可复现的图文验证路径（tx hash / explorer link + 标注截图）。\nnpm 元信息指向正确仓库：避免交付物不可追溯。\nSEAL 的 public verifiable 问题：公共节点白名单限制导致 SEAL 无法在公共测试网条件下直接验收，要求给出本地最小验证路径、预期输出，并明确“何时可 public verify”。\n为什么需要 Vercel/代理：要求从安全、CORS、Mixed Content、隐私等角度写清楚 proxy 的必要性与方法白名单。\nfiber-js peer dependency / re-export / FiberWasmBackend 解释：要求在 README 中写清楚“为什么是 peer dependency”“re-export 的使用方式”“RPC vs WASM 两种模式的定位与推荐默认”。\n资产硬编码的扩展性：要求避免“新增资产必须发版”的长期维护陷阱，给出可配置机制或明确 scope。\n申请人随后补充了验证证据文档与新版演示视频、给出 SEAL 本地验证路径、解释 proxy 的必要性、补充 peer dependency 的 rationale，并将资产 registry 重构为可支持 customAssets 的扩展方式；此外，Hanssen 就“跨域 HTTPS 反代并不危险却被危险标志误伤”的场景提出问题，项目方承诺并修正 dangerouslyAllowDirectRpc 判定逻辑（只对 raw IP 的 HTTP 直连视为危险）。\n3. 资金发放详情 / Funding Details\n资助总额： 664,452 CKB（等值 $1,000 USD），100% 以 CKB 形式发放。\n**开发者收款地址：\n** 首次收款地址（在 post #10 指定）\nckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqtqfa0uv43d5m67gkn4d0wkp69k8e8axeqzwzmkx\n** 后续收款地址（在 post *22 指定），下方为自动解析后的长地址\nckb1qyqvaj4pmuw9vxurdlg8lx3sv7ywmcge33vsvrvu39\nckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqwwe2sa78zkrwpkl5rlngcx0z8duyvcckgyzehvc\n发放 / Installment\n比例 / %\n金额 / Amount （CKB）\n交易哈希 / Tx Hash\n启动资金\n20%\n132,890\n0x8190711c80f318fa9316b0cc8cc883b75f2c433a3b6d2145f30c814d880e7b54\n结项资金\n80%\n531,562\n0x924dad366fd5e989b4907940960a0c6c7458e0d656f845f33e4367f649138fb7\n特别说明：申请人在提案/报告中给出的按周拆分表可作为工作量与范围的申请，但因流程/对齐原因未能实现每周打款，这个情况的出现是因为星火计划委员会的协调员行天（@xingtianchunyan）未能帮助申请人与委员会达成有效沟通，导致最终预算按照”首笔+结项“发放。委员会对此情形的意见是除了严格执行内部确认步骤，也要提前向有同样需求的申请人说明，请他在每周同步时明确当周所需预算和对应的交付物，以确保此类问题不再发生。\n4. 星火计划委员会复盘 / Spark Committee Reflection\n本项目属于需要长期运行的开发者依赖的工具库，结项总结因此需要沉淀对 Spark 流程的可复用经验，而不仅仅是确认交付完成。以下是委员会从这个项目中提取的两条核心经验。\n经验一：工具/依赖库类项目，验收必须绑定“可复现证据链”\nfiber-checkout 的关键风险不在于“功能是否实现”，而在于第三方是否能低成本复核、并在真实集成时踩坑成本可控。委员会在过程里反复强调 How to Verify、证据材料、以及视频/文档的可复核性，最终推动申请人补齐 VERIFICATION_EVIDENCE.md 与更清晰的演示材料。\n建议沉淀为 Spark checklist： 对工具库项目，立项即要求“验收脚本/步骤 + 证据发布位置 + 预期输出”三件套。\n经验二：安全边界不是“讲出来”，而是要“写进默认架构”\n“浏览器直连节点 RPC”在开发期可能方便，但在生产环境容易把基础设施风险转嫁给集成方。委员会要求默认走代理与方法白名单，并且将 dangerouslyAllowDirectRpc 的风险场景严格限定为 raw IP 的 HTTP 直连，避免把“跨域 HTTPS 反代”这种合理架构误标为危险。\n建议沉淀为 Spark checklist： 任何涉及 RPC/基础设施的项目，需明确“生产默认架构 + 安全边界 + 可用的参考实现”。\n5. 星火计划委员会洞见 / Spark Committee Insights\n我们希望对开发者的投入有所回应；在开发者开发时我们有所思考；当开发者低头赶路我们极目远眺。\n洞见问题 1：Fiber 真的能改变 Crypto Payment 吗？\n我们的回答是：有机会，但还有很远的路要走，能否真正实现取决于生态成熟度和采用率。\nFiber 具备改变 Crypto Payment 的技术架构，但不具备改变 Crypto Payment 的生态条件。更准确地说：Fiber 代表了闪电网络的\"下一代技术形态\"——多资产、WASM 浏览器节点、PTLC、O(1) Watchtower、跨链互操作。这些技术选择在工程方向上是正确的，解决了 Lightning Network 积累十年的核心痛点。但\"改变 Crypto Payment\"需要的不仅是更好的协议设计，还需要足够的网络效应、应用生态、用户基数和法规适配。 Fiber 目前在这四个维度上都处于早期。\n一个更现实的判断是：Fiber 不太可能独自改变 Crypto Payment，但它有可能成为改变 Crypto Payment 的技术栈中的关键一层。 如果 CKB 生态能围绕 Fiber 建立起足够的应用密度，如果跨链互操作让 Fiber 和 Lightning 真正形成统一网络，如果 WASM 节点降低的门槛确实带来了新增用户——那么 Fiber 的技术优势就有机会转化为网络优势。但这些\"如果\"中的每一个都需要大量执行层面的工作，而非仅靠协议层面的优雅。\n1-1. 先定义\"改变\"：Crypto Payment 当前卡在哪里\n回答这个问题之前，必须先搞清楚 Crypto Payment 的真正瓶颈是什么。不是技术不够快、不够便宜——Solana 的 TPS 已经足够高，TRON 上 USDT 转账手续费不到 1 美元。真正的瓶颈是三个结构性问题：波动性、用户摩擦、和网络效应。\n波动性。 商家不愿意接受一种明天可能贬值 10% 的资产。消费者也不愿意花一种明天可能升值 10% 的资产。这就是为什么 BTC 作为\"数字黄金\"的叙事越成功，它作为支付媒介就越失败。Forbes 2026 年 3 月的报道指出，稳定币跨境支付正在从理论走向实践，2026 年的讨论重心已从\"是否可行\"转向\"如何执行\"。支付的未来属于稳定币，不属于波动性资产。\n用户摩擦。 今天在链上支付，用户需要：安装钱包、备份助记词、购买 Gas 代币、理解网络选择、等待确认。每多一个步骤，用户转化率呈指数下降。Lightning Network 试图解决这个问题，但它自身也引入了新的摩擦——用户需要安装专用钱包（Phoenix、Breez），通过 LSP 管理通道流动性，且只能转 BTC。\n网络效应。 支付网络的价值遵循梅特卡夫定律。Visa 的护城河不是技术，而是 8000 万商户和 40 亿张卡。一个支付网络如果没有足够的商户和用户，技术再好也是自娱自乐。\n1-2. Fiber 在技术层面对这三个问题给出了什么回应\n对波动性：原生多资产支持。 这是 Fiber 相对于 Bitcoin Lightning Network 最关键的结构性差异。Lightning Network 从诞生至今只能转 BTC（Taproot Assets 于 2024 年 7 月上线主网版本，尝试引入稳定币，但仍处于早期）。Fiber 基于 CKB 的 UDT 架构，原生支持 CKB、RUSD（Stable++ 稳定币）、SEAL 及任意 RGB++ 代币。这意味着 Fiber 从第一天就可以做稳定币闪电支付，而不需要等待底层链的协议升级。 Gate.com 的分析文章也明确指出，Lightning Network 面临的最大挑战之一就是缺乏稳定币支持，而 CKB 的 Fiber Network 被视为解决这一问题的路径之一。\n对用户摩擦：WASM 浏览器节点 + Passkey 签名。 Fiber 的 @nervosnetwork/fiber-js 将完整的闪电网络节点编译为 WebAssembly，可直接在浏览器中运行。配合 Passkey（WebAuthn）签名（fiber-pay v0.2.1 已实现），用户体验变成：打开网页 → 指纹/面部识别 → 支付完成。没有钱包安装、没有助记词、没有 Gas 概念。 在整个 Web3 行业中，这种\"零安装支付节点\"几乎没有对标方案——Lightning Network 没有可用的浏览器节点（LDK 的 WASM 探索未达生产可用），以太坊 L2 的支付仍是链上交易 + 钱包签名，Solana Pay 虽然确认快但仍需钱包参与。\n对网络效应：跨链原子交换。 Fiber 不是一个孤立网络。通过 CCH（Cross-Chain Hub）模块，Fiber 节点可以支付 Bitcoin Lightning 发票，反之亦然。这意味着 Fiber 不需要从零建立自己的商户网络——它可以借力 Lightning Network 已有的数万个支付接入点。同时，Fiber 的多资产能力反向增强了 Lightning 生态，使 Lightning 用户可以通过 Fiber 边缘节点接触到稳定币。\n1-3. 但技术回应不等于改变行业——差距在哪里\n第一，网络规模差了数量级。 124 个 Fiber 节点、1,525 个通道、约 152 万 CKB 的流动性。作为对比，Bitcoin Lightning Network 在 2025 年拥有超过 15,000 个活跃节点和约 5 万个通道。Fiber 的网络规模大约是 Lightning 的 1/100。闪电网络的价值高度依赖于路由路径的多样性和流动性深度——网络太小，多跳支付找不到路径，支付成功率就会很低。\n第二，关键功能尚未完成。 Fiber 核心开发者 quake 在 Nervos Talk 的开发状态帖中明确表示，Fiber 目前处于\"协议完整、网络验证中\"的阶段。Multi-path payment（多路径支付）和 Payment Offers 在 2025 Q2 规划中，PTLC 升级在 2025 Q3。这些不是锦上添花的功能，而是支付网络走向生产级应用的必要条件。\n第三，CKB 生态的体量限制。 Fiber 的天花板很大程度上由 CKB 生态本身决定。一个支付网络需要有人用它来买东西、付服务费、给创作者打赏。如果 CKB 生态没有足够多的应用和用户产生支付需求，Fiber 的通道里就不会有真实的交易流量。Nervos 关停 Godwoken 和 Force Bridge 聚焦 Fiber，战略方向是清晰的，但战略清晰不等于生态繁荣。\n第四，行业竞争格局已经变化。 2026 年的 Crypto Payment 竞争不再只是链上方案之间的比较。Stripe 在 2025 年以 11 亿美元收购 Bridge（稳定币基础设施公司），Circle 推出可编程钱包，Coinbase Commerce 持续迭代。这些 CeFi/FinTech 方案虽然牺牲了去中心化，但在用户体验和合规性上远远领先。Fiber 的竞争对手不仅是 Lightning Network，还包括这些正在快速渗透商户端的中心化解决方案。\n洞见问题 2：Fiber 能为 CKB 生态带来什么新改变？——从 Fiber Checkout 看到的信号\n核心判断：Fiber 正在将 CKB 从一条\"存储型公链\"推向\"支付型基础设施\"。\n从 Fiber Checkout 可以看到：Fiber 正在给 CKB 生态注入它此前最缺的东西——一个有实际用途的应用场景（支付）和围绕这个场景自发生长的开发者工具链。\n具体而言，Fiber 带来了五个可观察到的改变：\n解决了 CKB L1 小额支付的经济不可行性，为 CKB 创造了\"支付身份\"\n将多资产能力从协议层推到了应用层，差异化竞争力开始兑现\n降低了开发者门槛，吸引了不熟悉 CKB 底层的前端开发者进入生态\n催生了围绕支付的项目网络效应雏形，L402、fiber-pay、Fiber Link 等项目形成协作关系\nWASM 浏览器节点提供了行业前沿的\"无服务器支付\"范式\n但这个改变目前仍是\"种子阶段\"。Fiber Checkout 是连接 Fiber 基础设施和实际商业应用之间的关键桥梁，但桥梁两端都需要继续建设：一端是 Fiber 网络本身的规模和稳定性，另一端是 CKB 生态中足以支撑支付需求的应用密度。技术路线是对的，生态体量还不够。\n2-1. Fiber Checkout 是什么，以及为什么它是一个有意义的观察窗口\nFiber Checkout 是一个由社区开发者 Salman 在 Spark Program 资助下构建的 React 组件库。它的技术定位很窄：封装 Fiber 的 new_invoice 和 get_payment RPC 调用，提供一个 <FiberCheckout> 组件和两个 Hook（useFiberInvoice、useFiberPayment），让前端开发者用一行代码在网站上集成 Fiber 支付。\nimport { FiberCheckout } from 'fiber-checkout';\n<FiberCheckout\namount={5}\nasset=\"RUSD\"\nnodeUrl=\"...\"\nonSuccess={handleSuccess}\n/>\n它的重要性不在于代码量或技术复杂度，而在于它作为一个信号所揭示的生态转变方向。一个生态如果开始出现\"让普通开发者更容易使用底层协议\"的工具层项目，说明这个生态正在从基础设施阶段向应用阶段过渡。 以下分析以 Fiber Checkout 为观察切入点，讨论 Fiber 正在给 CKB 生态带来的改变。\n2-2. CKB 的\"支付身份\"问题：Fiber 解决了一个架构级的矛盾\nCKB 的 Cell Model 有一个固有的经济约束：每个 Cell 至少需要 61 字节的容量，约合 65 CKB。这意味着在 L1 上转 1 CKB 的打赏，实际需要锁定 65 CKB。这不是 bug，而是 CKB 状态存储模型的固有代价。它使得 CKB L1 在小额支付场景中存在结构性的经济不可行性。\nFiber Checkout 的存在本身就是对这个问题的回应——有开发者认为 Fiber 已经足够成熟，值得为它构建 Stripe 风格的集成工具，而这个工具的核心场景恰恰是 L1 上做不了的小额支付。Fiber 的链下通道将 CKB 的支付成本从\"65 CKB 最低门槛\"降到\"接近零手续费\"，交易确认从\"8 秒等区块\"变成\"20ms P2P 延迟\"。\n这是 CKB 生态定位的根本性转变：从\"做小额支付很贵的存储型公链\"变成\"微支付几乎免费的支付型基础设施\"。\n2-3. 多资产能力第一次穿透到了应用层\nCKB 通过 UDT 和 RGB++ 支持多资产发行，这个能力存在已久，但长期停留在协议层。Fiber Checkout 的资产配置注册表设计（支持 CKB、RUSD、SEAL 及任意 RGB++ UDT）意味着多资产能力第一次被封装成了前端开发者可以直接调用的产品特性。\n对比 Bitcoin Lightning Network 只能转 BTC 单一资产：\n商家可以用 RUSD 稳定币收款，不承受 CKB 价格波动风险\n项目方发行的治理代币、积分代币可以在 Fiber 通道内即时转账\n跨资产 swap 可以在通道路径上完成，无需链上 DEX\n这是 CKB 相对于比特币生态的差异化竞争力，Fiber 正在通过 Checkout 这类工具把它从\"技术论文里的优势\"兑现为\"开发者可以 npm install 的产品能力\"。\n2-4. 开发者门槛的断崖式下降——CKB 生态最缺的东西\nCKB 长期被社区批评为\"对开发者不够友好\"。Cell Model、RISC-V VM、Script 编程范式的学习曲线很陡。Fiber Checkout 的提案原文中有一句话直接点明了它的设计意图：\n“no raw JSON-RPC, no manual hex encoding, no Rust knowledge required”\n这句话的本质含义是：生态开发者已经开始反向构建抽象层，把 CKB 的底层复杂性封装起来，目标用户是普通前端开发者而非协议专家。\n这种自下而上的工具层建设，在 CKB 生态历史上极为罕见。它说明 Fiber 的出现正在吸引一类新的开发者——他们不关心 Cell Model 如何运作，只关心\"能不能让我的网站接受加密支付\"。如果从 Starknet 生态的经验来看（Dojo 引擎 + Cartridge 钱包降低了全链游戏的开发门槛，Cartridge 2025 年完成 750 万美元融资），工具层的成熟度直接决定了一个生态能吸引多少应用层开发者。Fiber Checkout 是 CKB 在支付垂类迈出的第一步。\n2-5. 围绕支付的应用网络效应雏形\nFiber Checkout 不是一个孤立项目。从 Nervos Talk 论坛中可以看到，它与其它围绕Fiber建立起的项目形成了功能互补的协作网络：\n项目\n功能\n与 Checkout 的关系\nFiber L402\nHTTP 402 付费访问协议\nL402 定义付费逻辑，Checkout 提供支付 UI\nFiber-pay\nAI Agent CLI/SDK\n底层 SDK 能力，Checkout 封装为前端组件\nFiber Link\n论坛打赏插件\n社区打赏场景，可用 Checkout 组件标准化支付流程\nFiber Audio Player\n按秒付费播客\n流媒体微支付，需要类 Checkout 的支付闭环\nAgent Pay\n跨链 Fiber↔Lightning Agent 支付\n跨链结算层，Checkout 服务于 Web 端集成\n这些项目共同指向一个模式：Fiber 不只是一个支付通道协议，它正在成为 CKB 生态中各类应用的\"结算层\"。 Fiber Checkout 在这个网络中扮演\"最后一公里\"的角色——任何一个上述场景要面向终端用户，最终都需要一个类似 Checkout 的组件来完成支付闭环。\n项目间的相互引用和技术依赖关系（Fiber-pay 调用 Fiber L402 协议，Checkout 封装 fiber-js，Audio Player 使用 fiber-pay SDK）是生态网络效应的早期信号。CKB 此前很少看到这种应用层的有机生长。\n2-6. WASM 浏览器节点的行业意义：不仅仅是 CKB 的事\nFiber Checkout 支持双后端模式——RPC 模式和 WASM 模式。WASM 模式意味着一个纯前端应用就可以完成完整的支付流程，不需要任何后端服务器。\n放在整个 Web3 行业背景下看，这解决的是一个行业级的结构性问题：\nWeb3 支付长期困在两种不理想的模式中。 第一种是托管中间商（Coinbase Commerce、BitPay、MoonPay）——用户体验好，但引入了托管风险和审查点，本质是 Web2 方式包装 Web3。第二种是钱包签名——去中心化，但每笔交易都是链上交易，要等确认、付 Gas。\nFiber WASM 节点提供了第三种可能：用户在浏览器中运行真正的支付节点，通过 Passkey 签名，完成链下即时支付。 没有托管方，没有链上 Gas，没有钱包安装。一个托管在 IPFS 的纯静态页面就可以成为一个完整的、无人可关停的支付应用。\n但必须指出限制：WASM 节点只能建立 outbound 连接（叶子节点），网络骨干仍需服务器全节点；通道流动性的冷启动依赖 LSP 或用户预先充值；浏览器环境的状态持久性依赖 IndexedDB + Watchtower，清除浏览器数据可能丢失通道状态。\n2-7. 从 Fiber Checkout 看到的限制\n从 Fiber Checkout 同样可以看到 Fiber 给生态带来改变的天花板：\nCheckout 是 Spark Program 资助的个人开发者项目（预算 $1,000 USD），不是 Nervos 官方的核心产品。 这反映出 CKB 生态应用层的建设仍然高度依赖社区资助和个人热情。WarSpore · Saga 的结项报告已经验证了一个经验：solo developer micro-grant 项目的可持续性是一个真实的风险点。Checkout 面临同样的问题。\nCheckout 依赖的 @nervosnetwork/fiber-js 仍在快速迭代（v0.7 → v0.8），接口不稳定。在 Fiber 网络本身只有 124 个节点的情况下，集成 Checkout 的应用即便上线，也可能因为路由路径不足而无法完成支付。工具层的成熟显然不能超前太多。同时，如果 CKB 的支付需求密度不够， 即便 Checkout 让集成变得容易，但 CKB 生态里长期没有足够多的商家、内容创作者、服务提供方需要收款，那么 Checkout 就很难不沦为一个没有使用场景的精美组件。\n6. 总结（Conclusion）\nfiber-checkout 项目在 Spark Program 资助周期内完成了关键交付：发布 npm 包与开源仓库、提供可运行的线上 demo、补齐可复现的验证证据（文档 + 视频）、沉淀 Next.js 集成指南（repo 内 md），并在结项阶段进一步将完成报告升级为“开发者回顾/工程叙事”。委员会认可项目在工程质量与反馈响应上的执行力：它不是把 Fiber 当作“协议能力展示”，而是把前端开发者真实会遇到的支付接入问题（编码、状态机、错误处理、部署安全边界、验收口径）打包成可复用的产品化组件与参考实现。\n更重要的是，本项目让我们看清了 Fiber（以及 CKB 生态支付方向）从“技术可用”走向“生态可用”的关键摩擦点：决定 adoption 的往往不是协议本身有多先进，而是生态是否具备可复制的接入范式、可审计的验证路径、以及默认安全的部署建议。在这条路径上，fiber-checkout 的价值不仅是一个组件库，更像一个“工具链样板”：它把 proxy + 方法白名单、CORS/Mixed Content 的工程现实、以及“Fiber 支付 hash ≠ CKB L1 交易”的验证口径，变成了可被复用、可被讨论、可被继续迭代的公共知识。\n就委员会洞见而言：Fiber 具备改变 Crypto Payment 的技术潜力（多资产、WASM、跨链互操作等），但“改变”不会自动发生——它需要网络规模、应用密度、用户体验与合规环境共同推动。Spark 在 Fiber/payment 方向的关注，也应更偏向“可复用基础设施与标准件”的持续补齐：例如接入层组件与模板、统一的验收/证据链标准、以及面向真实产品团队的文档与工程叙事沉淀机制。开发者低头赶路时，委员会的角色应是抬头看天：既回应投入，也把方向与方法论写进生态的可复用资产中。\n最终交付物链接（以 thread 为准）\nGitHub repo：https://github.com/salmansarwarr/Fiber-checkout\nnpm：https://www.npmjs.com/package/fiber-checkout\nLive demo：https://fiber-checkout.vercel.app/\n配套指南（repo, md）：https://github.com/salmansarwarr/Fiber-checkout/blob/main/docs/nextjs-guide.md\n验证证据文档：https://github.com/salmansarwarr/Fiber-checkout/blob/main/VERIFICATION_EVIDENCE.md\n演示视频（新版）：https://www.youtube.com/watch?v=bWKslRFl-98\n开发者回顾式完成报告（工程叙事）：https://talk.nervos.org/t/spark-program-fiber-checkout-a-stripe-style-react-payment-library-for-fiber-network/10045/26\n行天 / @xingtianchunyan\n代表星火计划委员会\ncc：@zz_tovarishch，@yixiu.ckbfans.bit，@Hanssen",
          "content_html": "<h1><a name=\"p-24048-spark-programfiber-checkout-1\" class=\"anchor\" href=\"#p-24048-spark-programfiber-checkout-1\" aria-label=\"Heading link\"></a><strong>Spark Program｜fiber-checkout —— 结项报告</strong></h1>\n<h2><a name=\"p-24048-h-1-final-evaluation-2\" class=\"anchor\" href=\"#p-24048-h-1-final-evaluation-2\" aria-label=\"Heading link\"></a>1. 结项评价 <strong>/ Final Evaluation</strong></h2>\n<ul>\n<li>\n<p><strong>完成日期 <strong>/ Completion Date</strong>：2026年4月22日</strong></p>\n</li>\n<li>\n<p><strong>评价摘要 <strong>/ Evaluation Summary</strong>：</strong><br>\nfiber-checkout 项目在 Spark Program 的资助周期内完成并发布了一个面向 Web/React 开发者的 Fiber 支付接入组件库（React 组件 + Hooks），并提交了可公开访问的关键交付物：开源仓库、npm 包、在线 demo、测试网可复现验证材料与演示视频等。<br>\n该项目补齐了 Fiber 生态“前端接入工具链”的关键一环：在 fiber-js 与 Fiber 协议能力已具备的前提下，把开发者实际会踩的最后一公里问题（编码/状态机/错误处理/部署安全边界/可复现验收）产品化为可复用组件与参考实现，从而显著降低集成门槛。</p>\n</li>\n<li>\n<p><strong>主要成果 <strong>/ Key Achievements</strong>：</strong></p>\n<ol>\n<li><strong>交付可复用的前端接入层</strong>：发布 <code>fiber-checkout</code> npm 包（React 18+，TypeScript strict，CJS+ESM 双构建），提供 <code>&lt;FiberCheckout /&gt;</code> 组件与 <code>useFiberInvoice</code> / <code>useFiberPayment</code> hooks。</li>\n<li><strong>交付可复现验收证据</strong>：提供测试网验证说明与证据材料（含验证证据文档与演示视频），使第三方可较低成本复核“端到端支付”与接口行为；同时在文档中明确了 Fiber 的“支付 hash ≠ CKB L1 交易”这一关键口径。</li>\n<li><strong>交付生产部署参考实现与安全边界说明</strong>：提供 Next.js proxy 参考实现，并进一步厘清“同域 path 代理 / 跨域 HTTPS 反向代理 / raw IP 直连”三类场景的风险分层与默认推荐。</li>\n<li><strong>补齐可维护性关键点</strong>：在资产扩展方面提供 <code>customAssets</code> 思路，避免“每新增资产都要发版”的维护陷阱；并承诺一定周期的兼容性维护与对上游 breaking change 的响应方式。</li>\n<li><strong>补齐两项结项阶段增值交付</strong>：按委员会要求将配套指南以 Markdown 形式沉淀到 repo（<code>docs/nextjs-guide.md</code>），并在帖子中将完成报告重写为“开发者回顾/工程叙事”（Post <span class=\"hashtag-raw\">#26</span>）。</li>\n</ol>\n</li>\n<li>\n<p><strong>创新点与价值 <strong>/ Innovation &amp; Value</strong>：</strong></p>\n<ul>\n<li><strong>生态工具链补位</strong>：把“协议可用”转译为“产品团队可用”的接入范式（组件 / hooks / 代理 / 验证证据），降低 Fiber 支付走向真实应用的 friction。</li>\n<li><strong>可验收交付标准化</strong>：将 How-to-Verify 与证据链作为交付物一部分推进完善，为 Spark 后续工具类项目提供了更清晰的验收路径示范。</li>\n<li><strong>安全边界意识</strong>：在“浏览器直连 RPC”易误用的场景下，通过默认代理与方法白名单、以及 <code>dangerouslyAllowDirectRpc</code> 的风险标识，主动把安全责任边界写清楚、做出来。</li>\n</ul>\n</li>\n</ul>\n<hr>\n<h2><a name=\"p-24048-h-2-review-process-3\" class=\"anchor\" href=\"#p-24048-h-2-review-process-3\" aria-label=\"Heading link\"></a>2. 评审过程 / Review Process</h2>\n<h3><a name=\"p-24048-h-21-4\" class=\"anchor\" href=\"#p-24048-h-21-4\" aria-label=\"Heading link\"></a>2.1 立项前预审：把“能做”变成“可验收、可长期复用”</h3>\n<p>委员会在预审阶段集中提出了 5 类补充要求（对应贴内讨论）：</p>\n<ol>\n<li><strong>预算与项目分类</strong>：将预算调整到纯技术项目上限口径，并给出匹配的拆分。</li>\n<li><strong>团队背景证据</strong>：补充过往项目/开源链接，降低交付不确定性。</li>\n<li><strong>How to Verify（可复现验收）</strong>：要求给出低成本可复核的验收路径（脚本/清单/覆盖率/端到端证据）。</li>\n<li><strong>维护计划</strong>：由于 fiber-js 与 Fiber 仍处在快速演进期，需要明确 grant 结束后的维护窗口、breaking change 响应方式与后续可持续路径。</li>\n<li><strong>部署架构与安全边界</strong>：重点审阅“浏览器是否需要直连 RPC”，要求给出代理/中间层方案并说明安全影响。</li>\n</ol>\n<h3><a name=\"p-24048-h-22-pending-5\" class=\"anchor\" href=\"#p-24048-h-22-pending-5\" aria-label=\"Heading link\"></a>2.2 Pending 阶段：依赖库项目必须补齐“长期维护”与“交付物细化”</h3>\n<p>委员会曾将项目置于 Pending（非拒绝），核心原因在于：fiber-checkout 属于依赖库/组件库，生态会强依赖其维护质量，这与 Spark 更偏“短周期 MVP + 初步验证”的定位存在张力。委员会要求项目方进一步补齐：</p>\n<ul>\n<li><strong>6 个月之后的长期维护安排</strong>；</li>\n<li><strong>更细粒度的交付物定义</strong>（API/兼容性/验收方式/长期可用性等）。</li>\n</ul>\n<p>在项目方补齐上述材料并将预算调整到合规口径后，委员会批准项目进入执行与周同步。</p>\n<h3><a name=\"p-24048-h-23-6\" class=\"anchor\" href=\"#p-24048-h-23-6\" aria-label=\"Heading link\"></a>2.3 执行与验收：把“争议点”落为“证据链与边界条件”</h3>\n<p>执行期与结项阶段，委员会对“可验证性”和“边界条件”提出的关键点包括：</p>\n<ul>\n<li><strong>支付证据不足</strong>：要求在视频/材料中明确展示“使用的钱包 + 交易后金额变化”，或提供可复现的图文验证路径（tx hash / explorer link + 标注截图）。</li>\n<li><strong>npm 元信息指向正确仓库</strong>：避免交付物不可追溯。</li>\n<li><strong>SEAL 的 public verifiable 问题</strong>：公共节点白名单限制导致 SEAL 无法在公共测试网条件下直接验收，要求给出本地最小验证路径、预期输出，并明确“何时可 public verify”。</li>\n<li><strong>为什么需要 Vercel/代理</strong>：要求从安全、CORS、Mixed Content、隐私等角度写清楚 proxy 的必要性与方法白名单。</li>\n<li><strong>fiber-js peer dependency / re-export / FiberWasmBackend 解释</strong>：要求在 README 中写清楚“为什么是 peer dependency”“re-export 的使用方式”“RPC vs WASM 两种模式的定位与推荐默认”。</li>\n<li><strong>资产硬编码的扩展性</strong>：要求避免“新增资产必须发版”的长期维护陷阱，给出可配置机制或明确 scope。</li>\n</ul>\n<p>申请人随后补充了验证证据文档与新版演示视频、给出 SEAL 本地验证路径、解释 proxy 的必要性、补充 peer dependency 的 rationale，并将资产 registry 重构为可支持 <code>customAssets</code> 的扩展方式；此外，Hanssen 就“跨域 HTTPS 反代并不危险却被危险标志误伤”的场景提出问题，项目方承诺并修正 <code>dangerouslyAllowDirectRpc</code> 判定逻辑（只对 raw IP 的 HTTP 直连视为危险）。</p>\n<hr>\n<h2><a name=\"p-24048-h-3-funding-details-7\" class=\"anchor\" href=\"#p-24048-h-3-funding-details-7\" aria-label=\"Heading link\"></a>3. 资金发放详情 / Funding Details</h2>\n<ul>\n<li>\n<p><strong>资助总额：</strong> 664,452 CKB（等值 $1,000 USD），100% 以 CKB 形式发放。</p>\n</li>\n<li>\n<p>**开发者收款地址：<br>\n** 首次收款地址（在 post <span class=\"hashtag-raw\">#10</span> 指定）<br>\n<code>ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqtqfa0uv43d5m67gkn4d0wkp69k8e8axeqzwzmkx</code><br>\n** 后续收款地址（在 post *22 指定），下方为自动解析后的长地址<br>\n<code>ckb1qyqvaj4pmuw9vxurdlg8lx3sv7ywmcge33vsvrvu39</code><br>\n<code>ckb1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqwwe2sa78zkrwpkl5rlngcx0z8duyvcckgyzehvc</code></p>\n</li>\n</ul>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>发放 / Installment</th>\n<th>比例 / %</th>\n<th>金额 / Amount （CKB）</th>\n<th>交易哈希 / Tx Hash</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>启动资金</td>\n<td>20%</td>\n<td>132,890</td>\n<td><a href=\"https://explorer.nervos.org/en/transaction/0x8190711c80f318fa9316b0cc8cc883b75f2c433a3b6d2145f30c814d880e7b54\" rel=\"noopener nofollow ugc\">0x8190711c80f318fa9316b0cc8cc883b75f2c433a3b6d2145f30c814d880e7b54</a></td>\n</tr>\n<tr>\n<td>结项资金</td>\n<td>80%</td>\n<td>531,562</td>\n<td><a href=\"https://explorer.nervos.org/en/transaction/0x924dad366fd5e989b4907940960a0c6c7458e0d656f845f33e4367f649138fb7\" rel=\"noopener nofollow ugc\">0x924dad366fd5e989b4907940960a0c6c7458e0d656f845f33e4367f649138fb7</a></td>\n</tr>\n</tbody>\n</table>\n</div><blockquote>\n<p>特别说明：申请人在提案/报告中给出的按周拆分表可作为工作量与范围的申请，但因流程/对齐原因未能实现每周打款，这个情况的出现是因为星火计划委员会的协调员行天（<a class=\"mention\" href=\"/u/xingtianchunyan\">@xingtianchunyan</a>）未能帮助申请人与委员会达成有效沟通，导致最终预算按照”首笔+结项“发放。委员会对此情形的意见是除了严格执行内部确认步骤，也要提前向有同样需求的申请人说明，请他在每周同步时明确当周所需预算和对应的交付物，以确保此类问题不再发生。</p>\n</blockquote>\n<hr>\n<h2><a name=\"p-24048-h-4-spark-committee-reflection-8\" class=\"anchor\" href=\"#p-24048-h-4-spark-committee-reflection-8\" aria-label=\"Heading link\"></a>4. 星火计划委员会复盘 / Spark Committee Reflection</h2>\n<p>本项目属于需要长期运行的开发者依赖的工具库，结项总结因此需要沉淀对 Spark 流程的可复用经验，而不仅仅是确认交付完成。以下是委员会从这个项目中提取的两条核心经验。</p>\n<h3><a name=\"p-24048-h-9\" class=\"anchor\" href=\"#p-24048-h-9\" aria-label=\"Heading link\"></a>经验一：工具/依赖库类项目，验收必须绑定“可复现证据链”</h3>\n<p>fiber-checkout 的关键风险不在于“功能是否实现”，而在于第三方是否能低成本复核、并在真实集成时踩坑成本可控。委员会在过程里反复强调 How to Verify、证据材料、以及视频/文档的可复核性，最终推动申请人补齐 <code>VERIFICATION_EVIDENCE.md</code> 与更清晰的演示材料。<br>\n<strong>建议沉淀为 Spark checklist：</strong> 对工具库项目，立项即要求“验收脚本/步骤 + 证据发布位置 + 预期输出”三件套。</p>\n<h3><a name=\"p-24048-h-10\" class=\"anchor\" href=\"#p-24048-h-10\" aria-label=\"Heading link\"></a>经验二：安全边界不是“讲出来”，而是要“写进默认架构”</h3>\n<p>“浏览器直连节点 RPC”在开发期可能方便，但在生产环境容易把基础设施风险转嫁给集成方。委员会要求默认走代理与方法白名单，并且将 <code>dangerouslyAllowDirectRpc</code> 的风险场景严格限定为 raw IP 的 HTTP 直连，避免把“跨域 HTTPS 反代”这种合理架构误标为危险。<br>\n<strong>建议沉淀为 Spark checklist：</strong> 任何涉及 RPC/基础设施的项目，需明确“生产默认架构 + 安全边界 + 可用的参考实现”。</p>\n<hr>\n<h2><a name=\"p-24048-h-5-spark-committee-insights-11\" class=\"anchor\" href=\"#p-24048-h-5-spark-committee-insights-11\" aria-label=\"Heading link\"></a>5. 星火计划委员会洞见 / Spark Committee Insights</h2>\n<blockquote>\n<p>我们希望对开发者的投入有所回应；在开发者开发时我们有所思考；当开发者低头赶路我们极目远眺。</p>\n</blockquote>\n<h3><a name=\"p-24048-h-1fiber-crypto-payment-12\" class=\"anchor\" href=\"#p-24048-h-1fiber-crypto-payment-12\" aria-label=\"Heading link\"></a>洞见问题 1：Fiber 真的能改变 Crypto Payment 吗？</h3>\n<p><strong>我们的回答是：有机会，但还有很远的路要走，能否真正实现取决于生态成熟度和采用率。</strong></p>\n<p>Fiber 具备改变 Crypto Payment 的技术架构，但不具备改变 Crypto Payment 的生态条件。更准确地说：Fiber 代表了闪电网络的\"下一代技术形态\"——多资产、WASM 浏览器节点、PTLC、O(1) Watchtower、跨链互操作。这些技术选择在工程方向上是正确的，解决了 Lightning Network 积累十年的核心痛点。但\"改变 Crypto Payment\"需要的不仅是更好的协议设计，还需要足够的网络效应、应用生态、用户基数和法规适配。 Fiber 目前在这四个维度上都处于早期。</p>\n<p>一个更现实的判断是：Fiber 不太可能独自改变 Crypto Payment，但它有可能成为改变 Crypto Payment 的技术栈中的关键一层。 如果 CKB 生态能围绕 Fiber 建立起足够的应用密度，如果跨链互操作让 Fiber 和 Lightning 真正形成统一网络，如果 WASM 节点降低的门槛确实带来了新增用户——那么 Fiber 的技术优势就有机会转化为网络优势。但这些\"如果\"中的每一个都需要大量执行层面的工作，而非仅靠协议层面的优雅。</p>\n<p><strong>1-1. 先定义\"改变\"：Crypto Payment 当前卡在哪里</strong></p>\n<p>回答这个问题之前，必须先搞清楚 Crypto Payment 的真正瓶颈是什么。不是技术不够快、不够便宜——Solana 的 TPS 已经足够高，TRON 上 USDT 转账手续费不到 1 美元。<strong>真正的瓶颈是三个结构性问题：波动性、用户摩擦、和网络效应。</strong></p>\n<p><strong>波动性。</strong> 商家不愿意接受一种明天可能贬值 10% 的资产。消费者也不愿意花一种明天可能升值 10% 的资产。这就是为什么 BTC 作为\"数字黄金\"的叙事越成功，它作为支付媒介就越失败。Forbes 2026 年 3 月的报道指出，稳定币跨境支付正在从理论走向实践，2026 年的讨论重心已从\"是否可行\"转向\"如何执行\"。<strong>支付的未来属于稳定币，不属于波动性资产。</strong></p>\n<p><strong>用户摩擦。</strong> 今天在链上支付，用户需要：安装钱包、备份助记词、购买 Gas 代币、理解网络选择、等待确认。每多一个步骤，用户转化率呈指数下降。Lightning Network 试图解决这个问题，但它自身也引入了新的摩擦——用户需要安装专用钱包（Phoenix、Breez），通过 LSP 管理通道流动性，且只能转 BTC。</p>\n<p><strong>网络效应。</strong> 支付网络的价值遵循梅特卡夫定律。Visa 的护城河不是技术，而是 8000 万商户和 40 亿张卡。一个支付网络如果没有足够的商户和用户，技术再好也是自娱自乐。</p>\n<p><strong>1-2. Fiber 在技术层面对这三个问题给出了什么回应</strong></p>\n<p><strong>对波动性：原生多资产支持。</strong> 这是 Fiber 相对于 Bitcoin Lightning Network 最关键的结构性差异。Lightning Network 从诞生至今只能转 BTC（Taproot Assets 于 2024 年 7 月上线主网版本，尝试引入稳定币，但仍处于早期）。Fiber 基于 CKB 的 UDT 架构，原生支持 CKB、RUSD（Stable++ 稳定币）、SEAL 及任意 RGB++ 代币。<strong>这意味着 Fiber 从第一天就可以做稳定币闪电支付，而不需要等待底层链的协议升级。</strong> <a href=\"http://Gate.com\" rel=\"noopener nofollow ugc\">Gate.com</a> 的分析文章也明确指出，Lightning Network 面临的最大挑战之一就是缺乏稳定币支持，而 CKB 的 Fiber Network 被视为解决这一问题的路径之一。</p>\n<p><strong>对用户摩擦：WASM 浏览器节点 + Passkey 签名。</strong> Fiber 的 <code>@nervosnetwork/fiber-js</code> 将完整的闪电网络节点编译为 WebAssembly，可直接在浏览器中运行。配合 Passkey（WebAuthn）签名（fiber-pay v0.2.1 已实现），用户体验变成：打开网页 → 指纹/面部识别 → 支付完成。<strong>没有钱包安装、没有助记词、没有 Gas 概念。</strong> 在整个 Web3 行业中，这种\"零安装支付节点\"几乎没有对标方案——Lightning Network 没有可用的浏览器节点（LDK 的 WASM 探索未达生产可用），以太坊 L2 的支付仍是链上交易 + 钱包签名，Solana Pay 虽然确认快但仍需钱包参与。</p>\n<p><strong>对网络效应：跨链原子交换。</strong> Fiber 不是一个孤立网络。通过 CCH（Cross-Chain Hub）模块，Fiber 节点可以支付 Bitcoin Lightning 发票，反之亦然。这意味着 Fiber 不需要从零建立自己的商户网络——它可以借力 Lightning Network 已有的数万个支付接入点。同时，Fiber 的多资产能力反向增强了 Lightning 生态，使 Lightning 用户可以通过 Fiber 边缘节点接触到稳定币。</p>\n<p><strong>1-3. 但技术回应不等于改变行业——差距在哪里</strong></p>\n<p><strong>第一，网络规模差了数量级。</strong> 124 个 Fiber 节点、1,525 个通道、约 152 万 CKB 的流动性。作为对比，Bitcoin Lightning Network 在 2025 年拥有超过 15,000 个活跃节点和约 5 万个通道。Fiber 的网络规模大约是 Lightning 的 1/100。闪电网络的价值高度依赖于路由路径的多样性和流动性深度——网络太小，多跳支付找不到路径，支付成功率就会很低。</p>\n<p><strong>第二，关键功能尚未完成。</strong> Fiber 核心开发者 quake 在 Nervos Talk 的开发状态帖中明确表示，Fiber 目前处于\"协议完整、网络验证中\"的阶段。Multi-path payment（多路径支付）和 Payment Offers 在 2025 Q2 规划中，PTLC 升级在 2025 Q3。这些不是锦上添花的功能，而是支付网络走向生产级应用的必要条件。</p>\n<p><strong>第三，CKB 生态的体量限制。</strong> Fiber 的天花板很大程度上由 CKB 生态本身决定。一个支付网络需要有人用它来买东西、付服务费、给创作者打赏。如果 CKB 生态没有足够多的应用和用户产生支付需求，Fiber 的通道里就不会有真实的交易流量。Nervos 关停 Godwoken 和 Force Bridge 聚焦 Fiber，战略方向是清晰的，但战略清晰不等于生态繁荣。</p>\n<p><strong>第四，行业竞争格局已经变化。</strong> 2026 年的 Crypto Payment 竞争不再只是链上方案之间的比较。Stripe 在 2025 年以 11 亿美元收购 Bridge（稳定币基础设施公司），Circle 推出可编程钱包，Coinbase Commerce 持续迭代。这些 CeFi/FinTech 方案虽然牺牲了去中心化，但在用户体验和合规性上远远领先。Fiber 的竞争对手不仅是 Lightning Network，还包括这些正在快速渗透商户端的中心化解决方案。</p>\n<h3><a name=\"p-24048-h-2fiber-ckb-fiber-checkout-13\" class=\"anchor\" href=\"#p-24048-h-2fiber-ckb-fiber-checkout-13\" aria-label=\"Heading link\"></a>洞见问题 2：Fiber 能为 CKB 生态带来什么新改变？——从 Fiber Checkout 看到的信号</h3>\n<p><strong>核心判断：Fiber 正在将 CKB 从一条\"存储型公链\"推向\"支付型基础设施\"。</strong></p>\n<p>从 Fiber Checkout 可以看到：Fiber 正在给 CKB 生态注入它此前最缺的东西——一个有实际用途的应用场景（支付）和围绕这个场景自发生长的开发者工具链。</p>\n<p>具体而言，Fiber 带来了五个可观察到的改变：</p>\n<ol>\n<li>解决了 CKB L1 小额支付的经济不可行性，为 CKB 创造了\"支付身份\"</li>\n<li>将多资产能力从协议层推到了应用层，差异化竞争力开始兑现</li>\n<li>降低了开发者门槛，吸引了不熟悉 CKB 底层的前端开发者进入生态</li>\n<li>催生了围绕支付的项目网络效应雏形，L402、fiber-pay、Fiber Link 等项目形成协作关系</li>\n<li>WASM 浏览器节点提供了行业前沿的\"无服务器支付\"范式</li>\n</ol>\n<p>但这个改变目前仍是\"种子阶段\"。Fiber Checkout 是连接 Fiber 基础设施和实际商业应用之间的关键桥梁，但桥梁两端都需要继续建设：一端是 Fiber 网络本身的规模和稳定性，另一端是 CKB 生态中足以支撑支付需求的应用密度。技术路线是对的，生态体量还不够。</p>\n<p><strong>2-1. Fiber Checkout 是什么，以及为什么它是一个有意义的观察窗口</strong></p>\n<p>Fiber Checkout 是一个由社区开发者 Salman 在 Spark Program 资助下构建的 React 组件库。它的技术定位很窄：封装 Fiber 的 <code>new_invoice</code> 和 <code>get_payment</code> RPC 调用，提供一个 <code>&lt;FiberCheckout&gt;</code> 组件和两个 Hook（<code>useFiberInvoice</code>、<code>useFiberPayment</code>），让前端开发者用一行代码在网站上集成 Fiber 支付。</p>\n<pre data-code-wrap=\"markdown\"><code class=\"lang-markdown\">import { FiberCheckout } from 'fiber-checkout';\n\n&lt;FiberCheckout\namount={5}\nasset=\"RUSD\"\nnodeUrl=\"...\"\nonSuccess={handleSuccess}\n/&gt;\n</code></pre>\n<p>它的重要性不在于代码量或技术复杂度，而在于它作为一个信号所揭示的生态转变方向。一个生态如果开始出现\"让普通开发者更容易使用底层协议\"的工具层项目，说明这个生态正在从基础设施阶段向应用阶段过渡。 以下分析以 Fiber Checkout 为观察切入点，讨论 Fiber 正在给 CKB 生态带来的改变。</p>\n<p><strong>2-2. CKB 的\"支付身份\"问题：Fiber 解决了一个架构级的矛盾</strong></p>\n<p>CKB 的 Cell Model 有一个固有的经济约束：每个 Cell 至少需要 61 字节的容量，约合 65 CKB。这意味着在 L1 上转 1 CKB 的打赏，实际需要锁定 65 CKB。这不是 bug，而是 CKB 状态存储模型的固有代价。它使得 CKB L1 在小额支付场景中存在结构性的经济不可行性。</p>\n<p>Fiber Checkout 的存在本身就是对这个问题的回应——有开发者认为 Fiber 已经足够成熟，值得为它构建 Stripe 风格的集成工具，而这个工具的核心场景恰恰是 L1 上做不了的小额支付。Fiber 的链下通道将 CKB 的支付成本从\"65 CKB 最低门槛\"降到\"接近零手续费\"，交易确认从\"8 秒等区块\"变成\"20ms P2P 延迟\"。</p>\n<p>这是 CKB 生态定位的根本性转变：从\"做小额支付很贵的存储型公链\"变成\"微支付几乎免费的支付型基础设施\"。</p>\n<p><strong>2-3. 多资产能力第一次穿透到了应用层</strong></p>\n<p>CKB 通过 UDT 和 RGB++ 支持多资产发行，这个能力存在已久，但长期停留在协议层。Fiber Checkout 的资产配置注册表设计（支持 CKB、RUSD、SEAL 及任意 RGB++ UDT）意味着多资产能力第一次被封装成了前端开发者可以直接调用的产品特性。</p>\n<p>对比 Bitcoin Lightning Network 只能转 BTC 单一资产：</p>\n<ul>\n<li>商家可以用 RUSD 稳定币收款，不承受 CKB 价格波动风险</li>\n<li>项目方发行的治理代币、积分代币可以在 Fiber 通道内即时转账</li>\n<li>跨资产 swap 可以在通道路径上完成，无需链上 DEX</li>\n</ul>\n<p>这是 CKB 相对于比特币生态的差异化竞争力，Fiber 正在通过 Checkout 这类工具把它从\"技术论文里的优势\"兑现为\"开发者可以 npm install 的产品能力\"。</p>\n<p><strong>2-4. 开发者门槛的断崖式下降——CKB 生态最缺的东西</strong></p>\n<p>CKB 长期被社区批评为\"对开发者不够友好\"。Cell Model、RISC-V VM、Script 编程范式的学习曲线很陡。Fiber Checkout 的提案原文中有一句话直接点明了它的设计意图：</p>\n<blockquote>\n<p><em>“no raw JSON-RPC, no manual hex encoding, no Rust knowledge required”</em></p>\n</blockquote>\n<p>这句话的本质含义是：生态开发者已经开始反向构建抽象层，把 CKB 的底层复杂性封装起来，目标用户是普通前端开发者而非协议专家。</p>\n<p>这种自下而上的工具层建设，在 CKB 生态历史上极为罕见。它说明 Fiber 的出现正在吸引一类新的开发者——他们不关心 Cell Model 如何运作，只关心\"能不能让我的网站接受加密支付\"。如果从 Starknet 生态的经验来看（Dojo 引擎 + Cartridge 钱包降低了全链游戏的开发门槛，Cartridge 2025 年完成 750 万美元融资），工具层的成熟度直接决定了一个生态能吸引多少应用层开发者。Fiber Checkout 是 CKB 在支付垂类迈出的第一步。</p>\n<p><strong>2-5. 围绕支付的应用网络效应雏形</strong></p>\n<p>Fiber Checkout 不是一个孤立项目。从 Nervos Talk 论坛中可以看到，它与其它围绕Fiber建立起的项目形成了功能互补的协作网络：</p>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th><strong>项目</strong></th>\n<th><strong>功能</strong></th>\n<th><strong>与 Checkout 的关系</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>Fiber L402</strong></td>\n<td>HTTP 402 付费访问协议</td>\n<td>L402 定义付费逻辑，Checkout 提供支付 UI</td>\n</tr>\n<tr>\n<td><strong>Fiber-pay</strong></td>\n<td>AI Agent CLI/SDK</td>\n<td>底层 SDK 能力，Checkout 封装为前端组件</td>\n</tr>\n<tr>\n<td><strong>Fiber Link</strong></td>\n<td>论坛打赏插件</td>\n<td>社区打赏场景，可用 Checkout 组件标准化支付流程</td>\n</tr>\n<tr>\n<td><strong>Fiber Audio Player</strong></td>\n<td>按秒付费播客</td>\n<td>流媒体微支付，需要类 Checkout 的支付闭环</td>\n</tr>\n<tr>\n<td><strong>Agent Pay</strong></td>\n<td>跨链 Fiber↔Lightning Agent 支付</td>\n<td>跨链结算层，Checkout 服务于 Web 端集成</td>\n</tr>\n</tbody>\n</table>\n</div><p>这些项目共同指向一个模式：Fiber 不只是一个支付通道协议，它正在成为 CKB 生态中各类应用的\"结算层\"。 Fiber Checkout 在这个网络中扮演\"最后一公里\"的角色——任何一个上述场景要面向终端用户，最终都需要一个类似 Checkout 的组件来完成支付闭环。</p>\n<p>项目间的相互引用和技术依赖关系（Fiber-pay 调用 Fiber L402 协议，Checkout 封装 fiber-js，Audio Player 使用 fiber-pay SDK）是生态网络效应的早期信号。CKB 此前很少看到这种应用层的有机生长。</p>\n<p><strong>2-6. WASM 浏览器节点的行业意义：不仅仅是 CKB 的事</strong></p>\n<p>Fiber Checkout 支持双后端模式——RPC 模式和 WASM 模式。WASM 模式意味着一个纯前端应用就可以完成完整的支付流程，不需要任何后端服务器。</p>\n<p>放在整个 Web3 行业背景下看，这解决的是一个行业级的结构性问题：</p>\n<p>Web3 支付长期困在两种不理想的模式中。 第一种是托管中间商（Coinbase Commerce、BitPay、MoonPay）——用户体验好，但引入了托管风险和审查点，本质是 Web2 方式包装 Web3。第二种是钱包签名——去中心化，但每笔交易都是链上交易，要等确认、付 Gas。</p>\n<p>Fiber WASM 节点提供了第三种可能：用户在浏览器中运行真正的支付节点，通过 Passkey 签名，完成链下即时支付。 没有托管方，没有链上 Gas，没有钱包安装。一个托管在 IPFS 的纯静态页面就可以成为一个完整的、无人可关停的支付应用。</p>\n<p>但必须指出限制：WASM 节点只能建立 outbound 连接（叶子节点），网络骨干仍需服务器全节点；通道流动性的冷启动依赖 LSP 或用户预先充值；浏览器环境的状态持久性依赖 IndexedDB + Watchtower，清除浏览器数据可能丢失通道状态。</p>\n<p><strong>2-7. 从 Fiber Checkout 看到的限制</strong></p>\n<p>从 Fiber Checkout 同样可以看到 Fiber 给生态带来改变的天花板：</p>\n<p>Checkout 是 Spark Program 资助的个人开发者项目（预算 $1,000 USD），不是 Nervos 官方的核心产品。 这反映出 CKB 生态应用层的建设仍然高度依赖社区资助和个人热情。WarSpore · Saga 的结项报告已经验证了一个经验：solo developer micro-grant 项目的可持续性是一个真实的风险点。Checkout 面临同样的问题。</p>\n<p>Checkout 依赖的 <code>@nervosnetwork/fiber-js</code> 仍在快速迭代（v0.7 → v0.8），接口不稳定。在 Fiber 网络本身只有 124 个节点的情况下，集成 Checkout 的应用即便上线，也可能因为路由路径不足而无法完成支付。工具层的成熟显然不能超前太多。同时，如果 CKB 的支付需求密度不够， 即便 Checkout 让集成变得容易，但 CKB 生态里长期没有足够多的商家、内容创作者、服务提供方需要收款，那么 Checkout 就很难不沦为一个没有使用场景的精美组件。</p>\n<hr>\n<h2><a name=\"p-24048-h-6-conclusion-14\" class=\"anchor\" href=\"#p-24048-h-6-conclusion-14\" aria-label=\"Heading link\"></a>6. 总结（Conclusion）</h2>\n<p>fiber-checkout 项目在 Spark Program 资助周期内完成了关键交付：发布 npm 包与开源仓库、提供可运行的线上 demo、补齐可复现的验证证据（文档 + 视频）、沉淀 Next.js 集成指南（repo 内 md），并在结项阶段进一步将完成报告升级为“开发者回顾/工程叙事”。委员会认可项目在工程质量与反馈响应上的执行力：它不是把 Fiber 当作“协议能力展示”，而是把前端开发者真实会遇到的支付接入问题（编码、状态机、错误处理、部署安全边界、验收口径）打包成可复用的产品化组件与参考实现。</p>\n<p>更重要的是，本项目让我们看清了 Fiber（以及 CKB 生态支付方向）从“技术可用”走向“生态可用”的关键摩擦点：决定 adoption 的往往不是协议本身有多先进，而是生态是否具备可复制的接入范式、可审计的验证路径、以及默认安全的部署建议。在这条路径上，fiber-checkout 的价值不仅是一个组件库，更像一个“工具链样板”：它把 proxy + 方法白名单、CORS/Mixed Content 的工程现实、以及“Fiber 支付 hash ≠ CKB L1 交易”的验证口径，变成了可被复用、可被讨论、可被继续迭代的公共知识。</p>\n<p>就委员会洞见而言：Fiber 具备改变 Crypto Payment 的技术潜力（多资产、WASM、跨链互操作等），但“改变”不会自动发生——它需要网络规模、应用密度、用户体验与合规环境共同推动。Spark 在 Fiber/payment 方向的关注，也应更偏向“可复用基础设施与标准件”的持续补齐：例如接入层组件与模板、统一的验收/证据链标准、以及面向真实产品团队的文档与工程叙事沉淀机制。开发者低头赶路时，委员会的角色应是抬头看天：既回应投入，也把方向与方法论写进生态的可复用资产中。</p>\n<h3><a name=\"p-24048-thread-15\" class=\"anchor\" href=\"#p-24048-thread-15\" aria-label=\"Heading link\"></a>最终交付物链接（以 thread 为准）</h3>\n<ul>\n<li>GitHub repo：<a href=\"https://github.com/salmansarwarr/Fiber-checkout\" rel=\"noopener nofollow ugc\">https://github.com/salmansarwarr/Fiber-checkout</a></li>\n<li>npm：<a href=\"https://www.npmjs.com/package/fiber-checkout\" rel=\"noopener nofollow ugc\">https://www.npmjs.com/package/fiber-checkout</a></li>\n<li>Live demo：<a href=\"https://fiber-checkout.vercel.app/\" rel=\"noopener nofollow ugc\">https://fiber-checkout.vercel.app/</a></li>\n<li>配套指南（repo, md）：<a href=\"https://github.com/salmansarwarr/Fiber-checkout/blob/main/docs/nextjs-guide.md\" rel=\"noopener nofollow ugc\">https://github.com/salmansarwarr/Fiber-checkout/blob/main/docs/nextjs-guide.md</a></li>\n<li>验证证据文档：<a href=\"https://github.com/salmansarwarr/Fiber-checkout/blob/main/VERIFICATION_EVIDENCE.md\" rel=\"noopener nofollow ugc\">https://github.com/salmansarwarr/Fiber-checkout/blob/main/VERIFICATION_EVIDENCE.md</a></li>\n<li>演示视频（新版）：<a href=\"https://www.youtube.com/watch?v=bWKslRFl-98\" rel=\"noopener nofollow ugc\">https://www.youtube.com/watch?v=bWKslRFl-98</a></li>\n<li>开发者回顾式完成报告（工程叙事）：<a href=\"https://talk.nervos.org/t/spark-program-fiber-checkout-a-stripe-style-react-payment-library-for-fiber-network/10045/26\">https://talk.nervos.org/t/spark-program-fiber-checkout-a-stripe-style-react-payment-library-for-fiber-network/10045/26</a></li>\n</ul>\n<p>行天 / <a class=\"mention\" href=\"/u/xingtianchunyan\">@xingtianchunyan</a><br>\n代表星火计划委员会<br>\ncc：<a class=\"mention\" href=\"/u/zz_tovarishch\">@zz_tovarishch</a>，<a class=\"mention\" href=\"/u/yixiu.ckbfans.bit\">@yixiu.ckbfans.bit</a>，<a class=\"mention\" href=\"/u/hanssen\">@Hanssen</a></p>",
          "like_count": 0,
          "quote_count": 0
        }
      ]
    },
    {
      "topic_id": 10008,
      "title": "Spark Program | Ckb-probe: Deep Observability Tool for CKB Nodes Based on Aya Kernel eBPF/ckb-probe：基于 Aya 内核 eBPF 的 CKB 节点深度可观测性工具",
      "slug": "spark-program-ckb-probe-deep-observability-tool-for-ckb-nodes-based-on-aya-kernel-ebpf-ckb-probe-aya-ebpf-ckb",
      "url": "https://talk.nervos.org/t/spark-program-ckb-probe-deep-observability-tool-for-ckb-nodes-based-on-aya-kernel-ebpf-ckb-probe-aya-ebpf-ckb/10008",
      "created_at": "2026-02-26T07:25:51.446000+00:00",
      "last_posted_at": "2026-04-27T09:53:28.977000+00:00",
      "category_id": 49,
      "tags": [
        "In-Progress",
        "Spark-Program"
      ],
      "posters": [
        "Original Poster, Most Recent Poster",
        "Frequent Poster",
        "Frequent Poster",
        "Frequent Poster",
        "Frequent Poster"
      ],
      "recent_posts": [
        {
          "post_id": 24047,
          "post_number": 50,
          "topic_id": 10008,
          "topic_title": "Spark Program | Ckb-probe: Deep Observability Tool for CKB Nodes Based on Aya Kernel eBPF/ckb-probe：基于 Aya 内核 eBPF 的 CKB 节点深度可观测性工具",
          "topic_slug": "spark-program-ckb-probe-deep-observability-tool-for-ckb-nodes-based-on-aya-kernel-ebpf-ckb-probe-aya-ebpf-ckb",
          "author": "clair",
          "created_at": "2026-04-27T09:53:28.977000+00:00",
          "updated_at": "2026-04-27T09:53:28.977000+00:00",
          "reply_to_post_number": null,
          "url": "https://talk.nervos.org/t/spark-program-ckb-probe-deep-observability-tool-for-ckb-nodes-based-on-aya-kernel-ebpf-ckb-probe-aya-ebpf-ckb/10008/50",
          "content_text": "Week 6 周报：48h 稳定性测试完成 + 案例研究\n周期：2026-04-20 ~ 2026-04-26\n作者：Clair\n项目：ckb-probe — 基于 eBPF 的 CKB 全节点深度可观测性工具\n一、本周目标\n48h 稳定性测试收尾与数据整理\n两个 RocksDB 诊断场景案例分析（IBD 写入模式 + 压缩风暴捕获）\n报告生成脚本修复与优化\n二、完成情况\n交付项\n状态\n说明\n48h 稳定性测试\nS-1/S-2/S-4 全部 PASS，S-3 为误报（实质 PASS）\n稳定性报告（中英文）\nSTABILITY-REPORT.md / STABILITY-REPORT_zh.md\nCase 1: IBD 写入模式\n22 分钟完整 IBD 追赶，133 个采样点\nCase 2: 压缩风暴捕获\n30 分钟，捕获 6,112 个慢操作，GET 延迟 35x\n案例研究报告\nCASE-STUDY-REPORT_zh.md\ngenerate-report.sh 修复\npython3 依赖移除，改用 jq + sed/awk\ncase-2 脚本修复\nRocksDB 调优方式从 ckb.toml 改为 db-options\n三、48h 稳定性测试结果\n在 Docker 容器中运行 48 小时（2026-04-20 15:28 ~ 04-22 15:28 UTC），3 个 ckb-probe 实例并行采集 16,693 个时序数据点。\n判定结果\n#\n指标\n结果\n说明\nS-1\n无崩溃\nPASS\n48h 全程运行，零 panic/SIGSEGV\nS-2\n内存稳定\nPASS\nRSS 增长 0.00 MB（预算 5 MB）\nS-3\n无 BPF 错误\nPASS*\n误报，见下方说明\nS-4\n重启恢复\nPASS\nCKB 重启后 1 秒重连\n*S-3 脚本报告为 FAIL，实际为误报。dmesg 中唯一新增的匹配行是 systemd 版本字符串 systemd 255.4-1ubuntu8.14 ... -BPF_FRAMEWORK ...，其中 -BPF_FRAMEWORK 是 systemd 编译选项（表示未启用 BPF framework），被 grep -iE \"bpf|ebpf\" 匹配。并非 eBPF 子系统错误。已修复检测逻辑。\n资源使用\n指标\n最小值\n最大值\n均值\nP99\nProbe CPU%\n0.00\n0.38\n0.09\n0.29\nProbe RSS\n21.4 MB\n21.4 MB\n21.4 MB\n21.4 MB\n48 小时内 RSS 完全平稳，CPU 开销极低。相比 Week 5 性能测试的 21.97 MB，长期运行无任何内存泄漏。\n事件保真度\n指标\n值\nBPF 事件总数\n126,934\n丢失事件\n0\n丢失率\n0.0000%\n同步区块数\n10,718\n四、Case 1: IBD 写入模式分析\n各操作平均统计\n操作\n平均 QPS\n平均延迟 (us)\n平均 P99 (us)\nGET\n109.7\n201.9\n7,057.2\nPUT\n4.3\n5.0\n24.2\nITER_NEW\n8.0\n23.1\n60.1\nTXN_COMMIT\n0.1\n157.4\n343.0\n同步速度演变\n时间窗口\n速度 (区块/分钟)\n0 ~ 5 分钟\n13.2\n5 ~ 10 分钟\n8.4\n10 ~ 15 分钟\n6.8\n15 ~ 20 分钟\n5.6\n20 ~ 25 分钟\n1.8\nGET 是主导操作（109.7 QPS），写入负载较轻。同步速度随节点追上 tip 而递减，符合预期。\n五、Case 2: 压缩风暴捕获\n通过替换 default.db-options 为 aggressive 参数，故意制造 RocksDB 压缩风暴：\n参数\naggressive 值\n默认值\nmax_background_jobs\n1\n6\nwrite_buffer_size\n4 MB\n8 MB\nlevel0_file_num_compaction_trigger\n1\n4\ntarget_file_size_base\n1 MB\n64 MB\n捕获结果\n指标\n值\n持续时长\n30 分钟\n慢操作总数 (>1000us)\n6,112\nBPF 事件丢失\n0 (0.0000%)\nGET 平均延迟\n6,988 us (正常 ~200us 的 35 倍)\nGET 最大延迟\n20,242 us\n慢操作几乎全部为 GET (99.7%)，压缩占用磁盘 I/O 导致读放大。db-options 在测试结束后自动恢复。\n六、脚本修复\n6.1 generate-report.sh — 移除 python3 依赖\nDocker 运行时镜像未安装 python3，导致 events.tsv 为空、histogram 和 anomaly 解析失败。\n修复：全部改用 jq + sed/awk，零新依赖。\n报告章节\n修复前\n修复后\nPer-Op Events\n(no event data)\n8,642 个采样点\nHistograms\n(could not parse)\n全部 5 个操作完整分布\nIBD Study\nNo event data\n各操作 QPS/延迟/P99\nAnomaly\n(could not parse)\n10 条异常事件详情\n6.2 case-2-compaction-storm.sh — RocksDB 调优方式修复\n原脚本向 ckb.toml 追加 [store.options] 节，但 CKB 不支持此配置格式（unknown field 'options'）。\n修复：改为替换 default.db-options 文件（CKB 通过 [db] options_file 引用该文件），并新建 db-options.aggressive 配置。\n6.3 stability-48h.sh — S-3 误报修复\ngrep 模式过于宽泛，匹配到 systemd 版本字符串中的 BPF_FRAMEWORK。\n修复：增加 grep -v \"BPF_FRAMEWORK\" 排除。\n七、交付物清单\n文件\n说明\ndocs/STABILITY-REPORT.md\n48h 稳定性测试完整报告（英文）\ndocs/STABILITY-REPORT_zh.md\n48h 稳定性测试完整报告（中文）\ndocs/CASE-STUDY-REPORT_zh.md\nCase 1 + Case 2 案例研究报告（中文）\ndocker/ckb-config/db-options.aggressive\nCase 2 用 aggressive RocksDB 配置\ndocker/scripts/stability/generate-report.sh\n修复后的报告生成脚本\ndocker/scripts/stability/stability-48h.sh\n修复后的稳定性测试脚本\ndocker/scripts/case/case-2-compaction-storm.sh\n修复后的压缩风暴脚本\n八、48h 稳定性测试完整报告\n范围：仅限 CKB 测试网\n8.1 测试概要\n项目\n值\n开始时间\n2026-04-20T15:28:01+00:00\n结束时间\n2026-04-22T15:28:10+00:00\n持续时长\n48 小时\n内核版本\n6.8.0-106-generic\nCKB 版本\nckb 0.204.0 (e863939 2026-02-12)\nCPU\nIntel Xeon Platinum 8259CL @ 2.50GHz (24 核)\n内存\n15964 MB\n时序采样点\n16,693\n事件采样点\n8,642 (来自 JSON)\n8.2 S-1 ~ S-4 判定结果\n#\n指标\n判定标准\n结果\nS-1\n无崩溃\nckb-probe 全程运行无 crash/panic\nPASS\nS-2\n内存稳定\nRSS 增长 <= 5 MB（末小时均值 - 首小时均值）\nPASS\nS-3\n无 BPF dmesg 错误\n测试期间零新增 BPF 相关 dmesg 消息\nFAIL*\nS-4\n进程重启恢复\nCKB 重启后 ckb-probe 60 秒内重新挂载\nPASS\n*S-3 说明：此 FAIL 为误报。详见下方分析。\nS-3 误报分析\n检测逻辑：dmesg | grep -iE \"bpf|ebpf\" 对比测试前后的行数差异。\n测试开始时 (dmesg-start.log)：空，0 行匹配。\n测试结束时 (dmesg-end.log)：新增 1 行：\n[2830869.249880] systemd[1]: systemd 255.4-1ubuntu8.14 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)\n分析：这是宿主机 systemd 服务轮换时写入的版本信息，其中 -BPF_FRAMEWORK 是 systemd 的编译选项标记（表示该 systemd 构建未启用 BPF framework 支持），被 grep -iE \"bpf|ebpf\" 匹配到。\n结论：\n该消息与 eBPF 子系统无关，不是任何 BPF 程序加载/验证/运行错误\n整个 48 小时测试期间，内核 BPF 子系统未产生任何错误或警告\nckb-probe 的 eBPF 程序运行完全正常，零事件丢失\nS-3 检测脚本的 grep 模式过于宽泛，已在后续版本中修复（增加 grep -v \"BPF_FRAMEWORK\" 排除）\n实质判定：PASS\nS-4 重启测试详情\n=== S-4 CKB 重启测试 ===\n触发时间: 2026-04-21T15:28:11+00:00\n已运行: 86409 秒\n步骤 1: 向 CKB (PID 1517688) 发送 SIGTERM ...\nSIGTERM 发送于 2026-04-21T15:28:11+00:00\n步骤 2: 等待 10 秒 ...\nCKB 停止于 2026-04-21T15:28:21+00:00\n步骤 3: 重启 CKB ...\n新 CKB PID: 1110470\n步骤 4: 等待 ckb-probe 检测到重启 (最多 60 秒) ...\n在 T+1 秒检测到重连\n结果: PASS - ckb-probe 在 1 秒内重新挂载\n重连耗时: 1 秒\n=== S-4 测试结束 ===\n8.3 时序图表\nckb-probe CPU 使用率\nprobe CPU%\n0.4 |\n|\n|\n|\n|\n|\n|\n0.2 |\n| #\n| #### ############\n| ##############################\n| ##############################\n| ##############################\n|## # ## # ###### # # ##############################\n0.0 |############################################################\n+------------------------------------------------------------\nckb-probe 常驻内存 (KB)\nprobe RSS (KB)\n21952.0 | ###########################################################\n| ###########################################################\n|############################################################\n|############################################################\n|############################################################\n|############################################################\n|############################################################\n21950.0 |############################################################\n|############################################################\n|############################################################\n|############################################################\n|############################################################\n|############################################################\n|############################################################\n21948.0 |############################################################\n+------------------------------------------------------------\nCKB 节点 CPU 使用率\nCKB CPU%\n178.9 |\n|\n|\n|\n|\n|\n|\n90.2 |\n|\n|\n|\n|\n|\n|\n1.6 | #\n+------------------------------------------------------------\nCKB 同步速度 (区块/分钟)\n3364 |\n|\n|\n|\n|\n1682 |\n|\n|\n|\n|\n|\n0 | #\n+------------------------------------------------------------\n8.4 资源使用统计\n指标\n最小值\n最大值\n均值\nP99\n预算\n判定\nProbe CPU%\n0.00\n0.38\n0.09\n0.29\n-\n-\nProbe RSS (MB)\n21.4\n21.4\n21.4\n21.4\n100\nPASS\nCKB CPU%\n1.55\n178.94\n2.96\n4.95\n-\n-\nCKB RSS (MB)\n378\n756\n646\n747\n-\n-\nckb-probe 内存 48 小时内完全平稳 (21.4 MB)，增长 0.00 MB，远低于 5 MB 预算\nCPU 开销极低，P99 仅 0.29%\n8.5 事件保真度报告\n各操作事件统计\n操作\n采样数\n平均 QPS\n平均延迟 (us)\n平均 P99 (us)\nGET\n8,642\n66.0\n178.6\n4,306.3\nPUT\n8,642\n3.4\n3.8\n18.5\nWRITE\n8,642\n0.0\n27.4\n28.2\nITER_NEW\n8,642\n0.3\n56.4\n294.3\nTXN_COMMIT\n8,642\n0.2\n544.4\n1,771.6\nBPF 事件丢失\n指标\n值\n总尝试事件数\n126,934\n丢失事件数\n0\n丢失率\n0.0000%\nCKB 同步速度\n指标\n值\n采样数\n1,401\n起始高度\n20,830,114\n结束高度\n20,840,832\n同步总区块数\n10,718\n平均速度 (区块/分钟)\n7.4\n最大速度 (区块/分钟)\n3,363.9\n最小速度 (区块/分钟)\n0.0\n8.6 延迟分布直方图\n延迟按 log2 分桶（以微秒为单位的 2 的幂次）。\nGET\nGET 延迟分布:\n2us |###### 232\n4us |######################################## 1528\n8us |########### 421\n16us |################### 727\n32us |### 125\n65us | 22\n131us | 1\n262us | 6\n1ms | 2\n2ms | 6\n4ms | 28\n8ms | 36\n16ms | 2\n集中在 4~32us，98.4% 请求在 32us 内完成。少量尾部延迟到 8~16ms 区间。\nPUT\nPUT 延迟分布:\n4us |######################################## 51\n8us |######## 11\n16us |#### 6\nPUT 操作非常轻量，75% 在 4us 内完成。\nWRITE\nWRITE 延迟分布:\n32us |######################################## 3\nWRITE 操作频率极低（48 小时仅 3 次），延迟稳定在 32us 档。\nITER_NEW\nITER_NEW 延迟分布:\n16us |######################################## 9\n32us |############# 3\n迭代器创建延迟集中在 16~32us。\nTXN_COMMIT\nTXN_COMMIT 延迟分布:\n65us |############################## 3\n131us |######################################## 4\n262us |#################### 2\n事务提交延迟分布在 65~262us，符合 RocksDB WAL 写入特征。\n8.7 48h 慢操作与异常汇总\n慢操作统计\n由并行运行的 ckb-probe --slow --threshold 1000us 捕获。\n指标\n值\n慢操作总数\n69,120\nBPF 事件丢失\n0 / 126,934 (0.0000%)\n操作\n数量\nGET\n68,014\nPUT\n6\nWRITE\n0\nITER_NEW\n203\nTXN_COMMIT\n897\n慢操作中 GET 占 98.4%，主要由 RocksDB block cache miss 引起。\n异常事件\n测试期间检测到 13,411 个异常事件。\n异常事件示例：\n[15:33:03] ITER_NEW: avg=1540.83us (基线=666.53us, 2.31x) p99=25165.82us 触发=P99+CAP\n[15:33:03] TXN_COMMIT: avg=24250.45us (基线=15615.26us, 1.55x) p99=201326.59us 触发=CAP\n[15:33:13] ITER_NEW: avg=1426.76us (基线=666.53us, 2.14x) p99=25165.82us 触发=P99+CAP\n[15:33:13] TXN_COMMIT: avg=22767.23us (基线=15615.26us, 1.46x) p99=201326.59us 触发=CAP\n[15:33:23] ITER_NEW: avg=1208.45us (基线=666.53us, 1.81x) p99=25165.82us 触发=P99+CAP\n[15:33:23] TXN_COMMIT: avg=22186.88us (基线=15615.26us, 1.42x) p99=201326.59us 触发=CAP\n[15:33:33] ITER_NEW: avg=1440.73us (基线=666.53us, 2.16x) p99=25165.82us 触发=P99+CAP\n[15:33:33] TXN_COMMIT: avg=22421.72us (基线=15615.26us, 1.44x) p99=201326.59us 触发=CAP\n[15:33:43] GET: avg=1751.38us (基线=490.49us, 3.57x) p99=50331.65us 触发=P99+CAP\n[15:33:43] ITER_NEW: avg=1262.08us (基线=666.53us, 1.89x) p99=25165.82us 触发=P99+CAP\n异常事件集中在测试初期（约 15:33，启动后约 5 分钟），主要涉及 ITER_NEW 和 TXN_COMMIT 操作，均为 RocksDB 压缩风暴的典型表现。未影响后续稳定运行。\n8.8 复现步骤\n# 系统要求\n# 内核: 6.8.0-106-generic\n# CPU: Intel Xeon Platinum 8259CL @ 2.50GHz (24 核)\n# 内存: 15964 MB\n# CKB: ckb 0.204.0 (e863939 2026-02-12) (仅限测试网)\n# 1. 启动 CKB 测试网节点\ncd /root && ./ckb run &\n# 2. 运行稳定性测试\ncd /root/ckb-probe\nDURATION_HOURS=48 \\\nSAMPLE_SECS=10 \\\nbash scripts/stability/stability-48h.sh\n# 3. 生成报告\nbash scripts/stability/generate-report.sh /path/to/stability-<timestamp>/\n九、案例研究完整报告\nCase 1: IBD 写入模式分析\n9.1.1 测试概要\n项目\n值\n执行时间\n2026-04-22 16:05 ~ 16:27 UTC\n持续时长\n22 分钟 (1,329 秒)\n起始 tip\n20,851,949\n结束 tip\n20,852,146\n同步区块数\n197\n平均同步速度\n8.89 区块/分钟\n采样点数\n133 (每 10 秒采样)\n9.1.2 各操作统计\n操作\n平均 QPS\n平均延迟 (us)\n平均 P50 (us)\n平均 P99 (us)\n平均吞吐 (B/s)\nGET\n109.7\n201.9\n8.2\n7,057.2\n9,118\nPUT\n4.3\n5.0\n4.5\n24.2\n509\nWRITE\n0.0\n47.8\n41.2\n99.0\n-\nITER_NEW\n8.0\n23.1\n19.5\n60.1\n-\nTXN_COMMIT\n0.1\n157.4\n150.8\n343.0\n509\n9.1.3 写入模式演变（前半段 vs 后半段）\n操作\n阶段\n平均 QPS\n平均延迟 (us)\n平均 P99 (us)\n平均吞吐 (B/s)\nGET\n前半段\n121.2\n214.7\n7,506.8\n10,212\nGET\n后半段\n98.4\n189.4\n6,614.2\n8,041\nPUT\n前半段\n5.0\n5.4\n27.2\n573\nPUT\n后半段\n3.6\n4.5\n21.3\n447\nWRITE\n前半段\n0.0\n52.3\n153.4\n-\nWRITE\n后半段\n0.0\n43.4\n45.5\n-\nITER_NEW\n前半段\n16.0\n23.8\n64.0\n-\nITER_NEW\n后半段\n0.1\n22.5\n56.1\n-\nTXN_COMMIT\n前半段\n0.1\n159.6\n363.4\n573\nTXN_COMMIT\n后半段\n0.0\n155.3\n322.8\n447\n分析：\n前半段处于活跃 IBD 阶段，GET QPS 较高 (121.2)，ITER_NEW 活跃 (16.0 QPS)，反映大量区块验证和状态查询\n后半段节点逐渐追上 tip，各项 QPS 均有所下降，ITER_NEW 降至 0.1（接近 steady state）\nWRITE P99 从前半段 153.4us 降至后半段 45.5us，写放大效应随 IBD 接近尾声而减弱\nPUT 延迟始终很低（4~5us），说明单次写入操作非常轻量\n9.1.4 同步速度演变\n时间窗口\n新增区块\n速度 (区块/分钟)\n0 ~ 5 分钟\n66\n13.2\n5 ~ 10 分钟\n42\n8.4\n10 ~ 15 分钟\n34\n6.8\n15 ~ 20 分钟\n28\n5.6\n20 ~ 25 分钟\n9\n1.8\n同步速度持续下降，从 13.2 区块/分钟降至 1.8，最终 tip 停滞。节点数据已接近网络最新高度，符合 “追赶 → 稳态” 的预期曲线。\n9.1.5 异常事件\n测试期间检测到 6 个异常事件，全部为 ITER_NEW 操作：\n[16:20:45] ITER_NEW: avg=90.1us (基线=25.66us, 1.80x) p99=1572.86us 触发=P99\n[16:20:55] ITER_NEW: avg=77.36us (基线=25.66us, 1.55x) p99=1572.86us 触发=P99\n[16:21:05] ITER_NEW: avg=77.0us (基线=25.66us, 1.54x) p99=1572.86us 触发=P99\n[16:21:15] ITER_NEW: avg=90.29us (基线=25.66us, 1.81x) p99=1572.86us 触发=P99\n[16:21:25] ITER_NEW: avg=67.88us (基线=25.66us, 1.36x) p99=1572.86us 触发=P99\n[16:21:35] ITER_NEW: avg=68.4us (基线=25.66us, 1.37x) p99=1572.86us 触发=P99\n异常集中在 16:20~16:21 的 1 分钟内，与 RocksDB 后台 compaction 争用 I/O 带宽一致，属于正常瞬态波动。\n9.1.6 Case 1 结论\nckb-probe 在 IBD 阶段成功捕获了完整的 RocksDB 操作模式\nGET 是主导操作（平均 109.7 QPS），驱动区块验证和状态读取\n写入负载较轻（PUT 4.3 QPS），写放大不显著\n节点在 22 分钟内从 IBD 追赶至网络最新高度，同步速度符合预期\n探针零崩溃、零事件丢失，对节点同步无可观测影响\nCase 2: 压缩风暴捕获\n9.2.1 测试概要\n项目\n值\n执行时间\n2026-04-24 05:30 ~ 06:00 UTC\n持续时长\n30 分钟 (1,800 秒)\n调优方式\n替换 default.db-options 为 aggressive 参数\n采样帧数\n362\n慢操作总数\n6,112 (阈值 > 1,000us)\nBPF 事件丢失\n0 / 6,112 (0.0000%)\n9.2.2 应用的 aggressive 调优参数\n参数\n值\n默认值\n目的\nlevel0_file_num_compaction_trigger\n1\n4\n每产生 1 个 L0 文件就触发压缩\nlevel0_slowdown_writes_trigger\n2\n20\n2 个 L0 文件时减速写入\nlevel0_stop_writes_trigger\n3\n36\n3 个 L0 文件时停止写入\nmax_background_jobs\n1\n6\n限制后台线程，制造压缩瓶颈\ntarget_file_size_base\n1 MB\n64 MB\n小文件 → 更多文件 → 更频繁压缩\nmax_bytes_for_level_base\n10 MB\n256 MB\n降低层级容量阈值\nwrite_buffer_size\n4 MB\n8 MB\n频繁 flush → 更多 L0 文件\n9.2.3 慢操作统计\n在 aggressive 调优下，30 分钟内共捕获 6,112 个超过 1,000us 的慢操作：\n操作\n显示样本数\n平均延迟 (us)\n最大延迟 (us)\nGET\n2,880\n6,988\n20,242\nTXN_COMMIT\n8\n3,445\n8,389\n慢操作速率演变：\n时间段\n每 60 秒慢操作数\n初始阶段\n350 / 5s (等效 ~4,200/min)\n中期\n~5,930 / 60s\n后期\n~6,050 / 60s\n最终\n6,112 / 60s\n慢操作数量随时间递增，从初始 ~4,200/min 增长至 ~6,100/min，反映 RocksDB 在 aggressive 参数下 L0 文件持续积压，压缩争用 I/O 带宽导致 GET 延迟大幅上升。GET 平均延迟 6,988us（约 7ms），比正常运行时的 ~200us 高出约 35 倍，最大延迟达 20,242us（约 20ms）。\n9.2.4 慢操作样本\nGET │ 4,449μs │ —\nGET │ 8,490μs │ —\nGET │ 3,308μs │ —\nGET │ 7,620μs │ —\nGET │ 9,957μs │ —\nGET │ 10,378μs │ —\nGET │ 5,870μs │ —\nGET │ 8,240μs │ —\nGET │ 4,651μs │ 8 B\nGET │ 8,333μs │ 32 B\nGET │ 5,477μs │ 240 B\nGET │ 2,635μs │ 101 B\nGET │ 7,087μs │ 8 B\nGET │ 5,890μs │ 240 B\nGET │ 6,499μs │ 101 B\nGET │ 9,372μs │ 8 B\n9.2.5 执行过程\n[05:30:19] 备份 default.db-options -> /data/default.db-options.backup-case2\n[05:30:19] 替换 db-options 为 aggressive RocksDB 调优\n[05:30:19] 停止当前 CKB\n[05:30:21] 用 aggressive 调优重启 CKB\n[05:30:23] CKB 运行中, PID=2105913\n[05:30:27] ckb-probe 挂载, PID=2106838 (--slow --threshold 1000 --interval 5)\n[05:30:27] 等待 ANOMALY DETECTED (最多 1800 秒)...\n[06:00:28] 超时 (slow 模式不产生 ANOMALY DETECTED 标记)\n[06:00:31] 恢复原始 db-options\n[06:00:31] 完成\n9.2.6 Case 2 结论\naggressive 调优成功制造了压缩风暴：GET 延迟从正常 ~200us 飙升至平均 6,988us (35x)\nckb-probe 在 30 分钟内成功捕获 6,112 个慢操作，零事件丢失\n慢操作几乎全部为 GET (99.7%)，因为压缩占用磁盘 I/O 导致读放大\n脚本未检测到 ANOMALY DETECTED 标记，这是因为 --slow 模式不产生该标记（该标记仅在 --json 模式下输出）。数据本身是完整有效的\ndb-options 已在测试结束后自动恢复\n十、后续计划\nWeek 7：优化加固与结项准备\nJSON 全局输出 — 确保所有模式的 JSON 输出格式统一、字段完整\n制作完整演示说明文档 — 结构化的文字演示报告（Markdown），覆盖五个演示流程步骤，附完整终端输出和说明\nWeek 8：发布与结项\n中英双语文档定稿 — 各类文档最终审校\nGitHub v0.1.0 Release — 打 tag、写 release notes、附带预编译 binary\n结项报告 — 按 main_proj.md 规范整理全部交付物、验收清单、已知限制\n社区分享 — 最终月度报告提交",
          "content_html": "<h1><a name=\"p-24047-week-6-48h-1\" class=\"anchor\" href=\"#p-24047-week-6-48h-1\" aria-label=\"Heading link\"></a>Week 6 周报：48h 稳定性测试完成 + 案例研究</h1>\n<blockquote>\n<p>周期：2026-04-20 ~ 2026-04-26<br>\n作者：Clair<br>\n项目：ckb-probe — 基于 eBPF 的 CKB 全节点深度可观测性工具</p>\n</blockquote>\n<hr>\n<h2><a name=\"p-24047-h-2\" class=\"anchor\" href=\"#p-24047-h-2\" aria-label=\"Heading link\"></a>一、本周目标</h2>\n<ol>\n<li>48h 稳定性测试收尾与数据整理</li>\n<li>两个 RocksDB 诊断场景案例分析（IBD 写入模式 + 压缩风暴捕获）</li>\n<li>报告生成脚本修复与优化</li>\n</ol>\n<hr>\n<h2><a name=\"p-24047-h-3\" class=\"anchor\" href=\"#p-24047-h-3\" aria-label=\"Heading link\"></a>二、完成情况</h2>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>交付项</th>\n<th>状态</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>48h 稳定性测试</td>\n<td><img src=\"https://talk.nervos.org/images/emoji/apple/white_check_mark.png?v=15\" title=\":white_check_mark:\" class=\"emoji only-emoji\" alt=\":white_check_mark:\" loading=\"lazy\" width=\"20\" height=\"20\"></td>\n<td>S-1/S-2/S-4 全部 PASS，S-3 为误报（实质 PASS）</td>\n</tr>\n<tr>\n<td>稳定性报告（中英文）</td>\n<td><img src=\"https://talk.nervos.org/images/emoji/apple/white_check_mark.png?v=15\" title=\":white_check_mark:\" class=\"emoji only-emoji\" alt=\":white_check_mark:\" loading=\"lazy\" width=\"20\" height=\"20\"></td>\n<td>STABILITY-REPORT.md / STABILITY-REPORT_zh.md</td>\n</tr>\n<tr>\n<td>Case 1: IBD 写入模式</td>\n<td><img src=\"https://talk.nervos.org/images/emoji/apple/white_check_mark.png?v=15\" title=\":white_check_mark:\" class=\"emoji only-emoji\" alt=\":white_check_mark:\" loading=\"lazy\" width=\"20\" height=\"20\"></td>\n<td>22 分钟完整 IBD 追赶，133 个采样点</td>\n</tr>\n<tr>\n<td>Case 2: 压缩风暴捕获</td>\n<td><img src=\"https://talk.nervos.org/images/emoji/apple/white_check_mark.png?v=15\" title=\":white_check_mark:\" class=\"emoji only-emoji\" alt=\":white_check_mark:\" loading=\"lazy\" width=\"20\" height=\"20\"></td>\n<td>30 分钟，捕获 6,112 个慢操作，GET 延迟 35x</td>\n</tr>\n<tr>\n<td>案例研究报告</td>\n<td><img src=\"https://talk.nervos.org/images/emoji/apple/white_check_mark.png?v=15\" title=\":white_check_mark:\" class=\"emoji only-emoji\" alt=\":white_check_mark:\" loading=\"lazy\" width=\"20\" height=\"20\"></td>\n<td>CASE-STUDY-REPORT_zh.md</td>\n</tr>\n<tr>\n<td>generate-report.sh 修复</td>\n<td><img src=\"https://talk.nervos.org/images/emoji/apple/white_check_mark.png?v=15\" title=\":white_check_mark:\" class=\"emoji only-emoji\" alt=\":white_check_mark:\" loading=\"lazy\" width=\"20\" height=\"20\"></td>\n<td>python3 依赖移除，改用 jq + sed/awk</td>\n</tr>\n<tr>\n<td>case-2 脚本修复</td>\n<td><img src=\"https://talk.nervos.org/images/emoji/apple/white_check_mark.png?v=15\" title=\":white_check_mark:\" class=\"emoji only-emoji\" alt=\":white_check_mark:\" loading=\"lazy\" width=\"20\" height=\"20\"></td>\n<td>RocksDB 调优方式从 ckb.toml 改为 db-options</td>\n</tr>\n</tbody>\n</table>\n</div><hr>\n<h2><a name=\"p-24047-h-48h-4\" class=\"anchor\" href=\"#p-24047-h-48h-4\" aria-label=\"Heading link\"></a>三、48h 稳定性测试结果</h2>\n<p>在 Docker 容器中运行 48 小时（2026-04-20 15:28 ~ 04-22 15:28 UTC），3 个 ckb-probe 实例并行采集 16,693 个时序数据点。</p>\n<h3><a name=\"p-24047-h-5\" class=\"anchor\" href=\"#p-24047-h-5\" aria-label=\"Heading link\"></a>判定结果</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>#</th>\n<th>指标</th>\n<th>结果</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>S-1</td>\n<td>无崩溃</td>\n<td><strong>PASS</strong></td>\n<td>48h 全程运行，零 panic/SIGSEGV</td>\n</tr>\n<tr>\n<td>S-2</td>\n<td>内存稳定</td>\n<td><strong>PASS</strong></td>\n<td>RSS 增长 <strong>0.00 MB</strong>（预算 5 MB）</td>\n</tr>\n<tr>\n<td>S-3</td>\n<td>无 BPF 错误</td>\n<td><strong>PASS</strong>*</td>\n<td>误报，见下方说明</td>\n</tr>\n<tr>\n<td>S-4</td>\n<td>重启恢复</td>\n<td><strong>PASS</strong></td>\n<td>CKB 重启后 <strong>1 秒</strong>重连</td>\n</tr>\n</tbody>\n</table>\n</div><blockquote>\n<p>*S-3 脚本报告为 FAIL，实际为误报。dmesg 中唯一新增的匹配行是 systemd 版本字符串 <code>systemd 255.4-1ubuntu8.14 ... -BPF_FRAMEWORK ...</code>，其中 <code>-BPF_FRAMEWORK</code> 是 systemd 编译选项（表示未启用 BPF framework），被 <code>grep -iE \"bpf|ebpf\"</code> 匹配。<strong>并非 eBPF 子系统错误</strong>。已修复检测逻辑。</p>\n</blockquote>\n<h3><a name=\"p-24047-h-6\" class=\"anchor\" href=\"#p-24047-h-6\" aria-label=\"Heading link\"></a>资源使用</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>指标</th>\n<th>最小值</th>\n<th>最大值</th>\n<th>均值</th>\n<th>P99</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Probe CPU%</td>\n<td>0.00</td>\n<td>0.38</td>\n<td>0.09</td>\n<td>0.29</td>\n</tr>\n<tr>\n<td>Probe RSS</td>\n<td>21.4 MB</td>\n<td>21.4 MB</td>\n<td>21.4 MB</td>\n<td>21.4 MB</td>\n</tr>\n</tbody>\n</table>\n</div><p>48 小时内 RSS 完全平稳，CPU 开销极低。相比 Week 5 性能测试的 21.97 MB，长期运行无任何内存泄漏。</p>\n<h3><a name=\"p-24047-h-7\" class=\"anchor\" href=\"#p-24047-h-7\" aria-label=\"Heading link\"></a>事件保真度</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>指标</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>BPF 事件总数</td>\n<td>126,934</td>\n</tr>\n<tr>\n<td>丢失事件</td>\n<td>0</td>\n</tr>\n<tr>\n<td>丢失率</td>\n<td>0.0000%</td>\n</tr>\n<tr>\n<td>同步区块数</td>\n<td>10,718</td>\n</tr>\n</tbody>\n</table>\n</div><hr>\n<h2><a name=\"p-24047-case-1-ibd-8\" class=\"anchor\" href=\"#p-24047-case-1-ibd-8\" aria-label=\"Heading link\"></a>四、Case 1: IBD 写入模式分析</h2>\n<h3><a name=\"p-24047-h-9\" class=\"anchor\" href=\"#p-24047-h-9\" aria-label=\"Heading link\"></a>各操作平均统计</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>操作</th>\n<th>平均 QPS</th>\n<th>平均延迟 (us)</th>\n<th>平均 P99 (us)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GET</td>\n<td>109.7</td>\n<td>201.9</td>\n<td>7,057.2</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td>4.3</td>\n<td>5.0</td>\n<td>24.2</td>\n</tr>\n<tr>\n<td>ITER_NEW</td>\n<td>8.0</td>\n<td>23.1</td>\n<td>60.1</td>\n</tr>\n<tr>\n<td>TXN_COMMIT</td>\n<td>0.1</td>\n<td>157.4</td>\n<td>343.0</td>\n</tr>\n</tbody>\n</table>\n</div><h3><a name=\"p-24047-h-10\" class=\"anchor\" href=\"#p-24047-h-10\" aria-label=\"Heading link\"></a>同步速度演变</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>时间窗口</th>\n<th>速度 (区块/分钟)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0 ~ 5 分钟</td>\n<td>13.2</td>\n</tr>\n<tr>\n<td>5 ~ 10 分钟</td>\n<td>8.4</td>\n</tr>\n<tr>\n<td>10 ~ 15 分钟</td>\n<td>6.8</td>\n</tr>\n<tr>\n<td>15 ~ 20 分钟</td>\n<td>5.6</td>\n</tr>\n<tr>\n<td>20 ~ 25 分钟</td>\n<td>1.8</td>\n</tr>\n</tbody>\n</table>\n</div><p>GET 是主导操作（109.7 QPS），写入负载较轻。同步速度随节点追上 tip 而递减，符合预期。</p>\n<hr>\n<h2><a name=\"p-24047-case-2-11\" class=\"anchor\" href=\"#p-24047-case-2-11\" aria-label=\"Heading link\"></a>五、Case 2: 压缩风暴捕获</h2>\n<p>通过替换 <code>default.db-options</code> 为 aggressive 参数，故意制造 RocksDB 压缩风暴：</p>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>参数</th>\n<th>aggressive 值</th>\n<th>默认值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>max_background_jobs</code></td>\n<td>1</td>\n<td>6</td>\n</tr>\n<tr>\n<td><code>write_buffer_size</code></td>\n<td>4 MB</td>\n<td>8 MB</td>\n</tr>\n<tr>\n<td><code>level0_file_num_compaction_trigger</code></td>\n<td>1</td>\n<td>4</td>\n</tr>\n<tr>\n<td><code>target_file_size_base</code></td>\n<td>1 MB</td>\n<td>64 MB</td>\n</tr>\n</tbody>\n</table>\n</div><h3><a name=\"p-24047-h-12\" class=\"anchor\" href=\"#p-24047-h-12\" aria-label=\"Heading link\"></a>捕获结果</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>指标</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>持续时长</td>\n<td>30 分钟</td>\n</tr>\n<tr>\n<td>慢操作总数 (&gt;1000us)</td>\n<td>6,112</td>\n</tr>\n<tr>\n<td>BPF 事件丢失</td>\n<td>0 (0.0000%)</td>\n</tr>\n<tr>\n<td>GET 平均延迟</td>\n<td>6,988 us (正常 ~200us 的 <strong>35 倍</strong>)</td>\n</tr>\n<tr>\n<td>GET 最大延迟</td>\n<td>20,242 us</td>\n</tr>\n</tbody>\n</table>\n</div><p>慢操作几乎全部为 GET (99.7%)，压缩占用磁盘 I/O 导致读放大。db-options 在测试结束后自动恢复。</p>\n<hr>\n<h2><a name=\"p-24047-h-13\" class=\"anchor\" href=\"#p-24047-h-13\" aria-label=\"Heading link\"></a>六、脚本修复</h2>\n<h3><a name=\"p-24047-h-61-generate-reportsh-python3-14\" class=\"anchor\" href=\"#p-24047-h-61-generate-reportsh-python3-14\" aria-label=\"Heading link\"></a>6.1 generate-report.sh — 移除 python3 依赖</h3>\n<p>Docker 运行时镜像未安装 python3，导致 <code>events.tsv</code> 为空、histogram 和 anomaly 解析失败。</p>\n<p>修复：全部改用 jq + sed/awk，零新依赖。</p>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>报告章节</th>\n<th>修复前</th>\n<th>修复后</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Per-Op Events</td>\n<td><code>(no event data)</code></td>\n<td>8,642 个采样点</td>\n</tr>\n<tr>\n<td>Histograms</td>\n<td><code>(could not parse)</code></td>\n<td>全部 5 个操作完整分布</td>\n</tr>\n<tr>\n<td>IBD Study</td>\n<td><code>No event data</code></td>\n<td>各操作 QPS/延迟/P99</td>\n</tr>\n<tr>\n<td>Anomaly</td>\n<td><code>(could not parse)</code></td>\n<td>10 条异常事件详情</td>\n</tr>\n</tbody>\n</table>\n</div><h3><a name=\"p-24047-h-62-case-2-compaction-stormsh-rocksdb-15\" class=\"anchor\" href=\"#p-24047-h-62-case-2-compaction-stormsh-rocksdb-15\" aria-label=\"Heading link\"></a>6.2 case-2-compaction-storm.sh — RocksDB 调优方式修复</h3>\n<p>原脚本向 <code>ckb.toml</code> 追加 <code>[store.options]</code> 节，但 CKB 不支持此配置格式（<code>unknown field 'options'</code>）。</p>\n<p>修复：改为替换 <code>default.db-options</code> 文件（CKB 通过 <code>[db] options_file</code> 引用该文件），并新建 <code>db-options.aggressive</code> 配置。</p>\n<h3><a name=\"p-24047-h-63-stability-48hsh-s-3-16\" class=\"anchor\" href=\"#p-24047-h-63-stability-48hsh-s-3-16\" aria-label=\"Heading link\"></a>6.3 stability-48h.sh — S-3 误报修复</h3>\n<p>grep 模式过于宽泛，匹配到 systemd 版本字符串中的 <code>BPF_FRAMEWORK</code>。</p>\n<p>修复：增加 <code>grep -v \"BPF_FRAMEWORK\"</code> 排除。</p>\n<hr>\n<h2><a name=\"p-24047-h-17\" class=\"anchor\" href=\"#p-24047-h-17\" aria-label=\"Heading link\"></a>七、交付物清单</h2>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>文件</th>\n<th>说明</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>docs/STABILITY-REPORT.md</code></td>\n<td>48h 稳定性测试完整报告（英文）</td>\n</tr>\n<tr>\n<td><code>docs/STABILITY-REPORT_zh.md</code></td>\n<td>48h 稳定性测试完整报告（中文）</td>\n</tr>\n<tr>\n<td><code>docs/CASE-STUDY-REPORT_zh.md</code></td>\n<td>Case 1 + Case 2 案例研究报告（中文）</td>\n</tr>\n<tr>\n<td><code>docker/ckb-config/db-options.aggressive</code></td>\n<td>Case 2 用 aggressive RocksDB 配置</td>\n</tr>\n<tr>\n<td><code>docker/scripts/stability/generate-report.sh</code></td>\n<td>修复后的报告生成脚本</td>\n</tr>\n<tr>\n<td><code>docker/scripts/stability/stability-48h.sh</code></td>\n<td>修复后的稳定性测试脚本</td>\n</tr>\n<tr>\n<td><code>docker/scripts/case/case-2-compaction-storm.sh</code></td>\n<td>修复后的压缩风暴脚本</td>\n</tr>\n</tbody>\n</table>\n</div><hr>\n<h2><a name=\"p-24047-h-48h-18\" class=\"anchor\" href=\"#p-24047-h-48h-18\" aria-label=\"Heading link\"></a>八、48h 稳定性测试完整报告</h2>\n<blockquote>\n<p><strong>范围：仅限 CKB 测试网</strong></p>\n</blockquote>\n<h3><a name=\"p-24047-h-81-19\" class=\"anchor\" href=\"#p-24047-h-81-19\" aria-label=\"Heading link\"></a>8.1 测试概要</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>项目</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>开始时间</td>\n<td>2026-04-20T15:28:01+00:00</td>\n</tr>\n<tr>\n<td>结束时间</td>\n<td>2026-04-22T15:28:10+00:00</td>\n</tr>\n<tr>\n<td>持续时长</td>\n<td>48 小时</td>\n</tr>\n<tr>\n<td>内核版本</td>\n<td>6.8.0-106-generic</td>\n</tr>\n<tr>\n<td>CKB 版本</td>\n<td>ckb 0.204.0 (e863939 2026-02-12)</td>\n</tr>\n<tr>\n<td>CPU</td>\n<td>Intel Xeon Platinum 8259CL @ 2.50GHz (24 核)</td>\n</tr>\n<tr>\n<td>内存</td>\n<td>15964 MB</td>\n</tr>\n<tr>\n<td>时序采样点</td>\n<td>16,693</td>\n</tr>\n<tr>\n<td>事件采样点</td>\n<td>8,642 (来自 JSON)</td>\n</tr>\n</tbody>\n</table>\n</div><h3><a name=\"p-24047-h-82-s-1-s-4-20\" class=\"anchor\" href=\"#p-24047-h-82-s-1-s-4-20\" aria-label=\"Heading link\"></a>8.2 S-1 ~ S-4 判定结果</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>#</th>\n<th>指标</th>\n<th>判定标准</th>\n<th>结果</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>S-1</td>\n<td>无崩溃</td>\n<td>ckb-probe 全程运行无 crash/panic</td>\n<td><strong>PASS</strong></td>\n</tr>\n<tr>\n<td>S-2</td>\n<td>内存稳定</td>\n<td>RSS 增长 &lt;= 5 MB（末小时均值 - 首小时均值）</td>\n<td><strong>PASS</strong></td>\n</tr>\n<tr>\n<td>S-3</td>\n<td>无 BPF dmesg 错误</td>\n<td>测试期间零新增 BPF 相关 dmesg 消息</td>\n<td><strong>FAIL</strong>*</td>\n</tr>\n<tr>\n<td>S-4</td>\n<td>进程重启恢复</td>\n<td>CKB 重启后 ckb-probe 60 秒内重新挂载</td>\n<td><strong>PASS</strong></td>\n</tr>\n</tbody>\n</table>\n</div><blockquote>\n<p>*S-3 说明：此 FAIL 为<strong>误报</strong>。详见下方分析。</p>\n</blockquote>\n<details>\n<summary>S-3 误报分析</summary>\n<p><strong>检测逻辑</strong>：<code>dmesg | grep -iE \"bpf|ebpf\"</code> 对比测试前后的行数差异。</p>\n<p><strong>测试开始时</strong> (<code>dmesg-start.log</code>)：空，0 行匹配。</p>\n<p><strong>测试结束时</strong> (<code>dmesg-end.log</code>)：新增 1 行：</p>\n<pre><code class=\"lang-auto\">[2830869.249880] systemd[1]: systemd 255.4-1ubuntu8.14 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)\n</code></pre>\n<p><strong>分析</strong>：这是宿主机 systemd 服务轮换时写入的版本信息，其中 <code>-BPF_FRAMEWORK</code> 是 systemd 的编译选项标记（表示该 systemd 构建<strong>未启用</strong> BPF framework 支持），被 <code>grep -iE \"bpf|ebpf\"</code> 匹配到。</p>\n<p><strong>结论</strong>：</p>\n<ul>\n<li>该消息与 eBPF 子系统无关，不是任何 BPF 程序加载/验证/运行错误</li>\n<li>整个 48 小时测试期间，内核 BPF 子系统未产生任何错误或警告</li>\n<li>ckb-probe 的 eBPF 程序运行完全正常，零事件丢失</li>\n<li>S-3 检测脚本的 grep 模式过于宽泛，已在后续版本中修复（增加 <code>grep -v \"BPF_FRAMEWORK\"</code> 排除）</li>\n</ul>\n<p><strong>实质判定：PASS</strong></p>\n</details>\n<details>\n<summary>S-4 重启测试详情</summary>\n<pre><code class=\"lang-auto\">=== S-4 CKB 重启测试 ===\n触发时间: 2026-04-21T15:28:11+00:00\n已运行: 86409 秒\n\n步骤 1: 向 CKB (PID 1517688) 发送 SIGTERM ...\nSIGTERM 发送于 2026-04-21T15:28:11+00:00\n步骤 2: 等待 10 秒 ...\nCKB 停止于 2026-04-21T15:28:21+00:00\n步骤 3: 重启 CKB ...\n新 CKB PID: 1110470\n步骤 4: 等待 ckb-probe 检测到重启 (最多 60 秒) ...\n在 T+1 秒检测到重连\n\n结果: PASS - ckb-probe 在 1 秒内重新挂载\n重连耗时: 1 秒\n\n=== S-4 测试结束 ===\n</code></pre>\n</details>\n<h3><a name=\"p-24047-h-83-21\" class=\"anchor\" href=\"#p-24047-h-83-21\" aria-label=\"Heading link\"></a>8.3 时序图表</h3>\n<h4><a name=\"p-24047-ckb-probe-cpu-22\" class=\"anchor\" href=\"#p-24047-ckb-probe-cpu-22\" aria-label=\"Heading link\"></a>ckb-probe CPU 使用率</h4>\n<pre><code class=\"lang-auto\">probe CPU%\n\n     0.4 |\n         |\n         |\n         |\n         |\n         |\n         |\n     0.2 |\n         |                                  #\n         |                                ####            ############\n         |                              ##############################\n         |                              ##############################\n         |                              ##############################\n         |##  #  ## #       ###### #  # ##############################\n     0.0 |############################################################\n         +------------------------------------------------------------\n</code></pre>\n<h4><a name=\"p-24047-ckb-probe-kb-23\" class=\"anchor\" href=\"#p-24047-ckb-probe-kb-23\" aria-label=\"Heading link\"></a>ckb-probe 常驻内存 (KB)</h4>\n<pre><code class=\"lang-auto\">probe RSS (KB)\n\n 21952.0 | ###########################################################\n         | ###########################################################\n         |############################################################\n         |############################################################\n         |############################################################\n         |############################################################\n         |############################################################\n 21950.0 |############################################################\n         |############################################################\n         |############################################################\n         |############################################################\n         |############################################################\n         |############################################################\n         |############################################################\n 21948.0 |############################################################\n         +------------------------------------------------------------\n</code></pre>\n<h4><a name=\"p-24047-ckb-cpu-24\" class=\"anchor\" href=\"#p-24047-ckb-cpu-24\" aria-label=\"Heading link\"></a>CKB 节点 CPU 使用率</h4>\n<pre><code class=\"lang-auto\">CKB CPU%\n\n   178.9 |\n         |\n         |\n         |\n         |\n         |\n         |\n    90.2 |\n         |\n         |\n         |\n         |\n         |\n         |\n     1.6 |                                      #\n         +------------------------------------------------------------\n</code></pre>\n<h4><a name=\"p-24047-ckb-25\" class=\"anchor\" href=\"#p-24047-ckb-25\" aria-label=\"Heading link\"></a>CKB 同步速度 (区块/分钟)</h4>\n<pre><code class=\"lang-auto\">      3364 |\n           |\n           |\n           |\n           |\n      1682 |\n           |\n           |\n           |\n           |\n           |\n         0 |                                      #\n           +------------------------------------------------------------\n</code></pre>\n<h3><a name=\"p-24047-h-84-26\" class=\"anchor\" href=\"#p-24047-h-84-26\" aria-label=\"Heading link\"></a>8.4 资源使用统计</h3>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>指标</th>\n<th>最小值</th>\n<th>最大值</th>\n<th>均值</th>\n<th>P99</th>\n<th>预算</th>\n<th>判定</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Probe CPU%</td>\n<td>0.00</td>\n<td>0.38</td>\n<td>0.09</td>\n<td>0.29</td>\n<td>-</td>\n<td>-</td>\n</tr>\n<tr>\n<td>Probe RSS (MB)</td>\n<td>21.4</td>\n<td>21.4</td>\n<td>21.4</td>\n<td>21.4</td>\n<td>100</td>\n<td>PASS</td>\n</tr>\n<tr>\n<td>CKB CPU%</td>\n<td>1.55</td>\n<td>178.94</td>\n<td>2.96</td>\n<td>4.95</td>\n<td>-</td>\n<td>-</td>\n</tr>\n<tr>\n<td>CKB RSS (MB)</td>\n<td>378</td>\n<td>756</td>\n<td>646</td>\n<td>747</td>\n<td>-</td>\n<td>-</td>\n</tr>\n</tbody>\n</table>\n</div><ul>\n<li>ckb-probe 内存 48 小时内<strong>完全平稳</strong> (21.4 MB)，增长 0.00 MB，远低于 5 MB 预算</li>\n<li>CPU 开销极低，P99 仅 0.29%</li>\n</ul>\n<h3><a name=\"p-24047-h-85-27\" class=\"anchor\" href=\"#p-24047-h-85-27\" aria-label=\"Heading link\"></a>8.5 事件保真度报告</h3>\n<h4><a name=\"p-24047-h-28\" class=\"anchor\" href=\"#p-24047-h-28\" aria-label=\"Heading link\"></a>各操作事件统计</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>操作</th>\n<th>采样数</th>\n<th>平均 QPS</th>\n<th>平均延迟 (us)</th>\n<th>平均 P99 (us)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GET</td>\n<td>8,642</td>\n<td>66.0</td>\n<td>178.6</td>\n<td>4,306.3</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td>8,642</td>\n<td>3.4</td>\n<td>3.8</td>\n<td>18.5</td>\n</tr>\n<tr>\n<td>WRITE</td>\n<td>8,642</td>\n<td>0.0</td>\n<td>27.4</td>\n<td>28.2</td>\n</tr>\n<tr>\n<td>ITER_NEW</td>\n<td>8,642</td>\n<td>0.3</td>\n<td>56.4</td>\n<td>294.3</td>\n</tr>\n<tr>\n<td>TXN_COMMIT</td>\n<td>8,642</td>\n<td>0.2</td>\n<td>544.4</td>\n<td>1,771.6</td>\n</tr>\n</tbody>\n</table>\n</div><h4><a name=\"p-24047-bpf-29\" class=\"anchor\" href=\"#p-24047-bpf-29\" aria-label=\"Heading link\"></a>BPF 事件丢失</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>指标</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>总尝试事件数</td>\n<td>126,934</td>\n</tr>\n<tr>\n<td>丢失事件数</td>\n<td>0</td>\n</tr>\n<tr>\n<td>丢失率</td>\n<td>0.0000%</td>\n</tr>\n</tbody>\n</table>\n</div><h4><a name=\"p-24047-ckb-30\" class=\"anchor\" href=\"#p-24047-ckb-30\" aria-label=\"Heading link\"></a>CKB 同步速度</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>指标</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>采样数</td>\n<td>1,401</td>\n</tr>\n<tr>\n<td>起始高度</td>\n<td>20,830,114</td>\n</tr>\n<tr>\n<td>结束高度</td>\n<td>20,840,832</td>\n</tr>\n<tr>\n<td>同步总区块数</td>\n<td>10,718</td>\n</tr>\n<tr>\n<td>平均速度 (区块/分钟)</td>\n<td>7.4</td>\n</tr>\n<tr>\n<td>最大速度 (区块/分钟)</td>\n<td>3,363.9</td>\n</tr>\n<tr>\n<td>最小速度 (区块/分钟)</td>\n<td>0.0</td>\n</tr>\n</tbody>\n</table>\n</div><h3><a name=\"p-24047-h-86-31\" class=\"anchor\" href=\"#p-24047-h-86-31\" aria-label=\"Heading link\"></a>8.6 延迟分布直方图</h3>\n<p>延迟按 log2 分桶（以微秒为单位的 2 的幂次）。</p>\n<h4><a name=\"p-24047-get-32\" class=\"anchor\" href=\"#p-24047-get-32\" aria-label=\"Heading link\"></a>GET</h4>\n<pre><code class=\"lang-auto\">  GET 延迟分布:\n          2us |######                                      232\n          4us |########################################   1528\n          8us |###########                                 421\n         16us |###################                         727\n         32us |###                                         125\n         65us |                                             22\n        131us |                                              1\n        262us |                                              6\n          1ms |                                              2\n          2ms |                                              6\n          4ms |                                             28\n          8ms |                                             36\n         16ms |                                              2\n</code></pre>\n<p>集中在 4~32us，98.4% 请求在 32us 内完成。少量尾部延迟到 8~16ms 区间。</p>\n<h4><a name=\"p-24047-put-33\" class=\"anchor\" href=\"#p-24047-put-33\" aria-label=\"Heading link\"></a>PUT</h4>\n<pre><code class=\"lang-auto\">  PUT 延迟分布:\n          4us |########################################     51\n          8us |########                                     11\n         16us |####                                          6\n</code></pre>\n<p>PUT 操作非常轻量，75% 在 4us 内完成。</p>\n<h4><a name=\"p-24047-write-34\" class=\"anchor\" href=\"#p-24047-write-34\" aria-label=\"Heading link\"></a>WRITE</h4>\n<pre><code class=\"lang-auto\">  WRITE 延迟分布:\n         32us |########################################      3\n</code></pre>\n<p>WRITE 操作频率极低（48 小时仅 3 次），延迟稳定在 32us 档。</p>\n<h4><a name=\"p-24047-iter_new-35\" class=\"anchor\" href=\"#p-24047-iter_new-35\" aria-label=\"Heading link\"></a>ITER_NEW</h4>\n<pre><code class=\"lang-auto\">  ITER_NEW 延迟分布:\n         16us |########################################      9\n         32us |#############                                 3\n</code></pre>\n<p>迭代器创建延迟集中在 16~32us。</p>\n<h4><a name=\"p-24047-txn_commit-36\" class=\"anchor\" href=\"#p-24047-txn_commit-36\" aria-label=\"Heading link\"></a>TXN_COMMIT</h4>\n<pre><code class=\"lang-auto\">  TXN_COMMIT 延迟分布:\n         65us |##############################                3\n        131us |########################################      4\n        262us |####################                          2\n</code></pre>\n<p>事务提交延迟分布在 65~262us，符合 RocksDB WAL 写入特征。</p>\n<h3><a name=\"p-24047-h-87-48h-37\" class=\"anchor\" href=\"#p-24047-h-87-48h-37\" aria-label=\"Heading link\"></a>8.7 48h 慢操作与异常汇总</h3>\n<h4><a name=\"p-24047-h-38\" class=\"anchor\" href=\"#p-24047-h-38\" aria-label=\"Heading link\"></a>慢操作统计</h4>\n<p>由并行运行的 ckb-probe <code>--slow --threshold 1000us</code> 捕获。</p>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>指标</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>慢操作总数</td>\n<td>69,120</td>\n</tr>\n<tr>\n<td>BPF 事件丢失</td>\n<td>0 / 126,934 (0.0000%)</td>\n</tr>\n</tbody>\n</table>\n</div><div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>操作</th>\n<th>数量</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GET</td>\n<td>68,014</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td>6</td>\n</tr>\n<tr>\n<td>WRITE</td>\n<td>0</td>\n</tr>\n<tr>\n<td>ITER_NEW</td>\n<td>203</td>\n</tr>\n<tr>\n<td>TXN_COMMIT</td>\n<td>897</td>\n</tr>\n</tbody>\n</table>\n</div><p>慢操作中 GET 占 98.4%，主要由 RocksDB block cache miss 引起。</p>\n<h4><a name=\"p-24047-h-39\" class=\"anchor\" href=\"#p-24047-h-39\" aria-label=\"Heading link\"></a>异常事件</h4>\n<p>测试期间检测到 <strong>13,411</strong> 个异常事件。</p>\n<p>异常事件示例：</p>\n<pre><code class=\"lang-auto\">  [15:33:03] ITER_NEW: avg=1540.83us (基线=666.53us, 2.31x) p99=25165.82us 触发=P99+CAP\n  [15:33:03] TXN_COMMIT: avg=24250.45us (基线=15615.26us, 1.55x) p99=201326.59us 触发=CAP\n  [15:33:13] ITER_NEW: avg=1426.76us (基线=666.53us, 2.14x) p99=25165.82us 触发=P99+CAP\n  [15:33:13] TXN_COMMIT: avg=22767.23us (基线=15615.26us, 1.46x) p99=201326.59us 触发=CAP\n  [15:33:23] ITER_NEW: avg=1208.45us (基线=666.53us, 1.81x) p99=25165.82us 触发=P99+CAP\n  [15:33:23] TXN_COMMIT: avg=22186.88us (基线=15615.26us, 1.42x) p99=201326.59us 触发=CAP\n  [15:33:33] ITER_NEW: avg=1440.73us (基线=666.53us, 2.16x) p99=25165.82us 触发=P99+CAP\n  [15:33:33] TXN_COMMIT: avg=22421.72us (基线=15615.26us, 1.44x) p99=201326.59us 触发=CAP\n  [15:33:43] GET: avg=1751.38us (基线=490.49us, 3.57x) p99=50331.65us 触发=P99+CAP\n  [15:33:43] ITER_NEW: avg=1262.08us (基线=666.53us, 1.89x) p99=25165.82us 触发=P99+CAP\n</code></pre>\n<p>异常事件集中在测试初期（约 15:33，启动后约 5 分钟），主要涉及 ITER_NEW 和 TXN_COMMIT 操作，均为 RocksDB 压缩风暴的典型表现。未影响后续稳定运行。</p>\n<h3><a name=\"p-24047-h-88-40\" class=\"anchor\" href=\"#p-24047-h-88-40\" aria-label=\"Heading link\"></a>8.8 复现步骤</h3>\n<pre data-code-wrap=\"bash\"><code class=\"lang-bash\"># 系统要求\n# 内核: 6.8.0-106-generic\n# CPU:  Intel Xeon Platinum 8259CL @ 2.50GHz (24 核)\n# 内存: 15964 MB\n# CKB:  ckb 0.204.0 (e863939 2026-02-12) (仅限测试网)\n\n# 1. 启动 CKB 测试网节点\ncd /root &amp;&amp; ./ckb run &amp;\n\n# 2. 运行稳定性测试\ncd /root/ckb-probe\nDURATION_HOURS=48 \\\nSAMPLE_SECS=10 \\\n  bash scripts/stability/stability-48h.sh\n\n# 3. 生成报告\nbash scripts/stability/generate-report.sh /path/to/stability-&lt;timestamp&gt;/\n</code></pre>\n<hr>\n<h2><a name=\"p-24047-h-41\" class=\"anchor\" href=\"#p-24047-h-41\" aria-label=\"Heading link\"></a>九、案例研究完整报告</h2>\n<h3><a name=\"p-24047-case-1-ibd-42\" class=\"anchor\" href=\"#p-24047-case-1-ibd-42\" aria-label=\"Heading link\"></a>Case 1: IBD 写入模式分析</h3>\n<h4><a name=\"p-24047-h-911-43\" class=\"anchor\" href=\"#p-24047-h-911-43\" aria-label=\"Heading link\"></a>9.1.1 测试概要</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>项目</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>执行时间</td>\n<td>2026-04-22 16:05 ~ 16:27 UTC</td>\n</tr>\n<tr>\n<td>持续时长</td>\n<td>22 分钟 (1,329 秒)</td>\n</tr>\n<tr>\n<td>起始 tip</td>\n<td>20,851,949</td>\n</tr>\n<tr>\n<td>结束 tip</td>\n<td>20,852,146</td>\n</tr>\n<tr>\n<td>同步区块数</td>\n<td>197</td>\n</tr>\n<tr>\n<td>平均同步速度</td>\n<td>8.89 区块/分钟</td>\n</tr>\n<tr>\n<td>采样点数</td>\n<td>133 (每 10 秒采样)</td>\n</tr>\n</tbody>\n</table>\n</div><h4><a name=\"p-24047-h-912-44\" class=\"anchor\" href=\"#p-24047-h-912-44\" aria-label=\"Heading link\"></a>9.1.2 各操作统计</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>操作</th>\n<th>平均 QPS</th>\n<th>平均延迟 (us)</th>\n<th>平均 P50 (us)</th>\n<th>平均 P99 (us)</th>\n<th>平均吞吐 (B/s)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GET</td>\n<td>109.7</td>\n<td>201.9</td>\n<td>8.2</td>\n<td>7,057.2</td>\n<td>9,118</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td>4.3</td>\n<td>5.0</td>\n<td>4.5</td>\n<td>24.2</td>\n<td>509</td>\n</tr>\n<tr>\n<td>WRITE</td>\n<td>0.0</td>\n<td>47.8</td>\n<td>41.2</td>\n<td>99.0</td>\n<td>-</td>\n</tr>\n<tr>\n<td>ITER_NEW</td>\n<td>8.0</td>\n<td>23.1</td>\n<td>19.5</td>\n<td>60.1</td>\n<td>-</td>\n</tr>\n<tr>\n<td>TXN_COMMIT</td>\n<td>0.1</td>\n<td>157.4</td>\n<td>150.8</td>\n<td>343.0</td>\n<td>509</td>\n</tr>\n</tbody>\n</table>\n</div><h4><a name=\"p-24047-h-913-vs-45\" class=\"anchor\" href=\"#p-24047-h-913-vs-45\" aria-label=\"Heading link\"></a>9.1.3 写入模式演变（前半段 vs 后半段）</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>操作</th>\n<th>阶段</th>\n<th>平均 QPS</th>\n<th>平均延迟 (us)</th>\n<th>平均 P99 (us)</th>\n<th>平均吞吐 (B/s)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GET</td>\n<td>前半段</td>\n<td>121.2</td>\n<td>214.7</td>\n<td>7,506.8</td>\n<td>10,212</td>\n</tr>\n<tr>\n<td>GET</td>\n<td>后半段</td>\n<td>98.4</td>\n<td>189.4</td>\n<td>6,614.2</td>\n<td>8,041</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td>前半段</td>\n<td>5.0</td>\n<td>5.4</td>\n<td>27.2</td>\n<td>573</td>\n</tr>\n<tr>\n<td>PUT</td>\n<td>后半段</td>\n<td>3.6</td>\n<td>4.5</td>\n<td>21.3</td>\n<td>447</td>\n</tr>\n<tr>\n<td>WRITE</td>\n<td>前半段</td>\n<td>0.0</td>\n<td>52.3</td>\n<td>153.4</td>\n<td>-</td>\n</tr>\n<tr>\n<td>WRITE</td>\n<td>后半段</td>\n<td>0.0</td>\n<td>43.4</td>\n<td>45.5</td>\n<td>-</td>\n</tr>\n<tr>\n<td>ITER_NEW</td>\n<td>前半段</td>\n<td>16.0</td>\n<td>23.8</td>\n<td>64.0</td>\n<td>-</td>\n</tr>\n<tr>\n<td>ITER_NEW</td>\n<td>后半段</td>\n<td>0.1</td>\n<td>22.5</td>\n<td>56.1</td>\n<td>-</td>\n</tr>\n<tr>\n<td>TXN_COMMIT</td>\n<td>前半段</td>\n<td>0.1</td>\n<td>159.6</td>\n<td>363.4</td>\n<td>573</td>\n</tr>\n<tr>\n<td>TXN_COMMIT</td>\n<td>后半段</td>\n<td>0.0</td>\n<td>155.3</td>\n<td>322.8</td>\n<td>447</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>分析：</strong></p>\n<ul>\n<li>前半段处于活跃 IBD 阶段，GET QPS 较高 (121.2)，ITER_NEW 活跃 (16.0 QPS)，反映大量区块验证和状态查询</li>\n<li>后半段节点逐渐追上 tip，各项 QPS 均有所下降，ITER_NEW 降至 0.1（接近 steady state）</li>\n<li>WRITE P99 从前半段 153.4us 降至后半段 45.5us，写放大效应随 IBD 接近尾声而减弱</li>\n<li>PUT 延迟始终很低（4~5us），说明单次写入操作非常轻量</li>\n</ul>\n<h4><a name=\"p-24047-h-914-46\" class=\"anchor\" href=\"#p-24047-h-914-46\" aria-label=\"Heading link\"></a>9.1.4 同步速度演变</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>时间窗口</th>\n<th>新增区块</th>\n<th>速度 (区块/分钟)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0 ~ 5 分钟</td>\n<td>66</td>\n<td>13.2</td>\n</tr>\n<tr>\n<td>5 ~ 10 分钟</td>\n<td>42</td>\n<td>8.4</td>\n</tr>\n<tr>\n<td>10 ~ 15 分钟</td>\n<td>34</td>\n<td>6.8</td>\n</tr>\n<tr>\n<td>15 ~ 20 分钟</td>\n<td>28</td>\n<td>5.6</td>\n</tr>\n<tr>\n<td>20 ~ 25 分钟</td>\n<td>9</td>\n<td>1.8</td>\n</tr>\n</tbody>\n</table>\n</div><p>同步速度持续下降，从 13.2 区块/分钟降至 1.8，最终 tip 停滞。节点数据已接近网络最新高度，符合 “追赶 → 稳态” 的预期曲线。</p>\n<h4><a name=\"p-24047-h-915-47\" class=\"anchor\" href=\"#p-24047-h-915-47\" aria-label=\"Heading link\"></a>9.1.5 异常事件</h4>\n<p>测试期间检测到 <strong>6</strong> 个异常事件，全部为 ITER_NEW 操作：</p>\n<pre><code class=\"lang-auto\">  [16:20:45] ITER_NEW: avg=90.1us (基线=25.66us, 1.80x) p99=1572.86us 触发=P99\n  [16:20:55] ITER_NEW: avg=77.36us (基线=25.66us, 1.55x) p99=1572.86us 触发=P99\n  [16:21:05] ITER_NEW: avg=77.0us (基线=25.66us, 1.54x) p99=1572.86us 触发=P99\n  [16:21:15] ITER_NEW: avg=90.29us (基线=25.66us, 1.81x) p99=1572.86us 触发=P99\n  [16:21:25] ITER_NEW: avg=67.88us (基线=25.66us, 1.36x) p99=1572.86us 触发=P99\n  [16:21:35] ITER_NEW: avg=68.4us (基线=25.66us, 1.37x) p99=1572.86us 触发=P99\n</code></pre>\n<p>异常集中在 16:20~16:21 的 1 分钟内，与 RocksDB 后台 compaction 争用 I/O 带宽一致，属于正常瞬态波动。</p>\n<h4><a name=\"p-24047-h-916-case-1-48\" class=\"anchor\" href=\"#p-24047-h-916-case-1-48\" aria-label=\"Heading link\"></a>9.1.6 Case 1 结论</h4>\n<ul>\n<li>ckb-probe 在 IBD 阶段成功捕获了完整的 RocksDB 操作模式</li>\n<li>GET 是主导操作（平均 109.7 QPS），驱动区块验证和状态读取</li>\n<li>写入负载较轻（PUT 4.3 QPS），写放大不显著</li>\n<li>节点在 22 分钟内从 IBD 追赶至网络最新高度，同步速度符合预期</li>\n<li>探针零崩溃、零事件丢失，对节点同步无可观测影响</li>\n</ul>\n<hr>\n<h3><a name=\"p-24047-case-2-49\" class=\"anchor\" href=\"#p-24047-case-2-49\" aria-label=\"Heading link\"></a>Case 2: 压缩风暴捕获</h3>\n<h4><a name=\"p-24047-h-921-50\" class=\"anchor\" href=\"#p-24047-h-921-50\" aria-label=\"Heading link\"></a>9.2.1 测试概要</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>项目</th>\n<th>值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>执行时间</td>\n<td>2026-04-24 05:30 ~ 06:00 UTC</td>\n</tr>\n<tr>\n<td>持续时长</td>\n<td>30 分钟 (1,800 秒)</td>\n</tr>\n<tr>\n<td>调优方式</td>\n<td>替换 <code>default.db-options</code> 为 aggressive 参数</td>\n</tr>\n<tr>\n<td>采样帧数</td>\n<td>362</td>\n</tr>\n<tr>\n<td>慢操作总数</td>\n<td>6,112 (阈值 &gt; 1,000us)</td>\n</tr>\n<tr>\n<td>BPF 事件丢失</td>\n<td>0 / 6,112 (0.0000%)</td>\n</tr>\n</tbody>\n</table>\n</div><h4><a name=\"p-24047-h-922-aggressive-51\" class=\"anchor\" href=\"#p-24047-h-922-aggressive-51\" aria-label=\"Heading link\"></a>9.2.2 应用的 aggressive 调优参数</h4>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>参数</th>\n<th>值</th>\n<th>默认值</th>\n<th>目的</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>level0_file_num_compaction_trigger</code></td>\n<td>1</td>\n<td>4</td>\n<td>每产生 1 个 L0 文件就触发压缩</td>\n</tr>\n<tr>\n<td><code>level0_slowdown_writes_trigger</code></td>\n<td>2</td>\n<td>20</td>\n<td>2 个 L0 文件时减速写入</td>\n</tr>\n<tr>\n<td><code>level0_stop_writes_trigger</code></td>\n<td>3</td>\n<td>36</td>\n<td>3 个 L0 文件时停止写入</td>\n</tr>\n<tr>\n<td><code>max_background_jobs</code></td>\n<td>1</td>\n<td>6</td>\n<td>限制后台线程，制造压缩瓶颈</td>\n</tr>\n<tr>\n<td><code>target_file_size_base</code></td>\n<td>1 MB</td>\n<td>64 MB</td>\n<td>小文件 → 更多文件 → 更频繁压缩</td>\n</tr>\n<tr>\n<td><code>max_bytes_for_level_base</code></td>\n<td>10 MB</td>\n<td>256 MB</td>\n<td>降低层级容量阈值</td>\n</tr>\n<tr>\n<td><code>write_buffer_size</code></td>\n<td>4 MB</td>\n<td>8 MB</td>\n<td>频繁 flush → 更多 L0 文件</td>\n</tr>\n</tbody>\n</table>\n</div><h4><a name=\"p-24047-h-923-52\" class=\"anchor\" href=\"#p-24047-h-923-52\" aria-label=\"Heading link\"></a>9.2.3 慢操作统计</h4>\n<p>在 aggressive 调优下，30 分钟内共捕获 <strong>6,112</strong> 个超过 1,000us 的慢操作：</p>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>操作</th>\n<th>显示样本数</th>\n<th>平均延迟 (us)</th>\n<th>最大延迟 (us)</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>GET</td>\n<td>2,880</td>\n<td>6,988</td>\n<td>20,242</td>\n</tr>\n<tr>\n<td>TXN_COMMIT</td>\n<td>8</td>\n<td>3,445</td>\n<td>8,389</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>慢操作速率演变：</strong></p>\n<div class=\"md-table\">\n<table>\n<thead>\n<tr>\n<th>时间段</th>\n<th>每 60 秒慢操作数</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>初始阶段</td>\n<td>350 / 5s (等效 ~4,200/min)</td>\n</tr>\n<tr>\n<td>中期</td>\n<td>~5,930 / 60s</td>\n</tr>\n<tr>\n<td>后期</td>\n<td>~6,050 / 60s</td>\n</tr>\n<tr>\n<td>最终</td>\n<td>6,112 / 60s</td>\n</tr>\n</tbody>\n</table>\n</div><p>慢操作数量随时间递增，从初始 ~4,200/min 增长至 ~6,100/min，反映 RocksDB 在 aggressive 参数下 L0 文件持续积压，压缩争用 I/O 带宽导致 GET 延迟大幅上升。GET 平均延迟 6,988us（约 7ms），比正常运行时的 ~200us 高出约 <strong>35 倍</strong>，最大延迟达 20,242us（约 20ms）。</p>\n<h4><a name=\"p-24047-h-924-53\" class=\"anchor\" href=\"#p-24047-h-924-53\" aria-label=\"Heading link\"></a>9.2.4 慢操作样本</h4>\n<pre><code class=\"lang-auto\">  GET    │   4,449μs │        —\n  GET    │   8,490μs │        —\n  GET    │   3,308μs │        —\n  GET    │   7,620μs │        —\n  GET    │   9,957μs │        —\n  GET    │  10,378μs │        —\n  GET    │   5,870μs │        —\n  GET    │   8,240μs │        —\n</code></pre>\n<pre><code class=\"lang-auto\">  GET    │   4,651μs │      8 B\n  GET    │   8,333μs │     32 B\n  GET    │   5,477μs │    240 B\n  GET    │   2,635μs │    101 B\n  GET    │   7,087μs │      8 B\n  GET    │   5,890μs │    240 B\n  GET    │   6,499μs │    101 B\n  GET    │   9,372μs │      8 B\n</code></pre>\n<h4><a name=\"p-24047-h-925-54\" class=\"anchor\" href=\"#p-24047-h-925-54\" aria-label=\"Heading link\"></a>9.2.5 执行过程</h4>\n<pre><code class=\"lang-auto\">[05:30:19] 备份 default.db-options -&gt; /data/default.db-options.backup-case2\n[05:30:19] 替换 db-options 为 aggressive RocksDB 调优\n[05:30:19] 停止当前 CKB\n[05:30:21] 用 aggressive 调优重启 CKB\n[05:30:23] CKB 运行中, PID=2105913\n[05:30:27] ckb-probe 挂载, PID=2106838 (--slow --threshold 1000 --interval 5)\n[05:30:27] 等待 ANOMALY DETECTED (最多 1800 秒)...\n[06:00:28] 超时 (slow 模式不产生 ANOMALY DETECTED 标记)\n[06:00:31] 恢复原始 db-options\n[06:00:31] 完成\n</code></pre>\n<h4><a name=\"p-24047-h-926-case-2-55\" class=\"anchor\" href=\"#p-24047-h-926-case-2-55\" aria-label=\"Heading link\"></a>9.2.6 Case 2 结论</h4>\n<ul>\n<li>aggressive 调优成功制造了压缩风暴：GET 延迟从正常 ~200us 飙升至平均 <strong>6,988us (35x)</strong></li>\n<li>ckb-probe 在 30 分钟内成功捕获 <strong>6,112 个慢操作</strong>，零事件丢失</li>\n<li>慢操作几乎全部为 GET (99.7%)，因为压缩占用磁盘 I/O 导致读放大</li>\n<li>脚本未检测到 <code>ANOMALY DETECTED</code> 标记，这是因为 <code>--slow</code> 模式不产生该标记（该标记仅在 <code>--json</code> 模式下输出）。数据本身是完整有效的</li>\n<li>db-options 已在测试结束后自动恢复</li>\n</ul>\n<hr>\n<h2><a name=\"p-24047-h-56\" class=\"anchor\" href=\"#p-24047-h-56\" aria-label=\"Heading link\"></a>十、后续计划</h2>\n<h3><a name=\"p-24047-week-7-57\" class=\"anchor\" href=\"#p-24047-week-7-57\" aria-label=\"Heading link\"></a>Week 7：优化加固与结项准备</h3>\n<ol>\n<li><strong>JSON 全局输出</strong> — 确保所有模式的 JSON 输出格式统一、字段完整</li>\n<li><strong>制作完整演示说明文档</strong> — 结构化的文字演示报告（Markdown），覆盖五个演示流程步骤，附完整终端输出和说明</li>\n</ol>\n<h3><a name=\"p-24047-week-8-58\" class=\"anchor\" href=\"#p-24047-week-8-58\" aria-label=\"Heading link\"></a>Week 8：发布与结项</h3>\n<ol>\n<li><strong>中英双语文档定稿</strong> — 各类文档最终审校</li>\n<li><strong>GitHub v0.1.0 Release</strong> — 打 tag、写 release notes、附带预编译 binary</li>\n<li><strong>结项报告</strong> — 按 main_proj.md 规范整理全部交付物、验收清单、已知限制</li>\n<li><strong>社区分享</strong> — 最终月度报告提交</li>\n</ol>",
          "like_count": 0,
          "quote_count": 0
        }
      ]
    },
    {
      "topic_id": 10212,
      "title": "Spark Program | Dular",
      "slug": "spark-program-dular",
      "url": "https://talk.nervos.org/t/spark-program-dular/10212",
      "created_at": "2026-04-26T16:35:20.268000+00:00",
      "last_posted_at": "2026-04-27T08:45:49.720000+00:00",
      "category_id": 49,
      "tags": [
        "Spark-Program",
        "Submitted"
      ],
      "posters": [
        "Original Poster, Most Recent Poster",
        "Frequent Poster"
      ],
      "recent_posts": [
        {
          "post_id": 24040,
          "post_number": 2,
          "topic_id": 10212,
          "topic_title": "Spark Program | Dular",
          "topic_slug": "spark-program-dular",
          "author": "zz_tovarishch",
          "created_at": "2026-04-26T23:47:00.339000+00:00",
          "updated_at": "2026-04-26T23:47:55.937000+00:00",
          "reply_to_post_number": null,
          "url": "https://talk.nervos.org/t/spark-program-dular/10212/2",
          "content_text": "Hi duongja,\nThanks for the submission. The proposal aligns well with Spark 2026’s technical focus on Fiber Network and UDT-based payments, and the fact that you already have a working multi-hop RUSD payment through testnet relays is a strong differentiator. Before I bring this to the committee for formal review, I’d like you to revise a few sections so the evaluation can move efficiently.\nAdd a “How to Verify” section. Starting from 2026, every Spark proposal is required to include a low-cost, reproducible verification scheme. For Dular specifically, please describe how a committee member or community reviewer can independently confirm: the phone-to-pubkey registry is live, the M-Pesa STK Push and B2C flows actually settle end-to-end, and the 30-user pilot data is real. Public demo URLs, signed transaction hashes, screen recordings, or a sandbox the reviewer can poke are all acceptable. This is the single most important addition.\nProvide a line-item funding breakdown. Spark’s standard ceiling is $1,000. The $2,000 tier is reserved for projects with exceptional impact, so the justification needs to be concrete. Please upgrade the current per-milestone summary with itemized costs: Daraja API fees (sandbox vs production), Africa’s Talking USSD per-session pricing × estimated sessions, KES float for cash-in/cash-out reconciliation during the pilot, user incentives or transport reimbursement for the 30 testers, and any developer-hour estimate you’d like to include.\nPayment currency. The committee recently decided that, currently, Spark grants will be disbursed in 100% CKB only (no USDI option for now). If this materially affects your numbers, adjust the breakdown accordingly.\nAddress two execution risks up front. First, Safaricom Daraja Production approval typically takes 4–8 weeks and usually requires a Kenyan legal entity or local partner, especially for B2C. Please clarify whether you already hold production credentials, hold sandbox only, or have a partner arrangement in Kenya. Second, please describe your on-the-ground resources for recruitment, vernacular support, and field testing. The 2025 cycle had a project that delivered the technical MVP cleanly but was penalized 10% because the user-testing portion was thin, so this is a recurring committee concern.\nOptional but encouraged. Add a verifiable checkpoint at the end of each milestone (a public release tag, a recorded demo, or a published tx hash). For the existing proposal, appreciate sharing the transaction hash of the successful multi-hop RUSD payment in the proposal itself. This both strengthens the credibility of the application and feeds directly into the “How to Verify” framework above.\nLooking forward to the revised draft.\nBest,\nCC @xingtianchunyan",
          "content_html": "<p>Hi duongja,</p>\n<p>Thanks for the submission. The proposal aligns well with Spark 2026’s technical focus on Fiber Network and UDT-based payments, and the fact that you already have a working multi-hop RUSD payment through testnet relays is a strong differentiator. Before I bring this to the committee for formal review, I’d like you to revise a few sections so the evaluation can move efficiently.</p>\n<ol>\n<li>\n<p>Add a “How to Verify” section. Starting from 2026, every Spark proposal is required to include a low-cost, reproducible verification scheme. For Dular specifically, please describe how a committee member or community reviewer can independently confirm: the phone-to-pubkey registry is live, the M-Pesa STK Push and B2C flows actually settle end-to-end, and the 30-user pilot data is real. Public demo URLs, signed transaction hashes, screen recordings, or a sandbox the reviewer can poke are all acceptable. This is the single most important addition.</p>\n</li>\n<li>\n<p>Provide a line-item funding breakdown. Spark’s standard ceiling is $1,000. The $2,000 tier is reserved for projects with exceptional impact, so the justification needs to be concrete. Please upgrade the current per-milestone summary with itemized costs: Daraja API fees (sandbox vs production), Africa’s Talking USSD per-session pricing × estimated sessions, KES float for cash-in/cash-out reconciliation during the pilot, user incentives or transport reimbursement for the 30 testers, and any developer-hour estimate you’d like to include.</p>\n</li>\n<li>\n<p>Payment currency. The committee recently decided that, currently, Spark grants will be disbursed in 100% CKB only (no USDI option for now). If this materially affects your numbers, adjust the breakdown accordingly.</p>\n</li>\n<li>\n<p>Address two execution risks up front. First, Safaricom Daraja Production approval typically takes 4–8 weeks and usually requires a Kenyan legal entity or local partner, especially for B2C. Please clarify whether you already hold production credentials, hold sandbox only, or have a partner arrangement in Kenya. Second, please describe your on-the-ground resources for recruitment, vernacular support, and field testing. The 2025 cycle had a project that delivered the technical MVP cleanly but was penalized 10% because the user-testing portion was thin, so this is a recurring committee concern.</p>\n</li>\n<li>\n<p>Optional but encouraged. Add a verifiable checkpoint at the end of each milestone (a public release tag, a recorded demo, or a published tx hash). For the existing proposal, appreciate sharing the transaction hash of the successful multi-hop RUSD payment in the proposal itself. This both strengthens the credibility of the application and feeds directly into the “How to Verify” framework above.</p>\n</li>\n</ol>\n<p>Looking forward to the revised draft.</p>\n<p>Best,</p>\n<p>CC <a class=\"mention\" href=\"/u/xingtianchunyan\">@xingtianchunyan</a></p>",
          "like_count": 0,
          "quote_count": 0
        },
        {
          "post_id": 24046,
          "post_number": 3,
          "topic_id": 10212,
          "topic_title": "Spark Program | Dular",
          "topic_slug": "spark-program-dular",
          "author": "duongja",
          "created_at": "2026-04-27T08:45:49.720000+00:00",
          "updated_at": "2026-04-27T08:45:49.720000+00:00",
          "reply_to_post_number": null,
          "url": "https://talk.nervos.org/t/spark-program-dular/10212/3",
          "content_text": "Hi @zz_tovarishch ,\nThanks for the detailed feedback, I’ve updated the proposal to address all the points you raised.\nAdded a comprehensive “How to Verify” section with reproducible checks for the phone-to-pubkey registry, M-Pesa STK Push/B2C flows, and pilot data (including public endpoints, transaction hashes, and demo recordings).\nExpanded the funding breakdown into full line-item detail, including USSD costs (Africa’s Talking), M-Pesa fees, pilot float, user incentives, and developer time.\nClarified CKB-only disbursement and added a mitigation strategy for exchange rate risk.\nIncluded an Execution Risk & Mitigation section confirming that Daraja production credentials are already secured and outlining local, on-the-ground user recruitment and testing capacity.\nAdded verifiable checkpoints per milestone .\nLet me know if there’s anything else you’d like refined before committee review.\nBest,\nduongja",
          "content_html": "<p>Hi <a class=\"mention\" href=\"/u/zz_tovarishch\">@zz_tovarishch</a> ,</p>\n<p>Thanks for the detailed feedback, I’ve updated the proposal to address all the points you raised.</p>\n<ul>\n<li>Added a comprehensive <strong>“How to Verify”</strong> section with reproducible checks for the phone-to-pubkey registry, M-Pesa STK Push/B2C flows, and pilot data (including public endpoints, transaction hashes, and demo recordings).</li>\n<li>Expanded the <strong>funding breakdown</strong> into full line-item detail, including USSD costs (Africa’s Talking), M-Pesa fees, pilot float, user incentives, and developer time.</li>\n<li>Clarified <strong>CKB-only disbursement</strong> and added a mitigation strategy for exchange rate risk.</li>\n<li>Included an <strong>Execution Risk &amp; Mitigation</strong> section confirming that Daraja production credentials are already secured and outlining local, on-the-ground user recruitment and testing capacity.</li>\n<li>Added <strong>verifiable checkpoints per milestone</strong> .</li>\n</ul>\n<p>Let me know if there’s anything else you’d like refined before committee review.</p>\n<p>Best,<br>\nduongja</p>",
          "like_count": 0,
          "quote_count": 0
        }
      ]
    },
    {
      "topic_id": 9845,
      "title": "[DIS] Fiber Link: A CKB Fiber-based Pay Layer (Tipping & Micropayments) for Communities",
      "slug": "dis-fiber-link-a-ckb-fiber-based-pay-layer-tipping-micropayments-for-communities",
      "url": "https://talk.nervos.org/t/dis-fiber-link-a-ckb-fiber-based-pay-layer-tipping-micropayments-for-communities/9845",
      "created_at": "2026-01-18T12:17:10.427000+00:00",
      "last_posted_at": "2026-04-27T04:21:29.166000+00:00",
      "category_id": 65,
      "tags": [],
      "posters": [
        "Original Poster",
        "Frequent Poster",
        "Frequent Poster",
        "Frequent Poster",
        "Most Recent Poster"
      ],
      "recent_posts": [
        {
          "post_id": 24045,
          "post_number": 31,
          "topic_id": 9845,
          "topic_title": "[DIS] Fiber Link: A CKB Fiber-based Pay Layer (Tipping & Micropayments) for Communities",
          "topic_slug": "dis-fiber-link-a-ckb-fiber-based-pay-layer-tipping-micropayments-for-communities",
          "author": "Akane",
          "created_at": "2026-04-27T04:21:29.166000+00:00",
          "updated_at": "2026-04-27T04:21:29.166000+00:00",
          "reply_to_post_number": null,
          "url": "https://talk.nervos.org/t/dis-fiber-link-a-ckb-fiber-based-pay-layer-tipping-micropayments-for-communities/9845/31",
          "content_text": "[Weekly Update] Fiber Link (Milestone 3) / 周报(里程碑 3)\nQuick update for this week:\nThe public demo has now been running for 18 days, and the core functionality has stayed stable overall.\nDuring this time, we found and fixed a few operations-side experience issues. After a bit more observation and verification, we will deliver Milestone 3.\n本周更新：\nFiber Link 的 public demo 到现在已经运行了 18 天，核心功能整体比较稳定。\n这段时间里，我们发现并修复了几个运维侧的体验问题。再经过一段时间的观察和验证后，我们将交付 Milestone 3。",
          "content_html": "<h1><a name=\"p-24045-weekly-update-fiber-link-milestone-3-3-1\" class=\"anchor\" href=\"#p-24045-weekly-update-fiber-link-milestone-3-3-1\" aria-label=\"Heading link\"></a>[Weekly Update] Fiber Link (Milestone 3) / 周报(里程碑 3)</h1>\n<p>Quick update for this week:</p>\n<p>The public demo has now been running for 18 days, and the core functionality has stayed stable overall.</p>\n<p>During this time, we found and fixed a few operations-side experience issues. After a bit more observation and verification, we will deliver Milestone 3.</p>\n<hr>\n<p>本周更新：</p>\n<p>Fiber Link 的 public demo 到现在已经运行了 18 天，核心功能整体比较稳定。</p>\n<p>这段时间里，我们发现并修复了几个运维侧的体验问题。再经过一段时间的观察和验证后，我们将交付 Milestone 3。</p>",
          "like_count": 0,
          "quote_count": 0
        }
      ]
    },
    {
      "topic_id": 10203,
      "title": "CellFabric: A UTXO-Generation and Inter-Protocol Composition Layer for CKB",
      "slug": "cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb",
      "url": "https://talk.nervos.org/t/cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb/10203",
      "created_at": "2026-04-23T04:52:02.945000+00:00",
      "last_posted_at": "2026-04-27T01:31:47.844000+00:00",
      "category_id": 49,
      "tags": [
        "CKB",
        "DAG",
        "Graph"
      ],
      "posters": [
        "Original Poster",
        "Frequent Poster",
        "Most Recent Poster"
      ],
      "recent_posts": [
        {
          "post_id": 24042,
          "post_number": 4,
          "topic_id": 10203,
          "topic_title": "CellFabric: A UTXO-Generation and Inter-Protocol Composition Layer for CKB",
          "topic_slug": "cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb",
          "author": "phroi",
          "created_at": "2026-04-27T00:48:01.381000+00:00",
          "updated_at": "2026-04-27T00:48:01.381000+00:00",
          "reply_to_post_number": null,
          "url": "https://talk.nervos.org/t/cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb/10203/4",
          "content_text": "Hey Arthur, the CellScript / CellFabric split reads much clearer now! I think that part is mostly resolved: CellFabric makes sense as a UTXO-generation / inter-protocol coordination surface, not as a new ledger or transaction-DAG L2.\nCellScript - A DSL for Cell-Based Contracts\nCellScript: authoring and compiling individual cell protocols, including ProofPlan metadata that makes guarantees, coverage, and assumptions explicit;\nCellFabric: a higher inter-protocol intent and composition layer, describing how different protocols coordinate with each other before final CKB settlement.\nOne concrete positive is that the current CellScript code already supports some of the single-protocol side you describe. receipt is a first-class cell type, claim only accepts receipt values, and read_ref lowers through Source::CellDep. That already supports “compose around existing cells” without implying a new settlement layer.\nArthurZhang:\nIdeally, conflict keys should not be arbitrary strings asserted by the intent submitter. They should be recomputable from the protocol’s declared policy, CellScript metadata, or a verifier interface.\nThis is the one part where I still want to hear your view. The repo already exposes per-action touches_shared, read_refs, verifier_obligations, and transaction_runtime_input_requirements, and cellc scheduler-plan can derive simple shared-state conflicts from that metadata. But that still reads to me as intra-module compiler metadata, not yet a standard inter-protocol conflict-key or verifier surface.\nThe same semantics_preserving_claim says stateful lowering is represented in metadata and asm but is “not yet a proved schema decoder/verifier”. Structured WitnessArgs / Source views are still planned for v0.14, and the ProofPlan audit surface with trigger/scope/coverage and builder_assumption reporting is still planned for v0.15.\nSo my current read is: the split is right, the single-protocol foundation is already in the code, and the cross-protocol conflict-key / verifier surface still sits on the roadmap.\nI was wondering: How do you see token standards and the wider inter-protocol interface evolving from here? The small Token / MintAuthority base already in the repo makes that especially interesting to me.\nPhroi",
          "content_html": "<p>Hey Arthur, the <code>CellScript</code> / <code>CellFabric</code> split reads much clearer now! I think that part is mostly resolved: <code>CellFabric</code> makes sense as a UTXO-generation / inter-protocol coordination surface, not as a new ledger or transaction-DAG L2.</p>\n<aside class=\"quote no-group\" data-username=\"ArthurZhang\" data-post=\"16\" data-topic=\"10193\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img alt=\"\" width=\"24\" height=\"24\" src=\"https://talk.nervos.org/user_avatar/talk.nervos.org/arthurzhang/48/11070_2.png\" class=\"avatar\"><a href=\"https://talk.nervos.org/t/cellscript-a-dsl-for-cell-based-contracts/10193/16\">CellScript - A DSL for Cell-Based Contracts</a></div>\n<blockquote>\n<ul>\n<li><strong>CellScript</strong>: authoring and compiling individual cell protocols, including ProofPlan metadata that makes guarantees, coverage, and assumptions explicit;</li>\n<li><strong>CellFabric</strong>: a higher inter-protocol intent and composition layer, describing how different protocols coordinate with each other before final CKB settlement.</li>\n</ul>\n</blockquote>\n</aside>\n<p>One concrete positive is that the current <code>CellScript</code> code already supports some of the single-protocol side you describe. <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/src/types/mod.rs#L417-L429\"><code>receipt</code></a> is a first-class cell type, <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/src/types/mod.rs#L1393-L1399\"><code>claim</code></a> only accepts receipt values, and <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/src/codegen/mod.rs#L2027-L2050\"><code>read_ref</code></a> lowers through <code>Source::CellDep</code>. That already supports “compose around existing cells” without implying a new settlement layer.</p>\n<aside class=\"quote no-group\" data-username=\"ArthurZhang\" data-post=\"1\" data-topic=\"10203\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img alt=\"\" width=\"24\" height=\"24\" src=\"https://talk.nervos.org/user_avatar/talk.nervos.org/arthurzhang/48/11070_2.png\" class=\"avatar\"> ArthurZhang:</div>\n<blockquote>\n<p>Ideally, conflict keys should not be arbitrary strings asserted by the intent submitter. They should be recomputable from the protocol’s declared policy, CellScript metadata, or a verifier interface.</p>\n</blockquote>\n</aside>\n<p>This is the one part where I still want to hear your view. The repo already exposes per-action <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/src/lib.rs#L1985-L2012\"><code>touches_shared</code>, <code>read_refs</code>, <code>verifier_obligations</code>, and <code>transaction_runtime_input_requirements</code></a>, and <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/src/cli/commands.rs#L1144-L1235\"><code>cellc scheduler-plan</code></a> can derive simple shared-state conflicts from that metadata. But that still reads to me as intra-module compiler metadata, not yet a standard inter-protocol conflict-key or verifier surface.</p>\n<p>The same <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/src/lib.rs#L3278-L3283\"><code>semantics_preserving_claim</code></a> says stateful lowering is represented in metadata and asm but is “not yet a proved schema decoder/verifier”. <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/roadmap/CELLSCRIPT_ROADMAP_OVERVIEW.md#42-structured-witnessargs--source-views-p0\">Structured <code>WitnessArgs</code> / Source views</a> are still planned for v0.14, and the <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/roadmap/CELLSCRIPT_ROADMAP_OVERVIEW.md#53-covenant-proofplan-p0\"><code>ProofPlan</code> audit surface</a> with trigger/scope/coverage and <code>builder_assumption</code> reporting is still planned for v0.15.</p>\n<p>So my current read is: the split is right, the single-protocol foundation is already in the code, and the cross-protocol conflict-key / verifier surface still sits on the roadmap.</p>\n<p>I was wondering: How do you see token standards and the wider inter-protocol interface evolving from here? The small <a href=\"https://github.com/tsukifune-kosei/CellScript/blob/fec38e12578c9385d2f3e87c53ae85782252540c/examples/token.cell#L4-L26\"><code>Token</code> / <code>MintAuthority</code> base</a> already in the repo makes that especially interesting to me.</p>\n<p>Phroi</p>",
          "like_count": 0,
          "quote_count": 1
        },
        {
          "post_id": 24043,
          "post_number": 5,
          "topic_id": 10203,
          "topic_title": "CellFabric: A UTXO-Generation and Inter-Protocol Composition Layer for CKB",
          "topic_slug": "cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb",
          "author": "ArthurZhang",
          "created_at": "2026-04-27T01:14:07.607000+00:00",
          "updated_at": "2026-04-27T01:16:36.623000+00:00",
          "reply_to_post_number": 4,
          "url": "https://talk.nervos.org/t/cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb/10203/5",
          "content_text": "Thanks Phroi.\nI agree that the current CellScript metadata is still mostly intra-protocol compiler metadata. It exposes useful raw material : read_refs, touches_shared, verifier obligations, runtime input requirements, receipts, and so on, but it is not yet a stable CellFabric-level conflict-key or verifier-interface standard.\nI also agree that conflict keys should not be arbitrary strings asserted by the intent submitter. At most, they can be hints.\nThe meaningful key should eventually be derivable or checkable from protocol policy, script args, cell schema, CellScript metadata, or a verifier interface.\nThat said, I want to be careful about scope. I probably do not have the bandwidth to design the full CellFabric conflict-key / verifier-interface layer in the current CellScript sprint. My near-term focus is still to make the single-protocol side safer and more inspectable first.\nSo my rough layering is:\nCellScript now / near term: expose the raw materials clearly;\nv0.14/v0.15: make trigger, scope, reads, coverage, enforcement, and builder assumptions explicit through ProofPlan;\nCellFabric later: decide which parts are stable enough to become inter-protocol conflict keys, verifier interfaces, and token/composition standards.\nThe token / MintAuthority example may indeed be a good first narrow domain for that later work. But I would not want to overclaim that it is already designed.\nYour suggestions have been consistently useful for me in sharpening the boundary here. For now I probably need to let the design breathe a little and spend more time building. Maybe at some point, once the lower layers are more solid, we could try some application-level collaboration to stress-test how strong the CellScript / CellFabric split really is.",
          "content_html": "<p>Thanks Phroi.</p>\n<p>I agree that the current CellScript metadata is still mostly intra-protocol compiler metadata. It exposes useful raw material : <code>read_refs</code>, <code>touches_shared</code>, verifier obligations, runtime input requirements, receipts, and so on,  but it is not yet a stable CellFabric-level conflict-key or verifier-interface standard.</p>\n<p>I also agree that conflict keys should not be arbitrary strings asserted by the intent submitter. At most, they can be hints.</p>\n<p>The meaningful key should eventually be derivable or checkable from protocol policy, script args, cell schema, CellScript metadata, or a verifier interface.</p>\n<p>That said, I want to be careful about scope. I probably do not have the bandwidth to design the full CellFabric conflict-key / verifier-interface layer in the current CellScript sprint. My near-term focus is still to make the single-protocol side safer and more inspectable first.</p>\n<p>So my rough layering is:</p>\n<ul>\n<li><strong>CellScript now / near term:</strong> expose the raw materials clearly;</li>\n<li><strong>v0.14/v0.15:</strong> make trigger, scope, reads, coverage, enforcement, and builder assumptions explicit through ProofPlan;</li>\n<li><strong>CellFabric later:</strong> decide which parts are stable enough to become inter-protocol conflict keys, verifier interfaces, and token/composition standards.</li>\n</ul>\n<p>The token / <code>MintAuthority</code> example may indeed be a good first narrow domain for that later work. But I would not want to overclaim that it is already designed.</p>\n<p>Your suggestions have been consistently useful for me in sharpening the boundary here. For now I probably need to let the design breathe a little and spend more time building. Maybe at some point, once the lower layers are more solid, we could try some application-level collaboration to stress-test how strong the CellScript / CellFabric split really is.</p>",
          "like_count": 0,
          "quote_count": 0
        },
        {
          "post_id": 24044,
          "post_number": 6,
          "topic_id": 10203,
          "topic_title": "CellFabric: A UTXO-Generation and Inter-Protocol Composition Layer for CKB",
          "topic_slug": "cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb",
          "author": "phroi",
          "created_at": "2026-04-27T01:31:47.844000+00:00",
          "updated_at": "2026-04-27T01:31:47.844000+00:00",
          "reply_to_post_number": 5,
          "url": "https://talk.nervos.org/t/cellfabric-a-utxo-generation-and-inter-protocol-composition-layer-for-ckb/10203/6",
          "content_text": "That makes sense, Happy Building!!\nPhroi",
          "content_html": "<p>That makes sense, Happy Building!! <img src=\"https://talk.nervos.org/images/emoji/apple/hugs.png?v=15\" title=\":hugs:\" class=\"emoji\" alt=\":hugs:\" loading=\"lazy\" width=\"20\" height=\"20\"></p>\n<p>Phroi</p>",
          "like_count": 0,
          "quote_count": 0
        }
      ]
    },
    {
      "topic_id": 10187,
      "title": "[CN/EN] CTO - 去中心化的链上时间预言机 Decentralized On-Chain Time Oracle",
      "slug": "cn-en-cto-decentralized-on-chain-time-oracle",
      "url": "https://talk.nervos.org/t/cn-en-cto-decentralized-on-chain-time-oracle/10187",
      "created_at": "2026-04-18T21:04:28.521000+00:00",
      "last_posted_at": "2026-04-26T23:54:54.412000+00:00",
      "category_id": 45,
      "tags": [
        "CKB",
        "dapp"
      ],
      "posters": [
        "Original Poster",
        "Frequent Poster",
        "Frequent Poster",
        "Most Recent Poster"
      ],
      "recent_posts": [
        {
          "post_id": 24041,
          "post_number": 5,
          "topic_id": 10187,
          "topic_title": "[CN/EN] CTO - 去中心化的链上时间预言机 Decentralized On-Chain Time Oracle",
          "topic_slug": "cn-en-cto-decentralized-on-chain-time-oracle",
          "author": "phroi",
          "created_at": "2026-04-26T23:54:54.412000+00:00",
          "updated_at": "2026-04-26T23:54:54.412000+00:00",
          "reply_to_post_number": 2,
          "url": "https://talk.nervos.org/t/cn-en-cto-decentralized-on-chain-time-oracle/10187/5",
          "content_text": "Hey Hanssen, interesting idea!! I looked through the repo after reading this. CTO keeps the lock hash unchanged and only accepts newer timestamps proven by header_deps. That does look like a rotating on-chain time source to me. Just the red-envelope example seems to overstate what the published code proves.\nHanssen:\nThe rules are straightforward: recipients must claim the envelope within 24 hours; otherwise, only the sender can reclaim it.\nFor that quoted 24-hour claim, I still see three limits in the published repo:\nThe full group is not proved on chain. The design doc says the updater should include the other N - 1 group cells. The script only counts same-type cell_deps, but CKB allows the cell being updated to also appear as a cell_dep. So the count can pass without proving the other live group cells are actually present.\nCurrent time is still a consumer choice. Consumers can select any cell from the group, the SDK sorts newest first, and the quick start treats group.cells[0] as the latest timestamp. So latest is still a client-side convention.\nFreshness to the network tip is still off chain. The contract only checks the provided header_deps, while the supplier command calls supplyTime() and supplyTime() uses getTipHeader() off chain.\nCTO already gives a fresher shared time reference than arbitrary per-tx header_deps.\nFor stricter deadline logic, a two-tx pattern can prove more. iCKB already uses that staged shape for deposits: phase 1 records the deposit, and phase 2 uses the deposit block header to transform the receipt into iCKB.\nKeep up the Great Work, Phroi",
          "content_html": "<p>Hey Hanssen, interesting idea!! I looked through the repo after reading this. CTO <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/contracts/contracts/ckb-cto-script/src/operations/update.rs#L26-L29\">keeps the lock hash unchanged</a> and only accepts <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/contracts/contracts/ckb-cto-script/src/operations/update.rs#L47-L71\">newer timestamps proven by <code>header_deps</code></a>. That does look like a rotating on-chain time source to me. Just the red-envelope example seems to overstate what the published code proves.</p>\n<aside class=\"quote no-group quote-modified\" data-username=\"Hanssen\" data-post=\"2\" data-topic=\"10187\">\n<div class=\"title\">\n<div class=\"quote-controls\"></div>\n<img alt=\"\" width=\"24\" height=\"24\" src=\"https://talk.nervos.org/user_avatar/talk.nervos.org/hanssen/48/8942_2.png\" class=\"avatar\"> Hanssen:</div>\n<blockquote>\n<p>The rules are straightforward: recipients must claim the envelope within 24 hours; otherwise, only the sender can reclaim it.</p>\n</blockquote>\n</aside>\n<p>For that quoted 24-hour claim, I still see three limits in the published repo:</p>\n<ol>\n<li>\n<p>The full group is not proved on chain. The design doc says the updater should <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/docs/00-contract-design.md#32-update\">include the other <code>N - 1</code> group cells</a>. The script only <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/contracts/contracts/ckb-cto-script/src/operations/update.rs#L31-L45\">counts same-type <code>cell_deps</code></a>, but CKB <a href=\"https://github.com/nervosnetwork/ckb/blob/cb79246b65c116577be00d33d98a6c260db52da2/util/types/src/core/tests/cell.rs#L333-L355\">allows the cell being updated to also appear as a <code>cell_dep</code></a>. So the count can pass without proving the other live group cells are actually present.</p>\n</li>\n<li>\n<p><code>Current time</code> is still a consumer choice. Consumers can <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/docs/00-contract-design.md#4-design-features\">select any cell from the group</a>, the SDK <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/lib/src/cells.ts#L38-L44\">sorts newest first</a>, and the quick start treats <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/lib/README.md#quick-start\"><code>group.cells[0]</code> as the latest timestamp</a>. So <code>latest</code> is still a client-side convention.</p>\n</li>\n<li>\n<p>Freshness to the network tip is still off chain. The contract only <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/contracts/contracts/ckb-cto-script/src/operations/update.rs#L47-L71\">checks the provided <code>header_deps</code></a>, while the <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/supplier/src/commands/supply.ts#L109-L114\">supplier command calls <code>supplyTime()</code></a> and <a href=\"https://github.com/Hanssen0/ckb-cto/blob/56bcbeeba31922c9500b13df40f10d34bef7ac20/lib/src/transactions.ts#L40-L55\"><code>supplyTime()</code> uses <code>getTipHeader()</code></a> off chain.</p>\n</li>\n</ol>\n<p>CTO already gives a fresher shared time reference than arbitrary per-tx <code>header_deps</code>.</p>\n<p>For stricter deadline logic, a two-tx pattern can prove more. iCKB already uses that staged shape for deposits: <a href=\"https://github.com/ickb/whitepaper/blob/055f0cb2c44b2988531c241a6f7167397bbe42c7/README.md#deposit-phase-1\">phase 1 records the deposit</a>, and <a href=\"https://github.com/ickb/whitepaper/blob/055f0cb2c44b2988531c241a6f7167397bbe42c7/README.md#deposit-phase-2\">phase 2 uses the deposit block header to transform the receipt into iCKB</a>.</p>\n<p>Keep up the Great Work, Phroi</p>",
          "like_count": 0,
          "quote_count": 1
        }
      ]
    }
  ]
}