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

🐛 [BUG] - eth_estimateGas fails systematically #1826

Open
victhorbi opened this issue Feb 17, 2025 · 1 comment · May be fixed by #1837
Open

🐛 [BUG] - eth_estimateGas fails systematically #1826

victhorbi opened this issue Feb 17, 2025 · 1 comment · May be fixed by #1837

Comments

@victhorbi
Copy link
Collaborator

victhorbi commented Feb 17, 2025

Description

EstimateGas fails, returns an error instead.

The request can be made if gas and gasPrice are included (they are supposed to be optional). While Block should be passed.

Reproduction URL

No response

Reproduction steps

1. Launch rpc-proxy locally
2. send curl

curl --location 'http://127.0.0.1:8545/ethv1' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc":"2.0",
    "method":"eth_estimateGas",
    "params":[{
        "from":  "0xff0f343772ae053f6ddb2885ea9df1d301e222f6",
        "to":    "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",
        "value": "0x10"
    }],
    "id":1
}'

3. See error

Screenshots

![Image](https://github.com/user-attachments/assets/a306b564-e7ee-45c5-922f-558c36b076cf)``

Logs

****************** ERROR ON: eth_estimateGas ******************
- Error message: 'Error on request - eth_estimateGas'
- Error data:
{
  code: -32603,
  message: 'Error on request - eth_estimateGas',
  data: {
    requestBody: {
      jsonrpc: '2.0',
      method: 'eth_estimateGas',
      params: [
        {
          from: '0xff0f343772ae053f6ddb2885ea9df1d301e222f6',
          to: '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
          value: '0x10'
        },
        [length]: 1
      ],
      id: 1
    }
  }
}
- Internal error:
G [Error]: Method 'eth_estimateGas()' failed.
-Reason: 'Method "eth_estimateGas" failed.'
-Parameters: 
	{
  "code": -32603,
  "message": "Method \"eth_estimateGas\" failed.",
  "data": {
    "params": "[\n  {\n    \"from\": \"0xff0f343772ae053f6ddb2885ea9df1d301e222f6\",\n    \"to\": \"0xd3CdA913deB6f67967B99D67aCDFa1712C293601\",\n    \"value\": \"0x10\"\n  }\n]",
    "url": "https://testnet.vechain.org",
    "innerError": "{\n  \"methodName\": \"HttpClient.http()\",\n  \"errorMessage\": \"HTTP 400 Bad Request\",\n  \"data\": {\n    \"method\": \"POST\",\n    \"url\": \"https://testnet.vechain.orgaccounts/*\"\n  },\n  \"innerError\": {}\n}"
  }
}
    at ht (/Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-network/dist/index.js:31:23760)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.eth_estimateGas (/Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-network/dist/index.js:31:42434)
    at async H.request (/Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-network/dist/index.js:31:46188)
    at async /Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-rpc-proxy/dist/index.js:21:13935 {
  [stack]: "Error: Method 'eth_estimateGas()' failed.\n" +
    `-Reason: 'Method "eth_estimateGas" failed.'\n` +
    '-Parameters: \n' +
    '\t{\n' +
    '  "code": -32603,\n' +
    '  "message": "Method \\"eth_estimateGas\\" failed.",\n' +
    '  "data": {\n' +
    '    "params": "[\\n  {\\n    \\"from\\": \\"0xff0f343772ae053f6ddb2885ea9df1d301e222f6\\",\\n    \\"to\\": \\"0xd3CdA913deB6f67967B99D67aCDFa1712C293601\\",\\n    \\"value\\": \\"0x10\\"\\n  }\\n]",\n' +
    '    "url": "https://testnet.vechain.org",\n' +
    '    "innerError": "{\\n  \\"methodName\\": \\"HttpClient.http()\\",\\n  \\"errorMessage\\": \\"HTTP 400 Bad Request\\",\\n  \\"data\\": {\\n    \\"method\\": \\"POST\\",\\n    \\"url\\": \\"https://testnet.vechain.orgaccounts/*\\"\\n  },\\n  \\"innerError\\": {}\\n}"\n' +
    '  }\n' +
    '}\n' +
    '    at ht (/Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-network/dist/index.js:31:23760)\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
    '    at async Object.eth_estimateGas (/Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-network/dist/index.js:31:42434)\n' +
    '    at async H.request (/Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-network/dist/index.js:31:46188)\n' +
    '    at async /Users/victorbibiano/.npm/_npx/1f218996814cd7dd/node_modules/@vechain/sdk-rpc-proxy/dist/index.js:21:13935',
  [message]: "Method 'eth_estimateGas()' failed.\n" +
    `-Reason: 'Method "eth_estimateGas" failed.'\n` +
    '-Parameters: \n' +
    '\t{\n' +
    '  "code": -32603,\n' +
    '  "message": "Method \\"eth_estimateGas\\" failed.",\n' +
    '  "data": {\n' +
    '    "params": "[\\n  {\\n    \\"from\\": \\"0xff0f343772ae053f6ddb2885ea9df1d301e222f6\\",\\n    \\"to\\": \\"0xd3CdA913deB6f67967B99D67aCDFa1712C293601\\",\\n    \\"value\\": \\"0x10\\"\\n  }\\n]",\n' +
    '    "url": "https://testnet.vechain.org",\n' +
    '    "innerError": "{\\n  \\"methodName\\": \\"HttpClient.http()\\",\\n  \\"errorMessage\\": \\"HTTP 400 Bad Request\\",\\n  \\"data\\": {\\n    \\"method\\": \\"POST\\",\\n    \\"url\\": \\"https://testnet.vechain.orgaccounts/*\\"\\n  },\\n  \\"innerError\\": {}\\n}"\n' +
    '  }\n' +
    '}',
  methodName: 'eth_estimateGas()',
  errorMessage: 'Method "eth_estimateGas" failed.',
  data: {
    code: -32603,
    message: 'Method "eth_estimateGas" failed.',
    data: {
      params: '[\n' +
        '  {\n' +
        '    "from": "0xff0f343772ae053f6ddb2885ea9df1d301e222f6",\n' +
        '    "to": "0xd3CdA913deB6f67967B99D67aCDFa1712C293601",\n' +
        '    "value": "0x10"\n' +
        '  }\n' +
        ']',
      url: 'https://testnet.vechain.org',
      innerError: '{\n' +
        '  "methodName": "HttpClient.http()",\n' +
        '  "errorMessage": "HTTP 400 Bad Request",\n' +
        '  "data": {\n' +
        '    "method": "POST",\n' +
        '    "url": "https://testnet.vechain.orgaccounts/*"\n' +
        '  },\n' +
        '  "innerError": {}\n' +
        '}'
    }
  },
  innerError: undefined
}

OS

Mac

@victhorbi victhorbi added this to the 2.0.0-beta (Pre-Release) milestone Feb 17, 2025
@victhorbi victhorbi changed the title 🐛 [BUG] - <title> 🐛 [BUG] - eth_estimateGas fails systematically Feb 17, 2025
@claytonneal claytonneal self-assigned this Feb 18, 2025
@claytonneal
Copy link
Member

i'll take a look - it should fail quickier as ur missing the "default block" parameter

This was referenced Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants