Anchor reply over the byte limit keeps the old Listing as a passing fault

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript

調査の方向性

Read reference-implementations/dacs-directory/src/catalog/chain.ts around line 118 and src/catalog/artifactLimits.ts, then compare the unreadable reply and immediate drop cases. Update the catch behavior and freshness-api.md to match, and add coverage in test/chain-storage.test.ts and test/listing-anchor-read-fault.test.ts. Done means the oversized 2xx reply has the documented behavior and both tests pass.

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

説明

contributors-section

Where: reference-implementations/dacs-directory/src/catalog/chain.ts:118 (on phase0-completion at the linked commit)

What goes wrong: In readAnchorResult, a successful (2xx) storage reply larger than the 1 MiB response ceiling (MAX_STORAGE_RESPONSE_BYTES, src/catalog/artifactLimits.ts:14) throws StorageResponseTooLarge. The catch at chain.ts:118 turns it into an unavailable read without nodeRefusal, so the indexer treats it as a passing fault and keeps the previously indexed Listing for up to 24 hours or until its validity.notAfter. The neighbouring cases are handled the other way: an over-limit payload (chain.ts:123) and a reply refused by raw JSON admission (chain.ts:114) set nodeRefusal and drop the Listing at once. docs/freshness-api.md:26 and :31 list the passing faults and the immediate drops, and an over-size reply is not mentioned in either list.

Suggested fix: In the catch at chain.ts:118, set nodeRefusal: true when the error is StorageResponseTooLarge (the reply there is already a 2xx), so an over-size reply behaves like the over-limit payload case. If you decide it should stay a passing fault, say so in the AnchorRead comment instead. Update docs/freshness-api.md (the 'unreadable reply' wording at line 26 and the drop list at line 31) to match, and add a test in test/chain-storage.test.ts, plus one in test/listing-anchor-read-fault.test.ts that checks whether the old Listing is kept or dropped.

Size: Small

This comes from a code review, not from a failing run, so please confirm it before starting. Send the fix as a pull request to phase0-completion. It merges once tests pass and a maintainer has approved it.

主要言語
TypeScript
スター
0
フォーク
3
平均マージ
20時間 26分
マージ済み PR(30日)
119

環境構築

はじめの一歩

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

DACS-Agent-commerce/Community のほかの issue

DACS-Agent-commerce/Community の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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