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

Anvil produces incorrect error message for certain eth_subscribe::newPendingTransaction calls #9757

Open
2 tasks done
scaraven opened this issue Jan 26, 2025 · 1 comment
Open
2 tasks done
Labels
A-reth-anvil Area: reth-anvil T-bug Type: bug

Comments

@scaraven
Copy link

Component

Anvil

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

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. 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.

@scaraven scaraven added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Jan 26, 2025
@github-project-automation github-project-automation bot moved this to Todo in Foundry Jan 26, 2025
@Maliksb11
Copy link

ok

@zerosnacks zerosnacks added A-reth-anvil Area: reth-anvil and removed T-needs-triage Type: this issue needs to be labelled labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-reth-anvil Area: reth-anvil T-bug Type: bug
Projects
Status: Todo
Development

No branches or pull requests

3 participants