From 6604d7dd72fa549a6e8c0f86f291c03f4d0ba23e Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Sat, 10 Apr 2021 15:51:31 +0430 Subject: [PATCH] cmd/geth: update verkle lib cmd/geth: update verkle lib go.mod: update verkle lib --- cmd/geth/snapshot.go | 6 +++--- go.mod | 4 ++-- go.sum | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cmd/geth/snapshot.go b/cmd/geth/snapshot.go index fd7d4a9e5b84..167210df9739 100644 --- a/cmd/geth/snapshot.go +++ b/cmd/geth/snapshot.go @@ -499,16 +499,16 @@ func computeCommitment(ctx *cli.Context) error { nodesCh := make(chan verkle.FlushableNode) verkleGenerate := func(db ethdb.KeyValueWriter, in chan snapshot.TrieKV, out chan common.Hash) { - t := verkle.New() + t := verkle.New(10, lg1) for leaf := range in { - t.InsertOrdered(common.CopyBytes(leaf.Key[:]), leaf.Value, ks, lg1, nodesCh) + t.InsertOrdered(common.CopyBytes(leaf.Key[:]), leaf.Value, ks, nodesCh) } // Flush remaining nodes to nodes channel rootNode, ok := t.(*verkle.InternalNode) if !ok { panic("verkle tree has invalid root node") } - comm := t.ComputeCommitment(ks, lg1) + comm := t.ComputeCommitment(ks) rootNode.Flush(nodesCh) root := common.BytesToHash(bls.ToCompressedG1(comm)) out <- root diff --git a/go.mod b/go.mod index 02979323c8e3..9393309d1dc1 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/fatih/color v1.7.0 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-20210401094554-ecbf17f30efb + github.com/gballet/go-verkle v0.0.0-20210414141224-8c72cb0024c3 github.com/go-stack/stack v1.8.0 github.com/golang/protobuf v1.4.3 github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3 @@ -51,7 +51,7 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 - golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 + golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0 golang.org/x/text v0.3.3 golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce diff --git a/go.sum b/go.sum index 4b98b109c204..03e3568ba577 100644 --- a/go.sum +++ b/go.sum @@ -161,6 +161,10 @@ github.com/gballet/go-verkle v0.0.0-20210401094554-ecbf17f30efb h1:rFYqmC5s6fMf2 github.com/gballet/go-verkle v0.0.0-20210401094554-ecbf17f30efb/go.mod h1:s2tVAxI5FnThDvOCzrUpNU8HxoGvFBelNLZpDEEsFuk= github.com/gballet/go-verkle v0.0.0-20210408135335-4da43934fa91 h1:HRH078PDVLdcEbuMWGQJPSk05X7vvvq5cfByCLyNfTc= github.com/gballet/go-verkle v0.0.0-20210408135335-4da43934fa91/go.mod h1:s2tVAxI5FnThDvOCzrUpNU8HxoGvFBelNLZpDEEsFuk= +github.com/gballet/go-verkle v0.0.0-20210411065716-3988b5d2319d h1:WuX2hsvZA2TX4gsvuH6X6g0F7tdZT3KvF/UVy8ve+K8= +github.com/gballet/go-verkle v0.0.0-20210411065716-3988b5d2319d/go.mod h1:s2tVAxI5FnThDvOCzrUpNU8HxoGvFBelNLZpDEEsFuk= +github.com/gballet/go-verkle v0.0.0-20210414141224-8c72cb0024c3 h1:wHIig2YTvsF+0PHpCv3UJgwSxhYXNZ7tzM/XE3rY3Ak= +github.com/gballet/go-verkle v0.0.0-20210414141224-8c72cb0024c3/go.mod h1:s2tVAxI5FnThDvOCzrUpNU8HxoGvFBelNLZpDEEsFuk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= @@ -616,6 +620,8 @@ golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54 h1:rF3Ohx8DRyl8h2zw9qojyLHLh golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0 h1:g9s1Ppvvun/fI+BptTMj909BBIcGrzQ32k9FNlcevOE= +golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=