Skip to content

Investigate SUI broadcast failures #11485

@gomesalexandre

Description

@gomesalexandre

Overview

SUI transaction broadcasts are intermittently failing with object version mismatch errors. The error indicates that the object version used in the transaction has already been consumed by the time we attempt to broadcast, suggesting a race condition or stale data from the dry-run phase.

Error message:

Error checking transaction input objects: Object ID 0xed36d4227c1d487c0238c88ebd4e3a7ea296784ecdc90f6f8375944896c46bae Version 0x2b2953b5 Digest 7dhXPbpipJaBdddmCHmoGHQoH6Q3rpcpLSTfEuQqGG2u is not available for consumption, current version: 0x2b296f31

This is happening in SuiChainAdapter.ts:423 during executeTransactionBlock. Retrying the transaction typically works, which suggests the issue is timing-related rather than a fundamental problem with the transaction itself.

References and additional details

Code locations:

  • Error occurs in SuiChainAdapter.ts:423 during broadcastTransaction
  • Call stack shows flow from useTradeExecution.tsx:586tradeExecution.ts:642TradeExecution.execSuiTransaction

Related Jam session: (see towards end)
https://jam.dev/c/c06d62bd-631b-4025-bd1b-c2a12faf0324

Reproduction:

  • Occurs intermittently when executing SUI swaps
  • More likely to happen during high network activity or when there's a delay between dry-run and broadcast
  • Retrying the transaction usually succeeds

Hypothesis:
The issue appears to be related to the timing between when we perform dry-run simulations and when we actually broadcast the transaction. The object version changes between these two operations, causing the broadcast to fail.

Potential solutions to investigate:

  1. Implement retry logic with exponential backoff for this specific error type
  2. Throttle or debounce dry-run calls to reduce the likelihood of version drift
  3. Refresh the transaction build immediately before broadcasting if a certain time threshold has passed since the dry-run
  4. Investigate if we can detect version changes and automatically rebuild the transaction with fresh object references

Acceptance Criteria

  • Find root cause
  • Fix it
  • ???
  • PROFIT

Need By Date

Not specified - QA/release blocker

Estimated effort

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions