filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.83k stars 1.25k forks source link

fevm: EthTx serialization does not match openrpc spec #10106

Closed iand closed 1 year ago

iand commented 1 year ago

Checklist

Lotus component

Lotus Version

releases/v1.20.0

Describe the Bug

The openrpc conformance tests fail when checking the schema of Ethereum transactions returned from the eth json-rpc api.

    eth_conformance_test.go:306: - transactions: Must validate at least one schema (anyOf)
    eth_conformance_test.go:306: - transactions.0: Must validate one and only one schema (oneOf)
    eth_conformance_test.go:306: - transactions.0: accessList is required
    eth_conformance_test.go:306: - transactions.0: yParity is required

Affected methods:

The openrpc specification used was obtained by building https://github.com/ethereum/execution-apis/tree/b7c5d3420e00648f456744d121ffbd929862924d

With regards to the missing fields on Transactions the openrpc spec gives 3 possible response types:

Signed 1559 Transaction: Lotus is missing accessList, yParity Signed 2930 Transaction: Lotus is missing accessList, gasPrice, yParity Signed Legacy Transaction: Lotus is missing gasPrice

See https://www.jsonschemavalidator.net/s/euWIlkpO

Lotus should either add the missing fields (and populate or leave as default) or document the differences

Logging Information

None

Repo Steps

Check out https://github.com/filecoin-project/lotus/pull/10102 and run following in itests folder:

go test -v -run ^TestEthOpenRPCConformance$/eth_getTransactionByHash
iand commented 1 year ago

This is now the only issue remaining before https://github.com/filecoin-project/lotus/pull/10102 passes and we have fully conformant ethereum JSON-RPC methods