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 am currently using alloy-rs in order to watch pending transactions from an anvil instance (for testing purposes). alloy-rs uses this API Reference for the eth_subscribe::newPendingTransactions RPC call which is implemented in the following code snippet. The subscribe_full_pending_transactions() function tacks on a boolean parameter to request full transaction data rather than just transaction hashes.
Although it explicitly states within alloy-rs' documentation that this call is not supported by all Ethereum APIs, this call returns the following error message when performed on an anvil instance:
error code -32602: Expected params for logs subscription
Which is a misleading error message as we are making a eth_subscribe::newPendingTransactions call rather than eth_subscribe::logs. This error message originates from anvil code here due to the fact that Anvil believes the boolean parameter belongs to a logs call.
Possible Fixes
I am not suggesting that anvil should implement this API, however, it should be relatively straightforward to give a more accurate error message, especially given that certain blockchain libraries do implement eth_subscribe::newPendingTransactions calls with boolean parameters.
The text was updated successfully, but these errors were encountered:
Component
Anvil
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.3.0 (5a8bd89 2024-12-20T08:46:21.555250780Z)
What version of Foundryup are you on?
foundryup: 0.3.3
What command(s) is the bug in?
No response
Operating System
Linux
Describe the bug
Bug
I am currently using alloy-rs in order to watch pending transactions from an anvil instance (for testing purposes). alloy-rs uses this API Reference for the
eth_subscribe::newPendingTransactions
RPC call which is implemented in the following code snippet. Thesubscribe_full_pending_transactions()
function tacks on a boolean parameter to request full transaction data rather than just transaction hashes.Although it explicitly states within alloy-rs' documentation that this call is not supported by all Ethereum APIs, this call returns the following error message when performed on an anvil instance:
Which is a misleading error message as we are making a
eth_subscribe::newPendingTransactions
call rather thaneth_subscribe::logs
. This error message originates from anvil code here due to the fact that Anvil believes the boolean parameter belongs to alogs
call.Possible Fixes
I am not suggesting that anvil should implement this API, however, it should be relatively straightforward to give a more accurate error message, especially given that certain blockchain libraries do implement
eth_subscribe::newPendingTransactions
calls with boolean parameters.The text was updated successfully, but these errors were encountered: