System information
Geth version: 0.2.14-tmp-span-hotfix
OS & Version: Ubuntu Server 20.04
Expected behaviour
Block no. + transaction index combo should work similarly with eth_getTransactionByBlockNumberAndIndex as the corresponding tx_hash does with eth_getTransaction
Actual behaviour
eth_getTransactionByBlockNumberAndIndex would return None for State sync txns (per polygonscan) while eth_getTransaction works perfectly and returns transactions details
Steps to reproduce the behaviour
Using a self-hosted archival node's rpc, but is reproducible with my_node_url = 'https://polygon-rpc.com/' too
In [18]: from web3 import Web3, HTTPProvider
In [19]: w3 = Web3(HTTPProvider(my_node_url))
In [20]: by_hash = w3.eth.getTransaction('0x5053e6008f1ac02397f9dfb5e2a2e6db5187765fbbf730f4cfc22fca1866139d')
In [22]: by_hash.blockNumber
Out[22]: 26809088
In [23]: by_hash.transactionIndex
Out[23]: 154
In [24]: by_index = w3.eth.get_transaction_by_block(by_hash.blockNumber, by_hash.transactionIndex)
---------------------------------------------------------------------------
TransactionNotFound Traceback (most recent call last)
<ipython-input-24-011f9a77334a> in <module>
----> 1 by_index = w3.eth.get_transaction_by_block(by_hash.blockNumber, by_hash.transactionIndex)
...
/usr/local/lib/python3.8/dist-packages/web3/_utils/method_formatters.py in raise_transaction_not_found_with_index(params)
608 block_identifier = params[0]
609 transaction_index = to_integer_if_hex(params[1])
--> 610 raise TransactionNotFound(
611 f"Transaction index: {transaction_index} "
612 f"on block id: {block_identifier} not found."
TransactionNotFound: Transaction index: 154 on block id: 0x1991300 not found.
System information
Geth version:
0.2.14-tmp-span-hotfixOS & Version: Ubuntu Server 20.04
Expected behaviour
Block no. + transaction indexcombo should work similarly witheth_getTransactionByBlockNumberAndIndexas the correspondingtx_hashdoes witheth_getTransactionActual behaviour
eth_getTransactionByBlockNumberAndIndexwould returnNonefor State sync txns (per polygonscan) whileeth_getTransactionworks perfectly and returns transactions detailsSteps to reproduce the behaviour
Using a self-hosted archival node's rpc, but is reproducible with
my_node_url = 'https://polygon-rpc.com/'too