Open
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:
near-api-js/packages/providers/src/fetch_json.ts
Lines 5 to 6 in c49fd67
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
- Set Appropriate env vars
- Run
npx tsx examples/send-eth.ts
- 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
Labels
Type
Projects
Status
NEW❗