Skip to content

eth_getBalance responds with TrieException #9408

@MarekM25

Description

@MarekM25

Curl command:

   curl -s -X POST -H "Content-Type: application/json"     --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xcC4e00A72d871D6c328BcFE9025AD93d0a26dF51", "0x4a8411"],"id":1}'     http://172.234.225.182:8545

{"jsonrpc":"2.0","error":{"code":-32603,"message":"Internal error","data":"Nethermind.Trie.MissingTrieNodeException: Node A: P:2 H:0x992eacd1f3b44a51b91065eb946c1fda63da35b3e05497ef6e71f3d9f0c3688b is missing from the DB\n at Nethermind.Trie.Pruning.ReadOnlyTrieStore.ScopedReadOnlyTrieStore.Nethermind.Trie.Pruning.ITrieNodeResolver.LoadRlp(TreePath& path, Hash256 hash, ReadFlags flags)\n at Nethermind.Trie.TrieNode.ResolveNode(ITrieNodeResolver tree, TreePath& path, ReadFlags readFlags, ICappedArrayPool bufferPool) in /src/Nethermind/Nethermind.Trie/TrieNode.cs:line 337\n at Nethermind.Trie.PatriciaTree.GetNew(Span1 remainingKey, TreePath& path, TrieNode node, Boolean isNodeRead) in /src/Nethermind/Nethermind.Trie/PatriciaTree.cs:line 793\n at Nethermind.Trie.PatriciaTree.Get(ReadOnlySpan1 rawKey, Hash256 rootHash) in /src/Nethermind/Nethermind.Trie/PatriciaTree.cs:line 348\n at Nethermind.State.StateReader.TryGetState(BlockHeader baseBlock, Address address, AccountStruct& account) in /src/Nethermind/Nethermind.State/StateReader.cs:line 63\n at Nethermind.JsonRpc.Modules.Eth.EthRpcModule.eth_getBalance(Address address, BlockParameter blockParameter) in /src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.cs:line 175\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`1 arguments)\n at Nethermind.JsonRpc.JsonRpcService.ExecuteAsync(JsonRpcRequest request, String methodName, ResolvedMethodInfo method, JsonRpcContext context) in /src/Nethermind/Nethermind.JsonRpc/JsonRpcService.cs:line 193"},"id":1}

It should be either No state available or return the balance of the given account. The above behaviour is incorrect

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions