From 7f7ef43f218598a671aaeb327342d7e5130fe8b1 Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Tue, 3 Mar 2020 01:14:45 +0000 Subject: [PATCH] Update eth2 wallet keymanager (#4984) --- WORKSPACE | 52 ++++++++++++++++++++------------ validator/keymanager/BUILD.bazel | 2 +- validator/keymanager/wallet.go | 5 ++- 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 057c9a0007..ce7113ce98 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1500,74 +1500,86 @@ go_repository( go_repository( name = "com_github_wealdtech_go_eth2_wallet", - commit = "6970d62e60d86fdae3c3e510e800e8a60d755a7d", importpath = "github.com/wealdtech/go-eth2-wallet", + version = "v1.9.2", + sum = "h1:H/T1n0SNd0jTsbf4rA4YxigsBPFWRUWgobsTOjzW4Hw=", ) go_repository( - name = "com_github_wealdtech_go_eth2_wallet_hd", - commit = "ce0a252a01c621687e9786a64899cfbfe802ba73", - importpath = "github.com/wealdtech/go-eth2-wallet-hd", + name = "com_github_wealdtech_go_eth2_wallet_hd_v2", + importpath = "github.com/wealdtech/go-eth2-wallet-hd/v2", + version = "v2.0.0", + sum = "h1:oqE/+zFOKteklEemecMWGlyNmPv+5OBaHmAo1LKG6LE=", ) go_repository( - name = "com_github_wealdtech_go_eth2_wallet_nd", - commit = "12c8c41cdbd16797ff292e27f58e126bb89e9706", - importpath = "github.com/wealdtech/go-eth2-wallet-nd", + name = "com_github_wealdtech_go_eth2_wallet_nd_v2", + importpath = "github.com/wealdtech/go-eth2-wallet-nd/v2", + version = "v2.0.0", + sum = "h1:nWsbiaSVa1kwRdwPX5NfXsrowlRBjqoRpDv37i8ZecE=", ) go_repository( name = "com_github_wealdtech_go_eth2_wallet_store_filesystem", - commit = "1eea6a48d75380047d2ebe7c8c4bd8985bcfdeca", importpath = "github.com/wealdtech/go-eth2-wallet-store-filesystem", + version = "v1.7.1", + sum = "h1:px7vV01opCUeeHjvdiBdkPbdnr60Ygq01Ddjy4dIbfg=", ) go_repository( name = "com_github_wealdtech_go_eth2_wallet_store_s3", - commit = "1c821b5161f7bb0b3efa2030eff687eea5e70e53", importpath = "github.com/wealdtech/go-eth2-wallet-store-s3", + version = "v1.6.1", + sum = "h1:f86TIVHqYkmDYc8VLsiIJ/KbGtNMeCGhkefqpXUVmYE=", ) go_repository( name = "com_github_wealdtech_go_eth2_wallet_encryptor_keystorev4", - commit = "0c11c07b9544eb662210fadded94f40f309d8c8f", importpath = "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4", + version = "v1.0.0", + sum = "h1:IcpS4VpXhYz+TVupB5n6C6IQzaKwG+Rc8nvgCa/da4c=", ) go_repository( - name = "com_github_wealdtech_go_eth2_wallet_types", - commit = "af67d8101be61e7c4dd8126d2b3eba20cff5dab2", - importpath = "github.com/wealdtech/go-eth2-wallet-types", + name = "com_github_wealdtech_go_eth2_wallet_types_v2", + importpath = "github.com/wealdtech/go-eth2-wallet-types/v2", + version = "v2.0.0", + sum = "h1:EyTwHO7zXtYkf62h3MqSB3OWc8pv0dnFl41yykUJY3s=", ) go_repository( - name = "com_github_wealdtech_go_eth2_types", - commit = "f9c31ddf180537dd5712d5998a3d56c45864d71f", - importpath = "github.com/wealdtech/go-eth2-types", + name = "com_github_wealdtech_go_eth2_types_v2", + importpath = "github.com/wealdtech/go-eth2-types/v2", + version = "v2.0.2", + sum = "h1:L1Eg55aArRpUR2H8dnpSevHlSGRDuRQbQwA4IyYh0Js=", ) go_repository( name = "com_github_wealdtech_go_eth2_util", - commit = "326ebb1755651131bb8f4506ea9a23be6d9ad1dd", importpath = "github.com/wealdtech/go-eth2-util", + version = "v1.1.2", + sum = "h1:m56HKJgWSuNy53Gt5GN7HcoFaGRCl1uE3OGWhIhWh1M=", ) go_repository( name = "com_github_wealdtech_go_ecodec", - commit = "7473d835445a3490e61a5fcf48fe4e9755a37957", importpath = "github.com/wealdtech/go-ecodec", + version = "v1.1.0", + sum = "h1:yggrTSckcPJRaxxOxQF7FPm21kgE8WA6+f5jdq5Kr8o=", ) go_repository( name = "com_github_wealdtech_go_bytesutil", - commit = "e564d0ade555b9f97494f0f669196ddcc6bc531d", importpath = "github.com/wealdtech/go-bytesutil", + version = "v1.1.0", + sum = "h1:6XrN7OIQhhBjQy/PZ1HZ3ySE8v8UDyxzERkOgmsIc1g=", ) go_repository( name = "com_github_wealdtech_go_indexer", - commit = "334862c32b1e3a5c6738a2618f5c0a8ebeb8cd51", importpath = "github.com/wealdtech/go-indexer", + version = "v1.0.0", + sum = "h1:/S4rfWQbSOnnYmwnvuTVatDibZ8o1s9bmTCHO16XINg=", ) go_repository( diff --git a/validator/keymanager/BUILD.bazel b/validator/keymanager/BUILD.bazel index a2c0a30ece..c56894c9e6 100644 --- a/validator/keymanager/BUILD.bazel +++ b/validator/keymanager/BUILD.bazel @@ -22,7 +22,7 @@ go_library( "@com_github_sirupsen_logrus//:go_default_library", "@com_github_wealdtech_go_eth2_wallet//:go_default_library", "@com_github_wealdtech_go_eth2_wallet_store_filesystem//:go_default_library", - "@com_github_wealdtech_go_eth2_wallet_types//:go_default_library", + "@com_github_wealdtech_go_eth2_wallet_types_v2//:go_default_library", "@org_golang_x_crypto//ssh/terminal:go_default_library", ], ) diff --git a/validator/keymanager/wallet.go b/validator/keymanager/wallet.go index ba19730b5d..5c081580db 100644 --- a/validator/keymanager/wallet.go +++ b/validator/keymanager/wallet.go @@ -11,7 +11,7 @@ import ( "github.com/prysmaticlabs/prysm/shared/bytesutil" e2wallet "github.com/wealdtech/go-eth2-wallet" filesystem "github.com/wealdtech/go-eth2-wallet-store-filesystem" - e2wtypes "github.com/wealdtech/go-eth2-wallet-types" + e2wtypes "github.com/wealdtech/go-eth2-wallet-types/v2" ) type walletOpts struct { @@ -117,8 +117,7 @@ func (km *Wallet) Sign(pubKey [48]byte, root [32]byte) (*bls.Signature, error) { if !exists { return nil, ErrNoSuchKey } - // TODO(#4817) Update with new library to remove domain here. - sig, err := account.Sign(root[:], 0) + sig, err := account.Sign(root[:]) if err != nil { return nil, err }