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_estimateGas throws "Expected a positive number and got -13995787", if from parameter is missing in the data #7284

Closed
vbaranov opened this issue Jul 23, 2024 · 0 comments · Fixed by #7312
Assignees

Comments

@vbaranov
Copy link

Description
Requesting eth_estimateGas method from JSON RPC endpoint throws "Expected a positive number and got -13995787", if from parameter is missing in the data. In other hand, if from is added, no such exception arise. I cannot reproduce error throwing with missing from param with other JSON RPC clients.

Steps to Reproduce
In order to replicate the behavior, please provide a detailed list of steps:

Try making this request on ETH Sepolia JSON RPC endpoint:

curl --data '{"jsonrpc":"2.0","id": 0,"method":"eth_estimateGas","params":[{"to": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", "data": "0xd0e30db0", "value": "0x9184e72a"}, "latest"]}' -H "Content-Type: application/json" -X POST http://...

Actual behavior

{"jsonrpc":"2.0","error":{"code":-32602,"message":"Expected a positive number and got -13995787 (Parameter \u0027a\u0027)","data":"System.ArgumentException: Expected a positive number and got -13995787 (Parameter \u0027a\u0027)\n   at Nethermind.Int256.UInt256.op_Explicit(Int64 a)\n   at Nethermind.JsonRpc.Modules.Eth.EthRpcModule.EstimateGasTxExecutor.ExecuteTx(BlockHeader header, Transaction tx, CancellationToken token) in /src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.TransactionExecutor.cs:line 121\n   at Nethermind.JsonRpc.Modules.Eth.EthRpcModule.TxExecutor\u00601.ExecuteTx(TransactionForRpc transactionCall, BlockParameter blockParameter) in /src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.TransactionExecutor.cs:line 69\n   at System.Reflection.MethodInvoker.InvokeImpl(Object obj, Object arg1, Object arg2, Object arg3, Object arg4)\n   at System.Reflection.MethodInvoker.Invoke(Object obj, Span\u00601 arguments)\n   at Nethermind.JsonRpc.JsonRpcService.ExecuteAsync(JsonRpcRequest request, String methodName, ResolvedMethodInfo method, JsonRpcContext context) in /src/Nethermind/Nethermind.JsonRpc/JsonRpcService.cs:line 169"},"id":0}

Expected behavior
Request shouldn't throw an error.

Screenshots
If applicable, please include screenshots to help illustrate the problem.

Desktop (please complete the following information):
Please provide the following information regarding your setup:

  • Operating System: Linux
  • Version: Nethermind/v1.27.0+220b5b85/linux-x64/dotnet8.0.6
  • Installation Method: Docker
  • Consensus Client: Lighthouse

Additional context
Please provide any additional context about the problem.

Logs
Please include any relevant logs that may help identify the issue.

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