Short confirmation timeouts report on-chain operations as failed when they may still succeed

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
javascript, typescript

調査の方向性

Start by reading the Curio wait functions in packages/synapse-core/src/sp/, then inspect the listed pay/*, erc20/approve.ts, warm-storage/terminate-service.ts and warm-storage/add-approved-provider.ts receipt waits, plus StorageContext.commit() and the piece batcher. Check how RETRY_CONSTANTS.TIMEOUT is used and read related issue #996. Done means confirmation waits can be configured without changing HTTP timeouts, receipt waits use an explicit timeout, and timeout errors preserve the transaction hash and indicate the outcome is unknown.

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

説明

bug

Problem

The SDK reports a commit or payment operation as failed if the transaction isn't confirmed within a short fixed window, even though the transaction may still land afterwards.

  • Curio status waits (waitForAddPieces, waitForCreateDataSet, waitForCreateDataSetAddPieces, waitForTerminateService, deletion waits in packages/synapse-core/src/sp/) default to RETRY_CONSTANTS.TIMEOUT = 5 minutes (10 Filecoin epochs).
  • viem waitForTransactionReceipt is called without a timeout in pay/*, erc20/approve.ts, warm-storage/terminate-service.ts and warm-storage/add-approved-provider.ts, so it uses viem's default of 3 minutes (6 epochs).

When the network is congested, either window can expire before the transaction is included. The caller gets a TimeoutError for an operation that later succeeds on-chain, and may retry it, creating duplicates (e.g. a second data set or a double deposit).

The SDK layer also gives no way to change these values. StorageContext.commit() calls SP.waitForAddPieces(addPiecesResult) and the piece batcher calls SP.waitForAddPieces({ statusUrl }), neither passing a timeout.

Proposal

  • Raise the defaults for confirmation waits (separately from RETRY_CONSTANTS.TIMEOUT, which is also used for plain HTTP requests), e.g. a CONFIRMATION_TIMEOUT sized for congested conditions.
  • Pass an explicit timeout to waitForTransactionReceipt.
  • Let SDK callers override the confirmation timeout on commit/upload.
  • On timeout, return an error that carries the tx hash and says the outcome is unknown, so callers can check later instead of retrying blindly.

Related

  • #996: waitForCreateDataSetAddPieces ignores its timeout option and doesn't accept a signal.
主要言語
TypeScript
スター
28
フォーク
35
平均マージ
2日 4時間
マージ済み PR(30日)
44

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

FilOzone/synapse-sdk のほかの issue

FilOzone/synapse-sdk の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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