Skip to content

eth_call go-ethereum incompatibilities #13160

Open
@rvagg

Description

@rvagg

We support a 2 parameter version of eth_call, see here:

lotus/node/impl/eth/gas.go

Lines 240 to 241 in 58c1ed8

func (e *ethGas) EthCall(ctx context.Context, tx ethtypes.EthCall, blkParam ethtypes.EthBlockNumberOrHash) (ethtypes.EthBytes, error) {
msg, err := tx.ToFilecoinMessage()

Essentially: eth_call(txn, block)

But there's a third argument called "state overrides" that lets you adjust the state prior to the call. This is widely documented, e.g. https://www.quicknode.com/docs/ethereum/eth_call, and I noticed from using cast call that it's failing because it tries to present this third argument.

There's also now, since the last couple of years, a fourth argument you can supply (I believe these two additional arguments are optional) that lets you override even more about the execution point, but this is block focused, like gas. This doesn't seem to be as well documented and I'm not sure Erigon supports this.

https://github.com/ethereum/go-ethereum/blob/35dd84ce2999ecf5ca8ace50a4d1a6abc231c370/internal/ethapi/api.go#L757C58-L757C73

I imagine it would be very difficult to support even some of those "state override" options in our version, but I wonder if we shouldn't at least accept the parameter as optional and error when it tries to supply things we can't do. Then if you're showing up with a {} as a third argument it would be fine. I'm not sure what cast call is trying to do, it might be nontrivial but it would be worth investigating to find what the common path is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📌 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions