Sui Network Outage Retrospective and Transparency Report


Participants and Objectives of the Transparency Session

  • Participants:

    • Adani Abiodun: Host and representative of the Sui ecosystem.

    • Sam Blackshear: CTO and Cofounder of Mysten Labs.

    • Mark Logan: Core engineer at Mysten Labs leading work on the Sui core protocol.

  • Primary Goal: To provide an exhaustive, transparent explanation regarding a series of network outages that occurred the previous week, explain the root causes, and outline the strategies being implemented to prevent recurrence.

  • Mission Statement: The Sui network aims to be a global payments rail where sending money is as easy as sending messages, serving as the default infrastructure for financial transactions.

  • Acknowledgment of System Criticality: Sam Blackshear emphasized that Sui is a security-critical system where the value proposition relies on being "always up" and "always fast." The team acknowledged falling short of this standard during the outages.

The First Network Outage: Gas Smashing and Hybrid Payments

  • Timeline and Release Context: The first crash occurred around 7:00 AM7:00\,\text{AM} PT on Thursday. It was triggered following the release of version 1.721.72.

  • New Feature: Address Balances: This release introduced the "address balances" feature.

    • Previously, gas could only be paid for using discrete coin objects.

    • The new feature allowed payments via a designated address balance.

    • Hybrid Gas: This refers to payments made using a combination of address balances and coin objects.

  • Gas Smashing Mechanism:

    • When hybrid gas or multiple coin objects are used, the system performs "gas smashing," which consolidates all input coins into a single input coin.

    • This ensures the system has a singular coin of sufficient size to debit the required gas amount.

    • Crucial Logic: Gas smashing must occur whether a transaction succeeds or fails.

  • The Root Cause (Underflow of Address Balances):

    • If a transaction attempts to withdraw more than is available in an address balance, it is marked as canceled with the error code insufficient funds for withdraw.

    • In the 1.721.72 release, an edge case existed: when a transaction was canceled due to insufficient funds, the system still attempted to perform gas smashing on that failed transaction.

    • During this process, it tried to debit the address balance a second time.

  • Technical Details on the Crash:

    • Address balances use "deltas" (e.g., −10-10 or +20+20) rather than direct state updates to allow for concurrent withdrawals.

    • These deltas are reconciled in a settlement transaction before commitment.

    • The crash happened because the gas smashing logic emitted a negative delta against a zero balance, causing an underflow that crashed the validator binary.

  • Nondeterministic Nature: Transactions with insufficient funds usually don't pass consensus. This specific error only occurred when two or three complex features interacted under specific timing conditions (race conditions) where two transactions hit the schedule simultaneously, and one "lost" due to funds being taken by the other.

The Second Network Outage: Multiple Failure Reasons

  • Timeline: Occurred starting around 5:00 AM5:00\,\text{AM} PT on Friday, approximately 1212 hours after the network had resumed following the first fix.

  • System Recovery Mechanics: For the network to resume, validators (representing more than two-thirds of the stake) must independently adopt and run the new fixed binary.

  • The Problem: Canonical Root Causes:

    • The team initially identified the insufficient funds path but implemented a fix that focused on that specific error condition.

    • A transaction can fail for multiple simultaneous reasons (e.g., insufficient funds AND cancellation due to shared object congestion).

    • Shared Object Congestion: If too many transactions attempt to access a single shared object (like a deep book pool), the queue becomes too long and some transactions are canceled to maintain throughput.

    • The Error: The system typically selects one "canonical" reason for failure. If the system recorded the failure as a queue cancellation but the transaction also had insufficient funds, it bypassed the first fix and hit the original bad code path, leading to the same underflow crash.

  • Resolution: The network was restored by 9:40 AM9:40\,\text{AM} PT on Friday after a more comprehensive fix was deployed and adopted by the validators.

Understanding Address Balances and Hybrid Models

  • Architecture Shift: Sui has moved from being a pure UTXO (Unspent Transaction Output) chain (where funds are stored in individual objects/coins) to a hybrid model encompassing both UTXOs and an Account model.

  • Limitations of Pure Object Models:

    • Requires "coin selection" logic for every transaction.

    • Increases complexity for indexing, wallets, and infrastructure.

    • Users cannot simply state "I want to spend 5 SUI5\,\text{SUI}" without identifying exactly which coin objects to use.

  • Benefits of Address Balances:

    • Allows for declarative spending.

    • Simplifies wallet and indexer management of funds.

    • Enables high-volume micro-payments and high sender volumes.

  • Parallel Execution Preservation:

    • The system uses a settlement transaction at the end of a checkpoint to gather all deposits and withdrawals, writing them to the balance object in one go.

    • Funds Withdrawal Reservation: Transactions declare the maximum amount they intend to withdraw. The scheduler checks these reservations against the total balance at the start of a commit. If the total reservation exceeds the balance (e.g., 50 SUI50\,\text{SUI} reserved but only 40 SUI40\,\text{SUI} available), the scheduler cancels enough transactions to stay within the limit.

The Third Network Outage: Epoch Change and Randomness

  • Timeline: The final crash occurred during an epoch change at approximately 1:30 PM1:30\,\text{PM} PT on Friday.

  • Native Randomness and DKG: Sui uses Distributed Key Generation (DKG) at the start of each epoch to bootstrap the native randomness beacon (used for gaming and coin flips).

  • The Quorum Problem:

    • Standard transactions require a two-thirds (66.7%66.7\%) quorum of stake.

    • DKG requires a higher, specific threshold than standard transactions.

    • Because validators were coming back online gradually after previous outages, they often met the two-thirds threshold to run the network but did not reach the higher threshold required for DKG.

  • The Stall Logic:

    • During the outages, randomness was effectively disabled because DKG had not completed.

    • When randomness is disabled, randomness-dependent transactions should queue up and be canceled.

    • However, due to the validators having restarted, the state regarding the DKG failure was not correctly handled. Randomness transactions queued up but were not cleared.

    • Sui protocols require that all transactions between the start of an epoch change and the advance to the next epoch must be cleared. Because these transactions were stalled, the network could not move to the next epoch.

  • Resolution Strategy: The team had to coordinate a network shutdown. Validators then installed a binary with a hard-coded consensus commit number to force the end of the epoch. The network moved to the next epoch successfully on Saturday evening.

Engineering Safety and Artificial Intelligence

  • Testing Failure: The team acknowledged that while they have an automated test workflow generator that randomizes feature combinations, this specific combination (hybrid gas + insufficient funds + cancellation) was missed in the test axes.

  • Usage of AI for Debugging:

    • AI agents are used extensively for incident response and log analysis.

    • Agents check validator logs and stack traces to provide summaries to engineers before they even answer a page.

    • This assisted significantly in diagnosing all three outages.

  • Usage of AI for Coding ("Agentic Engineering"):

    • The team rejects "vibe coding" (shipping unread AI code).

    • AI (specifically models like Claude) is used as a "faster typer" and co-author. Humans direct the logic, define invariants, and specify required tests.

    • Mark Logan noted that AI allows engineers to write more tests because the cost of writing a test for a low-probability edge case is reduced to zero if the engineer can conceptualize it.

Future Hardening and Resilience Strategies

  • Defense in Depth: The team is investigating a "failure containment" strategy. A single crashing transaction or a bad consensus commit should not be able to halt the entire network. If a transaction causes a crash, the system should ideally be able to drop it and continue.

  • Gas Logic Overhaul:

    • The current gas charging logic is complex due to storage rebates (paying for writes) and nonrefundable storage fees.

    • The fallback paths (e.g., running out of gas while trying to calculate the rebate) are currently being rewritten to be more modular, clean, and mathematically obvious.

  • Formal Verification:

    • Mysten Labs is experimenting with using formal verification to create mathematical proofs of code correctness.

    • The goal is to prove that the gas logic can never create or destroy funds and can never crash, moving from "empirically validated" code to "proven" code.

  • Epoch Resilience: The team plans to break down every component of an epoch change to ensure the network can operate even if specific components (like randomness or staking reward distribution) fail.

  • Developer Roadmap: No other