Skip to content

The filed chainId is required, but eth_estimateGas rejects it. #1583

@chaoticlonghair

Description

@chaoticlonghair

Description

The filed chainId is required for latest transactions:

For JSON-RPC method eth_estimateGas:

  • Ethereum will accept this field. (ref: Ethereum JSON-RPC Specification)

  • But Axon won't.

    When a request contains chainId, Axon will throw an error.

    #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)]
    #[serde(deny_unknown_fields, rename_all = "camelCase")]
    pub struct Web3CallRequest {
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub transaction_type: Option<U64>,
    pub from: Option<H160>,
    pub to: Option<H160>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gas_price: Option<U256>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_fee_per_gas: Option<U256>,
    pub gas: Option<U256>,
    pub value: Option<U256>,
    pub data: Option<Hex>,
    pub nonce: Option<U256>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub access_list: Option<AccessList>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_priority_fee_per_gas: Option<U256>,
    }

In Further

  • Other fields in JSON-RPC methods required to be checked, too.

  • In fact, hardhat (ethers.js) always sends this field when call eth_estimateGas.

    Why does it found until now?
    Because, all tests call this method manually.

    For examples: THIS.

Metadata

Metadata

Labels

t:bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions