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

Abierto
#1,003 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
TypeScript
Estrellas
28
Forks
35
Merge medio
2 d 4 h
PR fusionados (30 d)
44

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de FilOzone/synapse-sdk

Todos los issues de FilOzone/synapse-sdk

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.