Skip to content

Commit

Permalink
e3: cast keys same way as e2 does (erigontech#6870)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Feb 14, 2023
1 parent 4dab4dc commit d3d88c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/state/rw_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"sync"
"time"
"unsafe"

"github.com/holiman/uint256"
common2 "github.com/ledgerwatch/erigon-lib/common"
Expand Down Expand Up @@ -80,7 +81,7 @@ func (rs *StateV3) get(table string, key []byte) []byte {
if !ok {
return nil
}
if i, ok := t.Get(string(key)); ok {
if i, ok := t.Get(*(*string)(unsafe.Pointer(&key))); ok {
return i
}
return nil
Expand Down Expand Up @@ -562,8 +563,7 @@ func (rs *StateV3) ReadsValid(readLists map[string]*exec22.KvList) bool {
continue
}
for i, key := range list.Keys {
if val, ok := t.Get(string(key)); ok {
//fmt.Printf("key [%x] => [%x] vs [%x]\n", key, val, rereadVal)
if val, ok := t.Get(*(*string)(unsafe.Pointer(&key))); ok {
if table == CodeSizeTable {
if binary.BigEndian.Uint64(list.Vals[i]) != uint64(len(val)) {
return false
Expand Down

0 comments on commit d3d88c9

Please sign in to comment.