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

eth_feeHistory should take float64 for rewardPercentiles to be compatible with developer tooling #1137

Closed
8 of 18 tasks
jaeaster opened this issue Nov 21, 2022 · 0 comments
Closed
8 of 18 tasks
Assignees
Labels

Comments

@jaeaster
Copy link

Checklist

  • This is not a security-related bug/issue. If it is, please follow please follow the security policy.
  • This is not a question or a support request. If you have any lotus related questions, please ask in the lotus forum.
  • This is not a new feature request. If it is, please file a feature request instead.
  • This is not an enhancement request. If it is, please file a improvement suggestion instead.
  • I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
  • I am running the Latest release, or the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
  • I did not make any code changes to lotus.

Lotus component

  • lotus daemon - chain sync
  • lotus miner - mining and block production
  • lotus miner/worker - sealing
  • lotus miner - proving(WindowPoSt)
  • lotus miner/market - storage deal
  • lotus miner/market - retrieval deal
  • lotus miner/market - data transfer
  • lotus client
  • lotus JSON-RPC API
  • lotus message management (mpool)
  • Other

Lotus Version

Lotus version of Glif RPC: https://wallaby.node.glif.io/rpc/v1

Describe the Bug

Trying to deploy smart contracts to Wallaby using Foundry / forge script. Foundry makes an eth_feeHistory call to the RPC, which fails because of a parameter type mismatch between lotus ETH JSON-RPC and Geth, e.g.

Lotus => []int64 rewardPercentiles
Geth =>  []float64 rewardPercentiles

Relevant source code:
Lotus: https://github.com/filecoin-project/lotus/blob/release/fevm-wallaby/node/impl/full/eth.go#L421
Geth: https://github.com/ethereum/go-ethereum/blob/master/ethclient/ethclient.go#L516

Logging Information

# Error from Foundry
Error:
Failed to estimate EIP1559 fees

Context:
- Error #0: Failed fetch EIP1559 fees
- Error filecoin-project/lotus#1: (code: -32700, message: unmarshaling params for 'eth_feeHistory' (param: *[]int64): json: cannot unmarshal number 5.0 into Go value of type int64, data: None)
make: *** [testnet_deploy] Error 1

# Example of correct response from other RPC
# ETH mainnet
const provider = new _ethers.providers.JsonRpcProvider("https://ethereum.publicnode.com")
await provider.send("eth_feeHistory", ["0x1", "latest", [5.0001]])
=> {oldestBlock: '0xf46b7a', reward: Array(1), baseFeePerGas: Array(2), gasUsedRatio: Array(1)}

# Wallaby
const provider = new _ethers.providers.JsonRpcProvider("https://wallaby.node.glif.io/rpc/v1")
await provider.send("eth_feeHistory", ["0x1", "latest", [5.0001]])

=> unmarshaling params for 'eth_feeHistory' (param: *[]int64): json: cannot unmarshal number 5.0001 into Go value of type int64

Repo Steps

How to reproduce:

  1. Install Foundry
  2. Clone this basic repo https://github.com/medusa-network/wallaby-foundry-test-repo
  3. Fund an account with the wallaby faucet and add the private key to a .env file: PRIVATE_KEY="wallaby-private-key"
  4. Run make testnet_deploy, which tries to deploy the SampleContract to wallaby and fails
@raulk raulk transferred this issue from filecoin-project/lotus Nov 21, 2022
@raulk raulk added Topic: Ethereum JSON-RPC Kind: Bug Something isn't working labels Nov 21, 2022
This was referenced Nov 21, 2022
@raulk raulk added this to the M2.1 (r9) Sapphire milestone Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants