Skip to content

Add resumable upload support to Walrus high-level APIs#952

Draft
hayes-mysten wants to merge 3 commits intomainfrom
ml/walrus-resumable-uploads
Draft

Add resumable upload support to Walrus high-level APIs#952
hayes-mysten wants to merge 3 commits intomainfrom
ml/walrus-resumable-uploads

Conversation

@hayes-mysten
Copy link
Contributor

Description

Add crash-resumable upload flows for production pipelines processing large volumes of files. Motivated by partner feedback (Tatum, ingesting 2.75TB / 400k+ files) that the high-level SDK flows are not crash-resumable in practice.

Key changes:

  • Unified WriteBlobStep type: Discriminated union (encoded | registered | uploaded | certified) used as return values from flow methods, async iterator yields, onStep callbacks, and resume input. Each step result is directly saveable to a database and passable as resume.

  • Flow resume: writeBlobFlow() and writeFilesFlow() accept a resume option with prior step state. When resuming, completed steps are skipped and blob consistency is validated (blobId checked against re-encoded content).

  • run() async iterator: New method on flows that runs the full pipeline, yielding step results. Automatically skips register when resuming with a known blobObjectId.

  • executeRegister() / executeCertify(): Convenience methods on flows that handle signing internally and return typed step results.

  • Smart sliver deduplication: writeEncodedBlobToNode() now checks metadata and sliver status before uploading, matching the Rust SDK's three-gate optimization (metadata status → size heuristic → per-sliver status). Previously stored slivers are skipped to avoid re-sending large data on resume.

  • New storage node methods: getSliverStatus() and getMetadataStatus() for lightweight existence checks (endpoints exist in Rust API but were not in TS SDK).

  • New client methods: getStorageConfirmations() to re-fetch confirmations from all nodes (for post-upload resume), getBlobObject() to load a blob object by ID.

  • onStep / resume on writeBlob() and writeFiles(): Checkpoint callback and resume support on the all-in-one methods. Both now use the flow internally (single implementation path).

  • computeBlobMetadata() accepts optional nonce: Allows replaying a saved nonce for deterministic resume on the upload relay path.

Test plan

  • All 72 existing unit tests pass
  • Tested against testnet with funded keypair — 4 integration scenarios:
    1. run() iterator yields all 4 steps correctly
    2. Manual steps with executeRegister/executeCertify return correct step types
    3. Resume from registered checkpoint correctly skips encode+register, only yields uploaded+certified
    4. writeBlob() with onStep callback fires at each step
  • Examples in packages/walrus/examples/resumable/

AI Assistance Notice

  • This PR was primarily written by AI.
  • I used AI for docs / tests, but manually wrote the source code.
  • I used AI to understand the problem space / repository.
  • I did not use AI for this PR.

🤖 Generated with Claude Code

Add crash-resumable upload flows for production pipelines processing
large volumes of files. Key changes:

- Unified WriteBlobStep discriminated union used as return values from
  flow methods, async iterator yields, onStep callbacks, and resume input
- Flow resume: writeBlobFlow() and writeFilesFlow() accept a resume
  option with prior step state to skip completed work
- run() async iterator on flows for convenient full-pipeline execution
- executeRegister()/executeCertify() convenience methods on flows
- Smart sliver deduplication matching the Rust SDK's three-gate strategy
  (metadata status check, size heuristic, per-sliver status check)
- getSliverStatus()/getMetadataStatus() storage node client methods
- getStorageConfirmations()/getBlobObject() client helper methods
- onStep/resume on writeBlob() and writeFiles() (now use flow internally)
- computeBlobMetadata() accepts optional nonce for deterministic resume

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hayes-mysten hayes-mysten temporarily deployed to sui-typescript-aws-kms-test-env March 16, 2026 20:41 — with GitHub Actions Inactive
@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-typescript-docs Ready Ready Preview, Comment Mar 16, 2026 9:48pm

Request Review

Add docs site page at walrus/resumable-uploads covering:
- run() async iterator with checkpoint saving
- writeBlob() onStep callback and resume
- Manual step-by-step flow with executeRegister/executeCertify
- Step result types reference table
- Helper methods for advanced resume
- Smart sliver deduplication explanation

Also update the package README with the same content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Integrate run(), executeRegister/executeCertify, resume, and onStep
into the existing flow and writeBlob sections rather than a separate
page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant