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

cast send returns server returned an error response: error code -32602: too many arguments, want at most 1 #8122

Closed
2 tasks done
fredo opened this issue Jun 10, 2024 · 8 comments
Labels
T-bug Type: bug

Comments

@fredo
Copy link

fredo commented Jun 10, 2024

Component

Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (6179312 2024-06-10T00:18:46.177980000Z)

What command(s) is the bug in?

cast send

Operating System

macOS (Apple Silicon)

Describe the bug

I'm trying to send a simple transfer with the following command

cast s --private-key <<PRIV_KEY>> --rpc-url https://rpc.chiado.gnosis.gateway.fm --value 0.1ether <<ADDRESS>> "0x"

I also tried

cast s --private-key <<PRIV_KEY>> --rpc-url https://rpc.chiado.gnosis.gateway.fm --value 0.1ether <<ADDRESS>>

The server returns

Error:
server returned an error response: error code -32602: too many arguments, want at most 1

It most likely fails on eth_estimateGas, since when I specify --gas-limit it works fine. I also tried connecting to a local RPC where I have access to the logs to and I saw that estimateGas is called multiple times.

I downgraded foundry to find the first release where the error pops up. It's https://github.com/foundry-rs/foundry/releases/tag/nightly-cafc2606a2187a42b236df4aa65f4e8cdfcea970

@fredo fredo added the T-bug Type: bug label Jun 10, 2024
@fredo
Copy link
Author

fredo commented Jun 10, 2024

This seems to be related to Chiado testnet. On gnosis chain and arbitrum it works fine. Will test more networks

@mattsse
Copy link
Member

mattsse commented Jun 10, 2024

could you share the logs RUST_LOG=trace cast...

too many arguments is weird, perhaps it's the state override argthat's not included, so it can only be the BlockId argument, perhaps an issue with chiado?

checking

@fredo
Copy link
Author

fredo commented Jun 10, 2024

log_foundry.txt

@mattsse
Copy link
Member

mattsse commented Jun 10, 2024

we're def sending a valid request:

�{"method":"eth_estimateGas","params":[{"from":"0xc34b4858cf5f89916559fab2f864384d74b2f996","to":"0xc34b4858cf5f89916559fab2f864384d74b2f996","maxFeePerGas":"0xb368f487","maxPriorityFeePerGas":"0xb368f479","value":"0x38d7ea4c68000","input":"0x","chainId":"0x27d8"},"latest"],"id":2,"jsonrpc":"2.0"}

so it looks like the eth_estimateGas endpoint doesn't fully support the spec?

image

cast rpc web3_clientVersion --rpc-url "https://rpc.chiado.gnosis.gateway.fm/"
"erigon/2.60.1/linux-amd64/go1.21.5"

@fredo
Copy link
Author

fredo commented Jun 10, 2024

Thanks for digging into it. I will get in touch with the Erigon team.
So far I can confirm that it only occurred on Erigon clients. However, what bothers me, is that older foundry versions are compatible (as I mentioned April 24 and older)

Edit: I tried with Geth and Nethermind RPCs on Chiado and it always worked. Seems to be related to Erigon.

@yperbasis
Copy link

Erigon v2.60.1 has a breaking change that removes the 2nd argument from eth_estimateGas. See erigontech/erigon#10495

@yperbasis
Copy link

The breaking change was reverted in Erigon v2.60.2.

@mattsse
Copy link
Member

mattsse commented Jun 26, 2024

we also fixed this on the client side and exclude the argument if missing

@mattsse mattsse closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

3 participants