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

Update Bootnode to v0.11.2 #5767

Merged
merged 12 commits into from
May 7, 2020
7 changes: 4 additions & 3 deletions tools/bootnode/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
importpath = "github.com/prysmaticlabs/prysm/tools/bootnode",
visibility = ["//visibility:private"],
deps = [
"//beacon-chain/core/helpers:go_default_library",
"//proto/beacon/p2p/v1:go_default_library",
"//shared/iputils:go_default_library",
"//shared/logutil:go_default_library",
Expand Down Expand Up @@ -42,20 +43,20 @@ go_library(
go_image(
name = "image",
srcs = ["bootnode.go"],
base = "//tools:go_image",
base = "//tools:cc_image",
goarch = "amd64",
goos = "linux",
importpath = "github.com/prysmaticlabs/prysm/tools/bootnode",
pure = "on",
race = "off",
tags = ["manual"],
visibility = ["//visibility:private"],
deps = [
"//beacon-chain/core/helpers:go_default_library",
"//proto/beacon/p2p/v1:go_default_library",
"//shared/iputils:go_default_library",
"//shared/logutil:go_default_library",
"//shared/params:go_default_library",
"//shared/runutil:go_default_library",
"//shared/iputils:go_default_library",
"//shared/version:go_default_library",
"@com_github_btcsuite_btcd//btcec:go_default_library",
"@com_github_ethereum_go_ethereum//log:go_default_library",
Expand Down
11 changes: 8 additions & 3 deletions tools/bootnode/bootnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prysmaticlabs/go-bitfield"
"github.com/prysmaticlabs/go-ssz"
"github.com/prysmaticlabs/prysm/beacon-chain/core/helpers"
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
"github.com/prysmaticlabs/prysm/shared/iputils"
"github.com/prysmaticlabs/prysm/shared/logutil"
Expand Down Expand Up @@ -232,11 +233,15 @@ func createLocalNode(privKey *ecdsa.PrivateKey, ipAddr net.IP, port int) (*enode
if *externalIP == "" {
external = ipAddr
}
digest, err := helpers.ComputeForkDigest(params.BeaconConfig().GenesisForkVersion, params.BeaconConfig().ZeroHash[:])
if err != nil {
return nil, errors.Wrap(err, "Could not compute fork digest")
}

forkID := &pb.ENRForkID{
CurrentForkDigest: []byte{0, 0, 0, 0},
NextForkVersion: params.BeaconConfig().NextForkVersion,
NextForkEpoch: params.BeaconConfig().NextForkEpoch,
CurrentForkDigest: digest[:],
NextForkVersion: params.BeaconConfig().GenesisForkVersion,
NextForkEpoch: params.BeaconConfig().FarFutureEpoch,
}
forkEntry, err := ssz.Marshal(forkID)
if err != nil {
Expand Down