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

Getting error "EIP-3855 is not supported in one or more of the RPCs used" #7867

Closed
2 tasks done
wuzhong-papermoon opened this issue May 6, 2024 · 1 comment · Fixed by alloy-rs/alloy#694
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@wuzhong-papermoon
Copy link

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (ba399ae 2024-04-30T13:37:57.271979000Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

The issue arises when using the Foundry toolchain and running the forge script command on Moonbeam. The system returns an "EIP-3855 is not supported in one or more of the RPCs used" error.

This issue is related to fee estimation for EIP-1559. Foundry uses the eth_feeHistory method to calculate the gas fee, and it sends the following request:
{"method":"eth_feeHistory","params":[10,"latest",[20.0]],"id":1,"jsonrpc":"2.0"}

While this works fine with Ethereum nodes, on a Moonbeam node, it returns the following error:

"code": -32602,
"message": "Invalid params",
"data": "invalid type: integer `10`, expected a (both 0x-prefixed or not) hex string or byte array containing between (0; 32] bytes at line 2 column 10"

Essentially, Foundry expects the node to accept an integer as an argument, but Moonbeam (and some other chains) does not. The issue is not specific to Moonbeam alone.
To reproduce the issue, you can try the following curl commands:

curl https://rpc.api.moonbase.moonbeam.network/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_feeHistory","params":[10,"latest",[20.0]],"id":1,"jsonrpc":"2.0"}'
bash

curl https://ethereum-sepolia-rpc.publicnode.com/ \
-X POST \
-H "Content-Type: application/json" \
--data '{"method":"eth_feeHistory","params":[10,"latest",[20.0]],"id":1,"jsonrpc":"2.0"}'

A quick fix for this issue is to add the --legacy flag when running the forge script command with Foundry. This will disable the use of eth_feeHistory and instead use the legacy fee estimation method, which should work with both Ethereum and Moonbeam nodes.
But according to Ethereum's API doc, the first parameter should be a hex string instead of a integer.

Would you consider fixing it please?

@mattsse
Copy link
Member

mattsse commented May 6, 2024

thanks for flagging, this is a client bug

mattsse added a commit to paradigmxyz/revm-inspectors that referenced this issue May 6, 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

Successfully merging a pull request may close this issue.

2 participants