From 83810660c63ba3049ebe3839290d90e94b447de4 Mon Sep 17 00:00:00 2001 From: Valentin Staykov <79150443+V-Staykov@users.noreply.github.com> Date: Wed, 25 Sep 2024 13:25:59 +0300 Subject: [PATCH] check for nil account in get_proof (#1225) --- cmd/rpcdaemon/commands/eth_call.go | 3 +++ turbo/trie/trie_root.go | 15 --------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/cmd/rpcdaemon/commands/eth_call.go b/cmd/rpcdaemon/commands/eth_call.go index d72903cc286..4b069fb173c 100644 --- a/cmd/rpcdaemon/commands/eth_call.go +++ b/cmd/rpcdaemon/commands/eth_call.go @@ -385,6 +385,9 @@ func (api *APIImpl) GetProof(ctx context.Context, address libcommon.Address, sto if err != nil { return nil, err } + if a == nil { + return nil, nil + } pr, err := trie.NewProofRetainer(address, a, storageKeys, rl) if err != nil { return nil, err diff --git a/turbo/trie/trie_root.go b/turbo/trie/trie_root.go index 996ef935cb4..459a8443618 100644 --- a/turbo/trie/trie_root.go +++ b/turbo/trie/trie_root.go @@ -328,21 +328,6 @@ func (r *RootHashAggregator) Receive(itemType StreamItem, hasTree bool, cutoff int, ) error { - //r.traceIf("9c3dc2561d472d125d8f87dde8f2e3758386463ade768ae1a1546d34101968bb", "00") - //if storageKey == nil { - // //if bytes.HasPrefix(accountKey, common.FromHex("08050d07")) { - // fmt.Printf("1: %d, %x, %x\n", itemType, accountKey, hash) - // //} - //} else { - // //if bytes.HasPrefix(accountKey, common.FromHex("876f5a0f54b30254d2bad26bb5a8da19cbe748fd033004095d9c96c8e667376b")) && bytes.HasPrefix(storageKey, common.FromHex("")) { - // //fmt.Printf("%x\n", storageKey) - // fmt.Printf("1: %d, %x, %x, %x\n", itemType, accountKey, storageKey, hash) - // //} - //} - // - - fmt.Printf("1: %d, %x, %x, %x\n", itemType, accountKey, storageKey, hash) - switch itemType { case StorageStreamItem: if len(r.currAccK) == 0 {