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

dependency: go version to 1.20 and some dependencies in go.mod #1939

Merged
merged 6 commits into from
Oct 24, 2023

Conversation

brilliant-lx
Copy link
Collaborator

@brilliant-lx brilliant-lx commented Oct 24, 2023

Description

upgrade some dependencies for quality enhancement.

  • prysm from v4.0.2 to v4.0.8
    It is mainly for go-libp2p upgrade, which has a potential OOM risk. go-libp2p was added by prysm indirectly, so upgrade prysm instead. It will also upgrade go-libp2p to v0.27.8 and it needs golang v1.20+ to compile, but prsym v4.0.8 can not be compiled with golang v1.21. So only upgrade to v1.20.
  • github.com/docker/docker from v20.10.19 to 20.10.24
    actually it is not an issue for BSC, since BSC only use it for test purpose, but upgrade also is ok.

And after golang v1.20, the usage of math/rand module has been changed, see: https://pkg.go.dev/math/rand

Rationale

Example

NA

Changes

NA

@brilliant-lx brilliant-lx changed the title go.mod: upgrade prysm and the indrect dependency upgrade: go version to 1.20 and some dependencies Oct 24, 2023
@brilliant-lx brilliant-lx changed the title upgrade: go version to 1.20 and some dependencies upgrade: go version to 1.20 and some dependencies in go.mod Oct 24, 2023
@brilliant-lx brilliant-lx changed the title upgrade: go version to 1.20 and some dependencies in go.mod dependency: go version to 1.20 and some dependencies in go.mod Oct 24, 2023
prysm from v4.0.2 to v4.0.8, and run go mod tidy
there is some dependency on go v1.20, such as go-libp2p v0.27.8
and also run go mod tidy
it is not a big issue, since docker is only used for test purpose.
@buddh0
Copy link
Collaborator

buddh0 commented Oct 24, 2023

fail to compile with [email protected]
so we should modify README.md

Building `geth` requires both a Go (version 1.19 or later) and a C compiler (GCC 5 or higher). You can install

and in ./accounts/abi/bind/bind_test.go, -compat=1.19 is not needed

tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.19")

2 APIs of math/rand module were deprecated since golang v1.20.
that is: rand.Seed() and rand.Read(), refer: ettps://pkg.go.dev/math/rand

"rand.Seed(seed int64)" has been replaced by: "r := rand.New(rand.NewSource(seed int64))",
need to initialize it with an instance before use

"rand.Read()" has been replaced by "crypto/rand.Read()"
@brilliant-lx brilliant-lx merged commit 01d75a9 into bnb-chain:develop Oct 24, 2023
5 checks passed
@brilliant-lx brilliant-lx deleted the go_mod_prysm branch October 24, 2023 13:51
whw188 pushed a commit to tylerteea/mev-bsc that referenced this pull request Dec 6, 2023
…hain#1939)

* go.mod: upgrade prysm and the indrect dependency
prysm from v4.0.2 to v4.0.8, and run go mod tidy

* ci: upgrade go version from 1.19 to 1.20
* go-version: upgrade from v1.19 to v1.20
there is some dependency on go v1.20, such as go-libp2p v0.27.8
and also run go mod tidy

* dependency: upgrade docker version for security
it is not a big issue, since docker is only used for test purpose.

* rand: update the usage of math/rand after golang v1.20

2 APIs of math/rand module were deprecated since golang v1.20.
that is: rand.Seed() and rand.Read(), refer: ettps://pkg.go.dev/math/rand

"rand.Seed(seed int64)" has been replaced by: "r := rand.New(rand.NewSource(seed int64))",
need to initialize it with an instance before use

"rand.Read()" has been replaced by "crypto/rand.Read()"

* readme: need golang v1.20+ to build bsc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants