From 8ce34cb9409795de218d7e54318e40fe0a26027e Mon Sep 17 00:00:00 2001 From: Ilya Mikheev <54912776+JkLondon@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:11:13 +0100 Subject: [PATCH] account range fix for test_11.json (#12734) closes #12608 --------- Co-authored-by: JkLondon --- core/state/dump.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/state/dump.go b/core/state/dump.go index be84c14a176..d32052a982a 100644 --- a/core/state/dump.go +++ b/core/state/dump.go @@ -23,7 +23,6 @@ import ( "encoding/json" "errors" "fmt" - libcommon "github.com/erigontech/erigon-lib/common" "github.com/erigontech/erigon-lib/common/hexutility" "github.com/erigontech/erigon-lib/crypto" @@ -172,13 +171,13 @@ func (d *Dumper) DumpToCollector(c DumpCollector, excludeCode, excludeStorage bo if err != nil { return nil, err } + if len(v) == 0 { + continue + } if maxResults > 0 && numberOfResults >= maxResults { nextKey = append(nextKey[:0], k...) break } - if len(v) == 0 { - continue - } if e := accounts.DeserialiseV3(&acc, v); e != nil { return nil, fmt.Errorf("decoding %x for %x: %w", v, k, e) @@ -191,7 +190,7 @@ func (d *Dumper) DumpToCollector(c DumpCollector, excludeCode, excludeStorage bo Storage: make(map[string]string), } if acc.CodeHash != emptyCodeHash { - account.CodeHash = acc.CodeHash[:] + account.CodeHash = hexutility.Bytes(acc.CodeHash.Bytes()) if !excludeCode { r, _, err := ttx.DomainGet(kv.CodeDomain, k, nil) @@ -212,7 +211,6 @@ func (d *Dumper) DumpToCollector(c DumpCollector, excludeCode, excludeStorage bo for i, addr := range addrList { account := accountList[i] - if !excludeStorage { t := trie.New(libcommon.Hash{}) nextAcc, _ := kv.NextSubtree(addr[:])