Skip to content

Commit

Permalink
chore: deps: drop direct use of minio/blake2b-simd (filecoin-project#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi authored Sep 7, 2024
1 parent 42e6e41 commit 6b03326
Show file tree
Hide file tree
Showing 19 changed files with 65 additions and 62 deletions.
11 changes: 5 additions & 6 deletions chain/actors/builtin/multisig/actor.go.template
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package multisig

import (
actorstypes "github.com/filecoin-project/go-state-types/actors"
"github.com/ipfs/go-cid"
"fmt"

"github.com/minio/blake2b-simd"
"github.com/ipfs/go-cid"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
actorstypes "github.com/filecoin-project/go-state-types/actors"
builtintypes "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/cbor"
"github.com/filecoin-project/go-state-types/manifest"

msig{{.latestVersion}} "github.com/filecoin-project/go-state-types/builtin{{import .latestVersion}}multisig"
{{range .versions}}
Expand All @@ -20,9 +22,6 @@ import (
{{end}}
{{end}}

builtintypes "github.com/filecoin-project/go-state-types/builtin"
"github.com/filecoin-project/go-state-types/manifest"

"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/adt"
"github.com/filecoin-project/lotus/chain/types"
Expand Down
2 changes: 1 addition & 1 deletion chain/actors/builtin/multisig/multisig.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"

"github.com/ipfs/go-cid"
"github.com/minio/blake2b-simd"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down
2 changes: 1 addition & 1 deletion chain/beacon/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/binary"
"time"

"github.com/minio/blake2b-simd"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-state-types/abi"
Expand Down
2 changes: 1 addition & 1 deletion chain/messagepool/messagepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
"github.com/ipfs/go-datastore/query"
logging "github.com/ipfs/go-log/v2"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/minio/blake2b-simd"
"github.com/raulk/clock"
"go.opencensus.io/stats"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

ffi "github.com/filecoin-project/filecoin-ffi"
Expand Down
5 changes: 3 additions & 2 deletions chain/rand/rand.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/minio/blake2b-simd"
"go.opencensus.io/trace"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-state-types/abi"
Expand All @@ -17,6 +17,7 @@ import (
"github.com/filecoin-project/lotus/chain/beacon"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/must"
)

var log = logging.Logger("rand")
Expand All @@ -26,7 +27,7 @@ func DrawRandomnessFromBase(rbase []byte, pers crypto.DomainSeparationTag, round
}

func DrawRandomnessFromDigest(digest [32]byte, pers crypto.DomainSeparationTag, round abi.ChainEpoch, entropy []byte) ([]byte, error) {
h := blake2b.New256()
h := must.One(blake2b.New256(nil))
if err := binary.Write(h, binary.BigEndian, int64(pers)); err != nil {
return nil, xerrors.Errorf("deriving randomness: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion chain/store/weight_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"

"github.com/ipfs/go-cid"
"github.com/minio/blake2b-simd"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/blake2b"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
Expand Down
2 changes: 1 addition & 1 deletion chain/types/blockheader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

block "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/minio/blake2b-simd"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down
2 changes: 1 addition & 1 deletion chain/types/electionproof.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package types
import (
"math/big"

"github.com/minio/blake2b-simd"
"golang.org/x/crypto/blake2b"

"github.com/filecoin-project/lotus/build/buildconstants"
)
Expand Down
2 changes: 1 addition & 1 deletion chain/types/tipset.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
"github.com/minio/blake2b-simd"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-state-types/abi"
Expand Down
2 changes: 1 addition & 1 deletion chain/vm/syscalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/minio/blake2b-simd"
mh "github.com/multiformats/go-multihash"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down
5 changes: 3 additions & 2 deletions cmd/lotus-bench/caching_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"errors"

"github.com/ipfs/go-datastore"
"github.com/minio/blake2b-simd"
cbg "github.com/whyrusleeping/cbor-gen"
"golang.org/x/crypto/blake2b"

"github.com/filecoin-project/go-state-types/abi"
prooftypes "github.com/filecoin-project/go-state-types/proof"

"github.com/filecoin-project/lotus/chain/proofs"
"github.com/filecoin-project/lotus/lib/must"
)

type cachingVerifier struct {
Expand All @@ -23,7 +24,7 @@ type cachingVerifier struct {
const bufsize = 128

func (cv cachingVerifier) withCache(execute func() (bool, error), param cbg.CBORMarshaler) (bool, error) {
hasher := blake2b.New256()
hasher := must.One(blake2b.New256(nil))
wr := bufio.NewWriterSize(hasher, bufsize)
err := param.MarshalCBOR(wr)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-bench/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

"github.com/docker/go-units"
logging "github.com/ipfs/go-log/v2"
"github.com/minio/blake2b-simd"
"github.com/mitchellh/go-homedir"
"github.com/urfave/cli/v2"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-seed/seed/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
logging "github.com/ipfs/go-log/v2"
ic "github.com/libp2p/go-libp2p/core/crypto"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/minio/blake2b-simd"
"golang.org/x/crypto/blake2b"
"golang.org/x/xerrors"

ffi "github.com/filecoin-project/filecoin-ffi"
Expand Down
2 changes: 1 addition & 1 deletion cmd/lotus-shed/blockmsgid.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

"github.com/ipfs/go-cid"
"github.com/minio/blake2b-simd"
"github.com/urfave/cli/v2"
"golang.org/x/crypto/blake2b"

"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"
Expand Down
26 changes: 13 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require (
github.com/filecoin-project/go-commp-utils/v2 v2.1.0
github.com/filecoin-project/go-crypto v0.1.0
github.com/filecoin-project/go-f3 v0.2.0
github.com/filecoin-project/go-fil-commcid v0.1.0
github.com/filecoin-project/go-fil-commcid v0.2.0
github.com/filecoin-project/go-hamt-ipld/v3 v3.4.0
github.com/filecoin-project/go-jsonrpc v0.6.0
github.com/filecoin-project/go-padreader v0.0.1
Expand Down Expand Up @@ -114,7 +114,6 @@ require (
github.com/manifoldco/promptui v0.9.0
github.com/mattn/go-isatty v0.0.20
github.com/mattn/go-sqlite3 v1.14.16
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-base32 v0.1.0
github.com/multiformats/go-multiaddr v0.12.4
Expand All @@ -132,7 +131,7 @@ require (
github.com/sirupsen/logrus v1.9.2
github.com/stretchr/testify v1.9.0
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/triplewz/poseidon v0.0.0-20230828015038-79d8165c88ed
github.com/triplewz/poseidon v0.0.1
github.com/urfave/cli/v2 v2.25.5
github.com/whyrusleeping/bencher v0.0.0-20190829221104-bb6607aa8bba
github.com/whyrusleeping/cbor-gen v0.1.2
Expand All @@ -154,14 +153,14 @@ require (
go.uber.org/fx v1.22.1
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.25.0
golang.org/x/mod v0.17.0
golang.org/x/net v0.26.0
golang.org/x/sync v0.7.0
golang.org/x/sys v0.23.0
golang.org/x/term v0.22.0
golang.org/x/time v0.5.0
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
golang.org/x/crypto v0.27.0
golang.org/x/mod v0.20.0
golang.org/x/net v0.29.0
golang.org/x/sync v0.8.0
golang.org/x/sys v0.25.0
golang.org/x/term v0.24.0
golang.org/x/time v0.6.0
golang.org/x/tools v0.24.0
golang.org/x/xerrors v0.0.0-20240716161551-93cc26a95ae9
gopkg.in/cheggaaa/pb.v1 v1.0.28
gotest.tools v2.2.0+incompatible
Expand Down Expand Up @@ -269,6 +268,7 @@ require (
github.com/miekg/dns v1.1.59 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
Expand Down Expand Up @@ -329,8 +329,8 @@ require (
go.uber.org/dig v1.17.1 // indirect
go.uber.org/mock v0.4.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e // indirect
golang.org/x/text v0.18.0 // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240515191416-fc5f0ca64291 // indirect
google.golang.org/grpc v1.64.0 // indirect
Expand Down
Loading

0 comments on commit 6b03326

Please sign in to comment.