Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transactions with large calldata throw an 'already known' error on Linea Goerli despite succeeding on-chain #4533

Open
sam-goldman opened this issue Jan 8, 2024 · 0 comments
Assignees
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6

Comments

@sam-goldman
Copy link

sam-goldman commented Jan 8, 2024

Ethers Version

6.9.2

Search Terms

provider; 'already known'

Describe the Problem

Steps to Reproduce

To reproduce this bug, you'll need a private key with some funds on Linea Goerli. Here's their faucet.

  1. Create a new file TypeScript file, e.g. linea-bug.ts.
  2. Copy and paste the following into your file. Make sure to add your private key to the privateKey variable.
import { ethers } from 'ethers'

const privateKey = '' // Add private key
if (!privateKey) {
  throw new Error(`No private key found`)
}

;(async () => {
  const provider = new ethers.JsonRpcProvider('https://rpc.goerli.linea.build')
  const signer = new ethers.Wallet(privateKey, provider)
  const response = await signer.sendTransaction({
    to: ethers.ZeroAddress,
    data: '0x' + '11'.repeat(11300),
  })
  await response.wait()
})()
  1. Run the file, replacing <path/to/file.ts> with your file path:
npx ts-node <path/to.file.ts>

Expected Result

No error should be thrown by Ethers.

Actual Result

The transaction succeeds on-chain, but an error is thrown by Ethers:

Error: could not coalesce error (error={ "code": -32000, "message": "already known" }, payload={ "id": 10, "jsonrpc": "2.0", "method": "eth_sendRawTransaction", "params": [ "0x02f92c9382e7043d8" ] }, code=UNKNOWN_ERROR, version=6.9.2)
    at makeError (/Users/samgoldman/dev/sphinx/packages/plugins/node_modules/ethers/src.ts/utils/errors.ts:694:21)
    at JsonRpcProvider.getRpcError (/Users/samgoldman/dev/sphinx/packages/plugins/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:1049:25)
    at /Users/samgoldman/dev/sphinx/packages/plugins/node_modules/ethers/src.ts/providers/provider-jsonrpc.ts:563:45
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'UNKNOWN_ERROR',
  error: { code: -32000, message: 'already known' },
  payload: {
    method: 'eth_sendRawTransaction',
    params: '0x02f92c9382e7043d8423c346008423c3460e8303144894000000000000000000000000000000000000000080b92c2411111111111'... 12832 more characters
    ],
    id: 10,
    jsonrpc: '2.0'
  },
  shortMessage: 'could not coalesce error'
}

Notes

  • The error occurs ~75% of the time. You may need to run the command a few times to hit the error.
  • This bug occurred with the public RPC URL in the example as well as a paid Infura API key.

Environment

node.js (v12 or newer)

@sam-goldman sam-goldman added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants