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 transaction parameter 'to' should be optional in the 'eth_call' API #3173

Closed
fab-10 opened this issue Dec 14, 2021 · 2 comments · Fixed by #3177
Closed

The transaction parameter 'to' should be optional in the 'eth_call' API #3173

fab-10 opened this issue Dec 14, 2021 · 2 comments · Fixed by #3177
Assignees

Comments

@fab-10
Copy link
Contributor

fab-10 commented Dec 14, 2021

Description

Invoking eth_call API with a transaction that deploys a contract like the following one:

{
    "jsonrpc": "2.0",
    "id": 19094,
    "method": "eth_call",
    "params": [
        {
            "from": "0x526b916518B0fAeC791250a32f54089F0584c61b",
            "data": "0x608060405234801561001057600080fd5b5060cc8061001f6000396000f3fe6080604052348015600f57600080fd5b506004361060285760003560e01c8063010ba4e214602d575b600080fd5b60336047565b604051603e91906073565b60405180910390f35b60003373ffffffffffffffffffffffffffffffffffffffff1631905090565b606d81608c565b82525050565b6000602082019050608660008301846066565b92915050565b600081905091905056fea264697066735822122094118d4cbfbe566284bc1e8a7bd8732d0feb365178e621d2fe7e141aba4ce16e64736f6c63430008070033",
            "value": "0x0",
            "gas": "0x131200",
            "maxFeePerGas": "0x10000000",
            "maxPriorityFeePerGas": "0x10000000"
        },
        "latest"
    ]
}

returns 400 with Invalid params error, and the log says Missing "to" field in call arguments, while according to the spec the to parameter is optional.

Acceptance Criteria

  • eth_call accepts requests without the optional to parameter according to the spec

Steps to Reproduce (Bug)

  1. POST the above JSON RPC call to the Besu RPC endpoint
@julien-marchand
Copy link

For context, this is a pain point when deploying using Truffle as Truffle omits to when deploying a smart-contract.

@fab-10
Copy link
Contributor Author

fab-10 commented Dec 21, 2021

The to field is now correctly optional, so it is possible to use eth_call to simulate contract creation

@fab-10 fab-10 closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants