foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Home Page:https://getfoundry.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

forge create error on deployment to Moonbeam

0xDmtri opened this issue · comments

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 (3279814 2022-12-10T14:50:48.835759Z)

What command(s) is the bug in?

forge create

Operating System

macOS (Apple Silicon)

Describe the bug

When trying to deploy on Moonbeam with forge create --rpc-url $RPC --private-key $KEY src/contracts/Fetcheur.sol:Fetcheur --via-ir

Getting the following error:

P.S. Compilation is successful, tests work as expected, everything normal etc.

Error: 
Deserialization Error: invalid type: null, expected f64 at line 1 column 229. Response: {"oldestBlock":"0x25e796","baseFeePerGas":["0x174876e800","0x174876e800","0x174876e800","0x174876e800","0x174876e800","0x174876e800","0x174876e800","0x174876e800","0x174876e800","0x174876e800","0x174876e800"],"gasUsedRatio":[null,null,null,null,null,null,null,null,null,null],"reward":[["0x59682f00"],["0x0"],["0x0"],["0x59682f00"],["0x59682f00"],["0x59682f00"],["0x59682f00"],["0x0"],["0x59682f00"],["0x59682f00"]]}

hmm looks like your RPC provider returns gasUsedRatio items as null for the eth_feeHistory call, but they should be floats.

I don't think they should be null.

hmm looks like your RPC provider returns gasUsedRatio items as null for the eth_feeHistory call, but they should be floats.

I don't think they should be null.

Yeah, tried different RPC endpoints, still same error

Can confirm that the same RPC worked with Remix for deployment.

okay we probably should just treat null as 0?

gonna fix that and make a pull later this week

could be fixed with a deserialize_with function for the ratio array in the feeHistory type I think

could be fixed with a deserialize_with function for the ratio array in the feeHistory type I think

After some testing and researching I found out that this is a specific issue for Frontier users according to this PR: paritytech/frontier#898

@mattsse @0xDmtri was there a follow up PR for this issue?

@mattsse @0xDmtri was there a follow up PR for this issue?

i think until Monnbeam fixes on their side, we can't do much