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

eth_call errors out when transaction.to is set to null #2334

Closed
quiet-node opened this issue Apr 12, 2024 · 2 comments · Fixed by #2647
Closed

eth_call errors out when transaction.to is set to null #2334

quiet-node opened this issue Apr 12, 2024 · 2 comments · Fixed by #2647
Assignees
Labels
bug Something isn't working
Milestone

Comments

@quiet-node
Copy link
Member

Description

Currently, eth_call will reject requests that have transaction.to set to null. However, it should accept nullable transaction.to in the cases of contract deployment.

Steps to reproduce

  1. Run below cURL request
curl --location 'https://testnet.hashio.io/api' \
--header 'Content-Type: application/json' \
--data '{
    "id": "test_id",
    "jsonrpc": "2.0",
    "method": "eth_call",
        "params": [{
            "from":"0x05fba803be258049a27b820088bab1cad2058871", 
            "to": null,
            "data":"0x60806040"}, "latest"]
}'
  1. Observe the response to see the error like below
{"error":{"code":-32602,"name":"Invalid parameter","message":"[Request ID: b2a2c4cf-1ce4-4a56-bbc3-c25e51c51c53] Invalid parameter 'to' for TransactionObject: Expected 0x prefixed string representing the address (20 bytes), value: null"},"jsonrpc":"2.0","id":"test_id"}

Additional context

No response

Hedera network

mainnet, testnet, previewnet, other

Version

latest

Operating system

None

@quiet-node quiet-node added the bug Something isn't working label Apr 12, 2024
@quiet-node quiet-node self-assigned this Apr 12, 2024
@quiet-node
Copy link
Member Author

Blocking by hashgraph/hedera-mirror-node#8072

@acuarica
Copy link
Contributor

The ArianeLabs team identified a problem when trying to use Brownie with Hedera Testnet. It appears that before executing a transaction, Brownie tries to execute an eth_call with the same params to check if the transaction would cause a revert. When they tried to deploy a smart contract, Hedera responded with "Invalid Contract Address: undefined" for such a call.

cc. @arianejasuwienas

After investigation, we realized this problem is caused by the non-nullable to field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
2 participants