Skip to content

Bug: Transactions stuck in PENDING state indefinitely when gas estimation fails #52

@Abhishekkochar

Description

@Abhishekkochar

Description

When a transaction fails gas estimation (e.g., would revert onchain), rrelayer does not mark it as FAILED. Instead, the transaction remains
in PENDING status and the pending queue worker retries indefinitely, causing an infinite retry loop.

Steps to Reproduce

  1. Submit a transaction via rrelayer API that would revert onchain (e.g., to a non-existent contract address)
  2. Transaction is queued with status PENDING
  3. rrelayer's background worker attempts to send the transaction
  4. Gas estimation fails with error: Gas calculation error
  5. Transaction remains PENDING instead of being marked FAILED
  6. Worker continuously retries every few seconds

Expected Behavior

  • Transactions that fail gas estimation should be marked as FAILED after N retry attempts
  • Failed transactions should not be retried indefinitely
  • Error should be surfaced to the API caller

Actual Behavior

  • Transaction stays PENDING forever
  • Logs show continuous retry attempts:
    INFO Preparing to send transaction for relayer with speed FAST
    ERROR PENDING QUEUE ERROR: Send transaction error: Gas calculation error
    INFO Preparing to send transaction for relayer with speed FAST
    ERROR PENDING QUEUE ERROR: Send transaction error: Gas calculation error
  • Restarting rrelayer doesn't help (transactions are persisted in PostgreSQL)
  • Only workaround is to manually delete pending transactions or reset database

Logs

INFO Sending transaction Transaction { id: TransactionId(...), status: PENDING, ... }
INFO Computing gas price for transaction with speed FAST
ERROR PENDING QUEUE ERROR: Send transaction error: Gas calculation error

After N attempt, transaction should fail, and set to Failed state. This might not be a big deal, however since we are using Turnkey, this adds up to a bit. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions