PieceCIDv2 validation vs FRC-0069: oversized trees, heights 0/1, and the 0-byte vector

オープン
#314 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
solidity

調査の方向性

Read FRC-0069 alongside Cids.validateCommPv2 and PDPVerifier.addPieces, then compare the listed vectors and results in report/REPORT.md and vectors/piececid-v2.json. Determine which behaviors should match the FRC, including oversized trees, heights 0 and 1, the 0-byte vector, and padding varints. Done means the intended rules are agreed and documented or implemented consistently.

索引モデルが issue の本文から書いたものです。

説明

Following up on the canonical-encoding point in #286. We ran 1,244 PieceCIDv2 vectors (generated from a reference model written from the FRC-0069 text) through Cids.validateCommPv2 and PDPVerifier.addPieces at 3d486ae, on both compact and legacy data sets. Both storage paths agree with each other on every vector. Three places differ from the FRC, and we'd like to know which are intended:

  1. Non-minimal trees are accepted. FRC-0069 makes the height the minimal one for the payload (padding < data, height 2 excepted). addPieces only checks that padding fits in the tree, so a 127-byte payload can be added as (padding 0, h 2), (127, h 3), (381, h 4), ... Each is a different CID with a different root, and each is accepted (33 vectors). So one payload has many valid on-chain identities (findPieceIdsByCid, CID-keyed accounting in FWSS), and the provider proves, and the client pays for, zero padding. Is the oversized form meant to be valid?
  2. Heights 0 and 1 are accepted (17 vectors). The FRC's minimum is height 2 (127 bytes). Some tests here use height-0 pieces, so this may be deliberate. If it is, would a note in the FRC or in Cids.sol help?
  3. The FRC's 0-byte vector is rejected. bafkzcibcp4bdomn3tgwgrh3g532zopskstnbrd2n3sxfqbze7rxt7vqn7veigmy (padding 127, h 2) fails isPaddingExcessive (128*127/127 >= 2^7). Rejecting empty pieces makes sense; the FRC currently says the opposite.

Minor: the library function validateCommPv2 on its own accepts 10-byte padding varints (2^63, 2^64), which addPieces then rejects only through the height cap.

Vectors, per-vector results and the reference model: https://github.com/let-the-dreamers-rise/pdp-conform (report/REPORT.md, vectors/piececid-v2.json). Happy to send a PR for whichever direction you prefer.


Generated by Claude Code

主要言語
Solidity
スター
20
フォーク
18
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FilOzone/pdp のほかの issue

FilOzone/pdp の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。