From 4a3c49e11af946d5b15e981196f5a830160135d9 Mon Sep 17 00:00:00 2001 From: nisdas Date: Wed, 6 May 2020 23:16:07 +0800 Subject: [PATCH 1/5] update to v0.11.2 --- tools/bootnode/bootnode.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/bootnode/bootnode.go b/tools/bootnode/bootnode.go index 682422837f3d..25802b22bc2a 100644 --- a/tools/bootnode/bootnode.go +++ b/tools/bootnode/bootnode.go @@ -234,9 +234,9 @@ func createLocalNode(privKey *ecdsa.PrivateKey, ipAddr net.IP, port int) (*enode } forkID := &pb.ENRForkID{ - CurrentForkDigest: []byte{0, 0, 0, 0}, - NextForkVersion: params.BeaconConfig().NextForkVersion, - NextForkEpoch: params.BeaconConfig().NextForkEpoch, + CurrentForkDigest: params.BeaconConfig().ZeroHash[:], + NextForkVersion: params.BeaconConfig().GenesisForkVersion, + NextForkEpoch: params.BeaconConfig().FarFutureEpoch, } forkEntry, err := ssz.Marshal(forkID) if err != nil { From 8ab685e4276657979e91a4dcfbdd3393200d2215 Mon Sep 17 00:00:00 2001 From: nisdas Date: Wed, 6 May 2020 23:25:07 +0800 Subject: [PATCH 2/5] fix test --- tools/bootnode/BUILD.bazel | 1 + tools/bootnode/bootnode.go | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/bootnode/BUILD.bazel b/tools/bootnode/BUILD.bazel index 1bade08c9cda..a67df343c19b 100644 --- a/tools/bootnode/BUILD.bazel +++ b/tools/bootnode/BUILD.bazel @@ -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", diff --git a/tools/bootnode/bootnode.go b/tools/bootnode/bootnode.go index 25802b22bc2a..05746700860b 100644 --- a/tools/bootnode/bootnode.go +++ b/tools/bootnode/bootnode.go @@ -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" @@ -232,9 +233,13 @@ 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: params.BeaconConfig().ZeroHash[:], + CurrentForkDigest: digest[:], NextForkVersion: params.BeaconConfig().GenesisForkVersion, NextForkEpoch: params.BeaconConfig().FarFutureEpoch, } From dd19329ff808a766f7419551a1ad2e9132728e86 Mon Sep 17 00:00:00 2001 From: nisdas Date: Thu, 7 May 2020 00:06:58 +0800 Subject: [PATCH 3/5] docker --- tools/bootnode/BUILD.bazel | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/bootnode/BUILD.bazel b/tools/bootnode/BUILD.bazel index a67df343c19b..cca6d8aaabc1 100644 --- a/tools/bootnode/BUILD.bazel +++ b/tools/bootnode/BUILD.bazel @@ -52,11 +52,12 @@ go_image( 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", From 7b7445fee52710b3648278bd7f51ab006ac35d04 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Thu, 7 May 2020 14:33:37 +0800 Subject: [PATCH 4/5] Update BUILD.bazel --- tools/bootnode/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bootnode/BUILD.bazel b/tools/bootnode/BUILD.bazel index cca6d8aaabc1..1dcdf616cc42 100644 --- a/tools/bootnode/BUILD.bazel +++ b/tools/bootnode/BUILD.bazel @@ -43,7 +43,7 @@ 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", From 39b59746df7140c40095eb6d8845ac4e167fdad2 Mon Sep 17 00:00:00 2001 From: Nishant Das Date: Thu, 7 May 2020 15:15:51 +0800 Subject: [PATCH 5/5] Update BUILD.bazel --- tools/bootnode/BUILD.bazel | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/bootnode/BUILD.bazel b/tools/bootnode/BUILD.bazel index 1dcdf616cc42..76a620edee15 100644 --- a/tools/bootnode/BUILD.bazel +++ b/tools/bootnode/BUILD.bazel @@ -47,7 +47,6 @@ go_image( goarch = "amd64", goos = "linux", importpath = "github.com/prysmaticlabs/prysm/tools/bootnode", - pure = "on", race = "off", tags = ["manual"], visibility = ["//visibility:private"],