optimism
optimism copied to clipboard
Several blocks with the same tx
Describe the bug
While calling eth_getBlockByNumber
on several block numbers, the response shows that the same transaction appears in several blocks
To Reproduce
- getBlockByNumber on the block 985:
curl -X POST --data '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x3d9", false], "id": 1}' -H "Content-Type: application/json" https://mainnet.optimism.io
returns: "transactions":["0x9ed8f713b2cc6439657db52dcd2fdb9cc944915428f3c6e2a7703e242b259cb9"]
- getBlockByNumber on the block 19022:
curl -X POST --data '{"jsonrpc": "2.0", "method": "eth_getBlockByNumber", "params": ["0x4a4e", false], "id": 1}' -H "Content-Type: application/json" https://mainnet.optimism.io
shows the same transactions
value
3.
Expected behavior A transaction with a given hash can only appear in 1 block
This was the result of a bug within the whitelisting logic. Specifically, if a user attempted to create a smart contract but wasn't whitelisted then the transaction would be executed but the user's nonce would not be incremented. If the user tried to deploy the same contract again, then the nonce would be the same and therefore the transaction hash would also be the same. You can confirm that this is the case by looking at Etherscan.
Are you being impacted by this bug? If this is somehow impacting client-side tooling, we may want to consider our options to remedy this issue after the fact.
The database indexes transactions by hash, so only the latest transaction with the matching hash will be accessible via "get transaction by hash".
Hey @smartcontracts , I can see this has the P-wontfix label, so does this mean the whitelisting bug hasn't been fixed and won't be fixed? In other words, can we still have duplicated transactions in different blocks in the future?
Bedrock fixes this issue, won't happen again