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

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

Closed
yangby-cryptape opened this issue Nov 22, 2023 · 0 comments · Fixed by #1601
Closed

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

yangby-cryptape opened this issue Nov 22, 2023 · 0 comments · Fixed by #1601
Assignees
Labels
t:bug Something isn't working

Comments

@yangby-cryptape
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants