You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running an erigon node (erigon version 2022.99.99-dev-8c27879a), and I'm using the python web3 library to get data about mempool transactions.
The command: tx_pool = w3.geth.txpool.content()
gets me a list of transactions in the mempool. Now, I would like to get the amount of gas required by each transaction in the mempool (not the gas limit).
One way to get the gas used, is to wait for the transaction to be mined, and call get_transaction_receipt
But there should be a way to get (or calculate) the amount of gas used by a transaction before it's actually included in a block.
I've tried calling get_raw_transaction, and surprisingly (to me), Erigon returns TransactionNotFound for the majority of transactions in the mempool.
Question 1) Why does Erigon provide a transaction hash when I call tx.pool.content(), but then say the transaction is not found when I call get_raw_transaction()? (It's worth noting that get_raw_transaction() does not always fail, sometimes it gets the raw transaction data, but I can't figure out why it does for some transactions and not others.
I've also tried calling get_transaction for the transactions in the mempool, and although the web3 documentation says that this will return TransactionNotFound for transactions that have not yet been mined, I find that Erigon is willing to return transaction details for a majority of transactions (85%) in the mempool (that have not yet been mined). Another odd phenomenon is that usually exactly one of get_transaction() and get_raw_transaction() will return TransactionNotFound.
Question 2) Why would get_transaction() return TransactionNotFound while get_raw_transaction() succeeds (or vice-versa)? The documentation suggests that get_transaction() will only worked for mined transactions, but that does not seem to be the case, and in fact, get_transaction() succeeds much more frequently than get_raw_transaction()
The main question though is:
Question 3) How can I get (an estimate) of gas used for transactions in the mempool?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm running an erigon node (erigon version 2022.99.99-dev-8c27879a), and I'm using the python web3 library to get data about mempool transactions.
The command:
tx_pool = w3.geth.txpool.content()
gets me a list of transactions in the mempool. Now, I would like to get the amount of gas required by each transaction in the mempool (not the gas limit).
There is a field called "gas," and Quicknode says this is the gas used, but I'm pretty sure it's the gas limit, not the gas used.
One way to get the gas used, is to wait for the transaction to be mined, and call get_transaction_receipt
But there should be a way to get (or calculate) the amount of gas used by a transaction before it's actually included in a block.
I've tried calling get_raw_transaction, and surprisingly (to me), Erigon returns TransactionNotFound for the majority of transactions in the mempool.
Question 1) Why does Erigon provide a transaction hash when I call tx.pool.content(), but then say the transaction is not found when I call get_raw_transaction()? (It's worth noting that get_raw_transaction() does not always fail, sometimes it gets the raw transaction data, but I can't figure out why it does for some transactions and not others.
I've also tried calling get_transaction for the transactions in the mempool, and although the web3 documentation says that this will return TransactionNotFound for transactions that have not yet been mined, I find that Erigon is willing to return transaction details for a majority of transactions (85%) in the mempool (that have not yet been mined). Another odd phenomenon is that usually exactly one of get_transaction() and get_raw_transaction() will return TransactionNotFound.
Question 2) Why would get_transaction() return TransactionNotFound while get_raw_transaction() succeeds (or vice-versa)? The documentation suggests that get_transaction() will only worked for mined transactions, but that does not seem to be the case, and in fact, get_transaction() succeeds much more frequently than get_raw_transaction()
The main question though is:
Question 3) How can I get (an estimate) of gas used for transactions in the mempool?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions