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

jsonRpcProvider.send() does not accept blockOverrides parameter according to spec #4804

Open
zhongeric opened this issue Aug 8, 2024 · 0 comments
Assignees
Labels
investigate Under investigation and may be a bug. v5 Issues regarding legacy-v5

Comments

@zhongeric
Copy link

zhongeric commented Aug 8, 2024

Ethers Version

5.7.0

Search Terms

No response

Describe the Problem

According to https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-eth#eth-call, the eth_call JsonRpc method supports up to 4 parameters, the transaction object, blockTag, stateOverrides list, and finally, the blockOverrides list.

However when I try to pass in blockOverrides, the call fails with InvalidArgumentsError: Expected between 1 and 3 arguments and got 4. For context, I'm trying to make a multicall with a block override for a future block.

Is this supported in ethers v5.x.x? Or do I have to upgrade to v6? Is there an "unchecked" way to make json rpc calls? Thank you!

Code Snippet

let stateOverrides = {};
    let blockOverrides = {};
    response =  await provider.send("eth_call", [
      {
        from: ethers.constants.AddressZero,
        to: multicall.address,
        data: multicall.interface.encodeFunctionData("tryAggregate", [false, calls]),
      },
      'latest',
      stateOverrides,
      blockOverrides
    ])


### Contract ABI

_No response_

### Errors

```shell
1) OrderValidator
       quotes a valid order:
     InvalidArgumentsError: Expected between 1 and 3 arguments and got 4
      at validateParams (/Users/eric.zhong/uniswap/sdks/node_modules/hardhat/src/internal/core/jsonrpc/types/input/validation.ts:51:13)
      at EthModule._callParams (/Users/eric.zhong/uniswap/sdks/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:336:26)
      at EthModule.processRequest (/Users/eric.zhong/uniswap/sdks/node_modules/hardhat/src/internal/hardhat-network/provider/modules/eth.ts:116:41)
      at HardhatNetworkProvider._send (/Users/eric.zhong/uniswap/sdks/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:201:31)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async HardhatNetworkProvider.request (/Users/eric.zhong/uniswap/sdks/node_modules/hardhat/src/internal/hardhat-network/provider/provider.ts:124:18)
      at async EthersProviderWrapper.send (/Users/eric.zhong/uniswap/sdks/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)

Environment

Ethereum (mainnet/ropsten/rinkeby/goerli), node.js (v12 or newer), Hardhat

Environment (Other)

No response

@zhongeric zhongeric added investigate Under investigation and may be a bug. v5 Issues regarding legacy-v5 labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v5 Issues regarding legacy-v5
Projects
None yet
Development

No branches or pull requests

2 participants