ManyCar doesn't forward put_many_keyed

未关闭 适合新手
#7,910 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust

调研方向

从 src/db/car/many.rs 开始,issue 指出 ManyCar 实现了 Blockstore,请检查它如何将 get 和 put_keyed 转发给其 writer。按照 issue 中所示添加对 put_many_keyed 的转发,然后运行相关的 ManyCar 或 blockstore 测试,以确认批量写入到达 writer;issue 没有指定具体的测试文件。

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

描述

Hey! Was reading through the db code and noticed ManyCar's Blockstore impl only overrides get and put_keyed (many.rs#L225-L244). So put_many_keyed falls back to the default and writes one block at a time, and ParityDb's batched version never gets called.

Since the daemon's store is a ManyCar over the GC'd ParityDb, I think this turns the post-export GC backfill (snapshot.rs#L445) and the write buffer flushes (migrations, CAR imports) into one commit per block instead of one per batch.

The fix should just be forwarding it to the writer:

fn put_many_keyed<D, I>(&self, blocks: I) -> anyhow::Result<()>
where
    Self: Sized,
    D: AsRef<[u8]>,
    I: IntoIterator<Item = (Cid, D)>,
{
    self.writer.put_many_keyed(blocks)
}

Happy to send a PR if that sounds right.

(Found this with help from Claude Code; I checked the code paths myself.)

主要语言
Rust
星标
700
派生
201
平均合并
1 天 17 小时
30 天内合并 PR
65

环境准备

从这里开始

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

ChainSafe/forest 的其他 Issue

查看 ChainSafe/forest 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

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