Sui.

Post

Share your knowledge.

article banner.
D’versacy .
Aug 15, 2025
Article

🐞Debugging Move Packages & Transactions on Sui — Made Simple!

❓ Problem: Debugging Move on Sui feels like searching for a needle in a haystack. Errors are cryptic, stack traces look alien, and reproducing bugs is tough.

💡 Why this happens: On-chain failures behave differently than traditional code errors. Without a clear debug loop, fixing them can feel like guesswork.

🎯 Goal: Equip you with tools, logs, and workflows to reproduce, debug, and fix issues with confidence.


🛠️ 1) Use Local Deterministic Devnets

  • Spin up a single-node local devnet with fixed seed accounts for reproducibility.
  • Commands like sui start or run-local-network.sh work great.
  • Benefit: Test without network noise! 📚 docs.sui.io

🧪 2) Unit Tests & Move Test Harness

  • Run:
sui move test
  • Write tests for edge cases & expected reverts.
  • Faster feedback = faster bug squashing. 🐛

🔍 3) Transaction Simulation & Logging

  • Simulate before you submit using SDK APIs.
  • Inspect transaction effects to see: ✅ Created objects ✅ Mutated objects ✅ Deleted objects
  • Read emitted events to trace what happened step-by-step. 📚 Mysten Labs TS SDK Docs

📄 4) Use Node Logs & Debug Flags

  • Run nodes with verbose logging to get detailed execution traces.
  • Check Sui repo for debug flag usage.
  • If you can, peek at validator logs for tricky issues.

🪜 5) Step-by-Step Debug Flow

  1. Reproduce locally with the same object IDs/inputs.
  2. Write a sui move test that mimics the transaction.
  3. Inspect transaction effects & logs.
  4. Add assertions to pinpoint wrong state changes.
  5. Fix → Test → Repeat until stable.
  • Sui
0
Share
Comments
.