Skip to main content

Module broadcaster

Module broadcaster 

Source
Expand description

Transaction broadcaster for dYdX v4 protocol.

This module handles gRPC transmission of transactions with automatic retry on sequence mismatch errors. It works in conjunction with TransactionManager to provide reliable transaction delivery.

§Retry Logic

Uses the battle-tested [RetryManager] from nautilus-network with exponential backoff. When a transaction fails with “account sequence mismatch” (Cosmos SDK error code 32), the broadcaster:

  1. Resyncs the sequence counter from chain
  2. Rebuilds the transaction with the new sequence
  3. Applies exponential backoff (500ms → 1s → 2s → 4s)
  4. Retries up to 5 times

This handles the case where multiple transactions are submitted in parallel and one succeeds before the other, invalidating the sequence.

Structs§

TxBroadcaster
Transaction broadcaster responsible for gRPC transmission with retry logic.

Constants§

MAX_SEQUENCE_RETRIES
Maximum retries for sequence mismatch errors.

Functions§

create_tx_retry_manager
Creates a retry manager configured for blockchain transaction broadcasting.