diff --git a/core/state/history_reader_v3.go b/core/state/history_reader_v3.go index df423db1b..2eeb3524f 100644 --- a/core/state/history_reader_v3.go +++ b/core/state/history_reader_v3.go @@ -1,10 +1,10 @@ package state import ( + "encoding/binary" "fmt" libcommon "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon-lib/common/hexutility" "github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon/core/state/temporal" "github.com/ledgerwatch/erigon/core/types/accounts" @@ -50,7 +50,10 @@ func (hr *HistoryReaderV3) ReadAccountData(address libcommon.Address) (*accounts } func (hr *HistoryReaderV3) ReadAccountStorage(address libcommon.Address, incarnation uint64, key *libcommon.Hash) ([]byte, error) { - enc, _, err := hr.ttx.DomainGet(temporal.StorageDomain, append(address.Bytes(), hexutility.EncodeTs(incarnation)...), key.Bytes(), hr.txNum) + acc := make([]byte, 20+8) + copy(acc, address.Bytes()) + binary.BigEndian.PutUint64(acc[20:], incarnation) + enc, _, err := hr.ttx.DomainGet(temporal.StorageDomain, acc, key.Bytes(), hr.txNum) if hr.trace { fmt.Printf("ReadAccountStorage [%x] [%x] => [%x]\n", address, *key, enc) } diff --git a/go.mod b/go.mod index 59ce99505..121de6718 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/ledgerwatch/erigon go 1.18 require ( - github.com/ledgerwatch/erigon-lib v0.0.0-20230224131753-91fcc7da8185 + github.com/ledgerwatch/erigon-lib v0.0.0-20230225062945-eaec91fff52d github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230224032817-e29f5ad218a2 github.com/ledgerwatch/log/v3 v3.7.0 github.com/ledgerwatch/secp256k1 v1.0.0 diff --git a/go.sum b/go.sum index 2f3061828..877d4ee64 100644 --- a/go.sum +++ b/go.sum @@ -521,8 +521,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170224010052-a616ab194758 h1:0D5M2HQSGD3PYPwICLl+/9oulQauOuETfgFvhBDffs0= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= -github.com/ledgerwatch/erigon-lib v0.0.0-20230224131753-91fcc7da8185 h1:ervycSGqlKnBv7putFyRjOmqVz6OVCwmWqB5g6JCbFc= -github.com/ledgerwatch/erigon-lib v0.0.0-20230224131753-91fcc7da8185/go.mod h1:y9a/PjMYVygqnGHD4mmaBePuI5P7kgtVnfiOuc2c1pU= +github.com/ledgerwatch/erigon-lib v0.0.0-20230225062945-eaec91fff52d h1:uyYQTzuOcZwsikyVasKBI9XLpLhPE2UmXbIpPpDW5YY= +github.com/ledgerwatch/erigon-lib v0.0.0-20230225062945-eaec91fff52d/go.mod h1:y9a/PjMYVygqnGHD4mmaBePuI5P7kgtVnfiOuc2c1pU= github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230224032817-e29f5ad218a2 h1:Vf5oUCq9s4JSLd5/WJxq8zTuMY5Brn8So0yeJDvUauc= github.com/ledgerwatch/erigon-snapshot v1.1.1-0.20230224032817-e29f5ad218a2/go.mod h1:3AuPxZc85jkehh/HA9h8gabv5MSi3kb/ddtzBsTVJFo= github.com/ledgerwatch/log/v3 v3.7.0 h1:aFPEZdwZx4jzA3+/Pf8wNDN5tCI0cIolq/kfvgcM+og=