Skip to content

MPC Sign Transaction Timeouts #1448

Open
@bh2smith

Description

Prerequisites

  • I'm using the latest version of near-api-js.
  • I have tried to start with a fresh project and reproduce the defect with minimal code changes.
  • I have read the console error messages carefully (if applicable).

Description

the providers package has a hard-coded backoff/retry configuration that times out at 11.33 seconds:

const BACKOFF_MULTIPLIER = 1.5;
const RETRY_NUMBER = 10;

These sign transactions on v1.signer are taking approximately 12 blocks to confirm. Example Tx:

https://nearblocks.io/txns/F683A1dLFZYbqRbNjEuNpQTA9gKFVfHVkgUfyeYuhnrx#execution

Results in errors like this:

.../near-ca/node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:47
            throw new ProviderError(await res.text(), { cause: status });
                  ^

ProviderError: {"jsonrpc":"2.0","error":{"name":"HANDLER_ERROR","cause":{"name":"TIMEOUT_ERROR"},"code":-32000,"message":"Server error","data":"Timeout"},"id":127}
    at BackOff.request (.../near-ca/node_modules/@near-js/providers/lib/commonjs/fetch_json.cjs:47:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  cause: undefined,
  context: ErrorContext {
    transactionHash: 'GSVoBzcfcW6aaSwQmzp45pSZ6h3gJbjLUtPDaecfnX1T'
  }
}

Reproducible demo

https://github.com/Mintbase/near-ca

Steps to reproduce

  1. Set Appropriate env vars
  2. Run npx tsx examples/send-eth.ts
  3. Watch for timeout.

Expected behavior

Not a timeout

Actual behavior

always a timeout.

Your environment

  • NEAR JavaScript API version used: latest

Self-service

  • I'd be willing to fix this bug myself.

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    • Status

      NEW❗

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions