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 results in an error when omitting the from-field #4197

Closed
most08 opened this issue Jun 23, 2022 · 3 comments · Fixed by #5800
Closed

eth_estimateGas results in an error when omitting the from-field #4197

most08 opened this issue Jun 23, 2022 · 3 comments · Fixed by #5800
Assignees

Comments

@most08
Copy link

most08 commented Jun 23, 2022

Describe the bug
When calling eth_estimateGas without the from-field (sender-address) an error is occuring:

Error when handling ID 1, eth_estimateGas({ "to": "0x53d8cd462fa22e843ff0c4425f5cf2f4f00273ae", "value": "0x16345785d8a0000" }) | {"jsonrpc":"2.0","error":{"code":-32000,"message":"insufficient funds for transfer: address 0xfffffffffffffffffffffffffffffffffffffffe"},"id":1}

To Reproduce
Call eth_estimateGas:

curl --data '{"method":"eth_estimateGas","params":[{"to": "0x53d8cd462fa22e843ff0c4425f5cf2f4f00273ae", "value": "0x16345785d8a0000"}],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST 172.17.0.1:8546

Expected behavior
Return the amount of gas.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04 LTS
  • nethermind 1.13.3

Additional context

NETHERMIND_CONFIG="mainnet"
NETHERMIND_JSONRPCCONFIG_ENABLED="true"
NETHERMIND_JSONRPCCONFIG_HOST="0.0.0.0"
NETHERMIND_NETWORKCONFIG_MAXACTIVEPEERS="15"
NETHERMIND_INITCONFIG_LOGFILENAME="log.txt"
#
# Special
#
#NETHERMIND_INITCONFIG_STATICNODESPATH="static-peers.json"
#NETHERMIND_NETWORKCONFIG_ONLYSTATICPEERS="true"
NETHERMIND_NETWORKCONFIG_P2PPORT="30304"
NETHERMIND_NETWORKCONFIG_DISCOVERYPORT="30304"
NETHERMIND_JSONRPCCONFIG_PORT=8546
@tkstanczak
Copy link
Member

Thanks for reporting @most08 , we will look at this now.

@LukaszRozmej
Copy link
Member

We might have fix already but needs more testing: #3824

@abcfy2
Copy link

abcfy2 commented May 10, 2023

Any updates ? I have the same issue when I using blockscout indexing:

2023-05-10T16:25:00.759 application=indexer fetcher=internal_transaction count=10 error_count=10 [error] failed to fetch internal transactions for blocks: ** (ErlangError) Erlang error: [%{code: -32000, data: %{"blockNumber" => 17231118}, message: "insufficient funds for transfer: address 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5"}]

Nethermind log:

2023-05-10 16:26:23.5270|INFO|179|Executing JSON RPC call trace_replayBlockTransactions with params [0x106ED0E, [
  "trace"
]] 
2023-05-10 16:26:23.5539|WARN|111|Error when handling ID 6, trace_replayBlockTransactions(0x106ED0E,[
  "trace"
]) | {"jsonrpc":"2.0","error":{"code":-32000,"message":"insufficient funds for transfer: address 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5","data":"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.\n ---> Nethermind.State.InsufficientBalanceException: insufficient funds for transfer: address 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5\n   at Nethermind.State.StateProvider.SetNewBalance(Address address, UInt256& balanceChange, IReleaseSpec releaseSpec, Boolean isSubtracting)\n   at Nethermind.Evm.TransactionProcessing.TransactionProcessor.Execute(Transaction transaction, BlockHeader block, ITxTracer txTracer, ExecutionOptions executionOptions)\n   at Nethermind.Consensus.Processing.BlockProcessor.BlockValidationTransactionsExecutor.ProcessTransactions(Block block, ProcessingOptions processingOptions, BlockReceiptsTracer receiptsTracer, IReleaseSpec spec)\n   at Nethermind.Consensus.Processing.BlockProcessor.ProcessBlock(Block block, IBlockTracer blockTracer, ProcessingOptions options)\n   at Nethermind.Consensus.Processing.BlockProcessor.Process(Keccak newBranchStateRoot, List`1 suggestedBlocks, ProcessingOptions options, IBlockTracer blockTracer)\n   at Nethermind.Consensus.Processing.BlockchainProcessor.ProcessBranch(ProcessingBranch processingBranch, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Processing.BlockchainProcessor.Process(Block suggestedBlock, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Processing.OneTimeChainProcessor.Process(Block block, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Tracing.Tracer.Trace(Block block, IBlockTracer blockTracer)\n   at Nethermind.JsonRpc.Modules.Trace.TraceRpcModule.TraceBlock(Block block, ParityLikeBlockTracer tracer)\n   at Nethermind.JsonRpc.Modules.Trace.TraceRpcModule.trace_replayBlockTransactions(BlockParameter blockParameter, String[] traceTypes)\n   at InvokeStub_ITraceRpcModule.trace_replayBlockTransactions(Object, Object, IntPtr*)\n   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)\n   --- End of inner exception stack trace ---\n   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\n   at Nethermind.JsonRpc.JsonRpcService.ExecuteAsync(JsonRpcRequest request, String methodName, ValueTuple`2 method, JsonRpcContext context)"},"id":6} 
2023-05-10 16:26:23.5539|WARN|9|Error when handling ID 1, trace_replayBlockTransactions(0x106ED0E,[
  "trace"
]) | {"jsonrpc":"2.0","error":{"code":-32000,"message":"insufficient funds for transfer: address 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5","data":"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.\n ---> Nethermind.State.InsufficientBalanceException: insufficient funds for transfer: address 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5\n   at Nethermind.State.StateProvider.SetNewBalance(Address address, UInt256& balanceChange, IReleaseSpec releaseSpec, Boolean isSubtracting)\n   at Nethermind.Evm.TransactionProcessing.TransactionProcessor.Execute(Transaction transaction, BlockHeader block, ITxTracer txTracer, ExecutionOptions executionOptions)\n   at Nethermind.Consensus.Processing.BlockProcessor.BlockValidationTransactionsExecutor.ProcessTransactions(Block block, ProcessingOptions processingOptions, BlockReceiptsTracer receiptsTracer, IReleaseSpec spec)\n   at Nethermind.Consensus.Processing.BlockProcessor.ProcessBlock(Block block, IBlockTracer blockTracer, ProcessingOptions options)\n   at Nethermind.Consensus.Processing.BlockProcessor.Process(Keccak newBranchStateRoot, List`1 suggestedBlocks, ProcessingOptions options, IBlockTracer blockTracer)\n   at Nethermind.Consensus.Processing.BlockchainProcessor.ProcessBranch(ProcessingBranch processingBranch, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Processing.BlockchainProcessor.Process(Block suggestedBlock, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Processing.OneTimeChainProcessor.Process(Block block, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Tracing.Tracer.Trace(Block block, IBlockTracer blockTracer)\n   at Nethermind.JsonRpc.Modules.Trace.TraceRpcModule.TraceBlock(Block block, ParityLikeBlockTracer tracer)\n   at Nethermind.JsonRpc.Modules.Trace.TraceRpcModule.trace_replayBlockTransactions(BlockParameter blockParameter, String[] traceTypes)\n   at InvokeStub_ITraceRpcModule.trace_replayBlockTransactions(Object, Object, IntPtr*)\n   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)\n   --- End of inner exception stack trace ---\n   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\n   at Nethermind.JsonRpc.JsonRpcService.ExecuteAsync(JsonRpcRequest request, String methodName, ValueTuple`2 method, JsonRpcContext context)"},"id":1} 
2023-05-10 16:26:23.5539|INFO|9|Executing JSON RPC call trace_replayBlockTransactions with params [0x106ED1B, [
  "trace"
]] 
2023-05-10 16:26:23.5871|INFO|183|Executing JSON RPC call trace_replayBlockTransactions with params [0x106ED22, [
  "trace"
]] 
2023-05-10 16:26:23.6464|WARN|179|Error when handling ID 1, trace_replayBlockTransactions(0x106ED0E,[
  "trace"
]) | {"jsonrpc":"2.0","error":{"code":-32000,"message":"insufficient funds for transfer: address 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5","data":"System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.\n ---> Nethermind.State.InsufficientBalanceException: insufficient funds for transfer: address 0xdafea492d9c6733ae3d56b7ed1adb60692c98bc5\n   at Nethermind.State.StateProvider.SetNewBalance(Address address, UInt256& balanceChange, IReleaseSpec releaseSpec, Boolean isSubtracting)\n   at Nethermind.Evm.TransactionProcessing.TransactionProcessor.Execute(Transaction transaction, BlockHeader block, ITxTracer txTracer, ExecutionOptions executionOptions)\n   at Nethermind.Consensus.Processing.BlockProcessor.BlockValidationTransactionsExecutor.ProcessTransactions(Block block, ProcessingOptions processingOptions, BlockReceiptsTracer receiptsTracer, IReleaseSpec spec)\n   at Nethermind.Consensus.Processing.BlockProcessor.ProcessBlock(Block block, IBlockTracer blockTracer, ProcessingOptions options)\n   at Nethermind.Consensus.Processing.BlockProcessor.Process(Keccak newBranchStateRoot, List`1 suggestedBlocks, ProcessingOptions options, IBlockTracer blockTracer)\n   at Nethermind.Consensus.Processing.BlockchainProcessor.ProcessBranch(ProcessingBranch processingBranch, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Processing.BlockchainProcessor.Process(Block suggestedBlock, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Processing.OneTimeChainProcessor.Process(Block block, ProcessingOptions options, IBlockTracer tracer)\n   at Nethermind.Consensus.Tracing.Tracer.Trace(Block block, IBlockTracer blockTracer)\n   at Nethermind.JsonRpc.Modules.Trace.TraceRpcModule.TraceBlock(Block block, ParityLikeBlockTracer tracer)\n   at Nethermind.JsonRpc.Modules.Trace.TraceRpcModule.trace_replayBlockTransactions(BlockParameter blockParameter, String[] traceTypes)\n   at InvokeStub_ITraceRpcModule.trace_replayBlockTransactions(Object, Object, IntPtr*)\n   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)\n   --- End of inner exception stack trace ---\n   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)\n   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\n   at Nethermind.JsonRpc.JsonRpcService.ExecuteAsync(JsonRpcRequest request, String methodName, ValueTuple`2 method, JsonRpcContext context)"},"id":1}

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.

6 participants