gRPC migration
Use this file to decide execution order before running any migration step. Detailed step prompts are in docs/grpc-migration/migration-step-prompts.md. Policy enforcement gates are in docs/grpc-migration/policy-gates.md.
0. Scope
Core track (universal):
@mysten/sui1.x -> 2.x migrationdApp Kit -> dApp Kit React migration
Conditional track (selected by scenario):
@mysten/walrus/@mysten/suins0.x -> 1.xchain-fixed network exception (only with explicit rationale comment)
Gate F runtime validation (only when trigger conditions are met)
This file defines scenario detection, case selection, and execution order. Workflow style contract: keep copy/paste + single-prompt execution as default.
1. Core Policies (must hold in every case)
Do not introduce
SuiJsonRpcClient.Do not introduce imports from
@mysten/sui/jsonRpc.Legacy-detection keywords should be limited to 1.x-era symbols.
Post-migration quality gates may inspect 2.x loader patterns.
For digest-based transaction content loading, use a two-stage loader (
gRPC getTransactionfirst, then GraphQL fallback with explicit error when both miss).For shared digest loaders, keep network caller-driven (no module-scope fixed network literals).
In GraphQL fallback, check
errorsbefore readingdata, and include network/stage in loader errors.In GraphQL transaction queries, treat
effectslist fields as connection types and usenodes/edgesaccess.For same-flow submit confirmation (
waitForTransaction), gRPC is allowed.Unresolved
BLOCKERitems are fail state (no accepted-blocker shortcut).
2. Conditional Policies
If a flow is chain-fixed, hardcoded network is allowed only with explicit rationale in code comments.
When GraphQL query fields or two-stage byte loader behavior changes, Gate F runtime validation is required.
Walrus/SuiNS-specific checks apply only in Case B/C.
3. Repository/Workspace Scope (monorepo-safe)
Run this once before scenario detection:
All scan/gate commands in this kit should use repository root . with explicit include/exclude globs:
include:
**/*.{ts,tsx,js,jsx,mjs,cjs,graphql,gql}and**/package.jsonexclude:
**/node_modules/**,.git/**
4. Scenario Detection
Run this detection command first:
Then inspect matched package manifests for intended @mysten/sui major version.
5. Case Selection
Case A: Sui-only migration
Choose Case A when:
No Walrus/SuiNS usage is detected
You are migrating
@mysten/sui+ dApp Kit paths
Execution order:
Step 1
Step 2
Step 3
Step 4
Step 5
Optional Step E (post-migration DRY: consolidate duplicate constants and factories)
Case B: Sui + Walrus/SuiNS together
Choose Case B when:
Walrus/SuiNS usage is detected
Sui core migration and Walrus/SuiNS migration are both needed
Execution order:
Step 1
Step 2
Step 3
Optional Step A
Optional Step B
Optional Step C
Step 3 (rerun: check that Optional A-C changes did not introduce drift in shared backend files — gRPC loader patterns, client setup, imports)
Step 4
Optional Step D
Step 5
Optional Step E (post-migration DRY: consolidate duplicate constants and factories)
Case C: Sui 2.x already done, Walrus/SuiNS-only migration
Choose Case C when:
@mysten/suimigration is already completeOnly Walrus/SuiNS migration remains
Execution order:
Optional Step A
Optional Step B
Optional Step C
Optional Step D
Step 5
Optional Step E (post-migration DRY: consolidate duplicate constants and factories)
Post-run recommendation (all cases):
Run Optional Step E from
docs/grpc-migration/migration-step-prompts.mdto consolidate any duplicate constants/factories.Run Step 6 (final audit) from
docs/grpc-migration/migration-step-prompts.mdas a separate prompt.
6. Integration Gates (Case B/C)
Run these checks after Optional Step C and before final validation:
If any match remains:
Keep migration status as incomplete
Add
BLOCKER+ TODOContinue only after explicit fix
7. One-Prompt Mode (Confirm-only)
Paste this into your AI agent when you want one continuous run:
8. Required Step Report Format (every step)
Each completed step must output:
step name + completion status
changed files or commands executed
verify checklist pass/fail
TODO/BLOCKER list
ready for next step: yes/no
Last updated