Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actually use the function #43

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmd/geth/converkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,17 @@ func convertToVerkle(ctx *cli.Context) error {
// Save every slot into the tree
if slotCh != nil {
var (
laststem [31]byte
values = make([][]byte, 256)
laststem [31]byte
values = make([][]byte, 256)
addrpoint = trieUtils.EvaluateAddressPoint(accHash.Bytes())
)
copy(laststem[:], stem)
for sh := range slotCh {
if time.Since(lastReport) > time.Second*8 {
log.Info("Traversing state", "accounts", accounts, "in", accHash.String(), "elapsed", common.PrettyDuration(time.Since(start)))
lastReport = time.Now()
}
slotkey := trieUtils.GetTreeKeyStorageSlot(accHash.Bytes(), uint256.NewInt(0).SetBytes(sh.hash.Bytes()))
slotkey := trieUtils.GetTreeKeyStorageSlotWithEvaluatedAddress(addrpoint, uint256.NewInt(0).SetBytes(sh.hash.Bytes()))
var value [32]byte
copy(value[:len(sh.slot)-1], sh.slot)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c
github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff
github.com/gballet/go-verkle v0.0.0-20220526095713-e14979f99d7c // indirect
github.com/gballet/go-verkle v0.0.0-20220607144516-5ceb4395efff // indirect
github.com/go-stack/stack v1.8.0
github.com/golang-jwt/jwt/v4 v4.3.0
github.com/golang/protobuf v1.4.3
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ github.com/gballet/go-verkle v0.0.0-20220526095713-e14979f99d7c h1:hPcRl8HZES5vM
github.com/gballet/go-verkle v0.0.0-20220526095713-e14979f99d7c/go.mod h1:Q8VN4hcqHTwwrcU72/31sCU30IUQHuH0rcFe/b2SIFc=
github.com/gballet/go-verkle v0.0.0-20220527070744-f7946ac010f2 h1:M2EhCRamsasDrba35nzsD9ifTZlw55Mk5h6jFhTV9q4=
github.com/gballet/go-verkle v0.0.0-20220527070744-f7946ac010f2/go.mod h1:Q8VN4hcqHTwwrcU72/31sCU30IUQHuH0rcFe/b2SIFc=
github.com/gballet/go-verkle v0.0.0-20220607144516-5ceb4395efff h1:jryq5kEJgiYmUjf0RyzDyGOsTLtRM0J/mrg2lRTIrEM=
github.com/gballet/go-verkle v0.0.0-20220607144516-5ceb4395efff/go.mod h1:o/XfIXWi4/GqbQirfRm5uTbXMG5NpqxkxblnbZ+QM9I=
github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4=
github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down
2 changes: 1 addition & 1 deletion trie/utils/verkle.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func getTreeKeyWithEvaluatedAddess(evaluated *verkle.Point, treeIndex *uint256.I

}

func evaluateAddressPoint(address []byte) *verkle.Point {
func EvaluateAddressPoint(address []byte) *verkle.Point {
if len(address) < 32 {
var aligned [32]byte
address = append(aligned[:32-len(address)], address...)
Expand Down