diff --git a/beacon-chain/flags/base.go b/beacon-chain/flags/base.go index bd11d68456a7..5ff0390fa57b 100644 --- a/beacon-chain/flags/base.go +++ b/beacon-chain/flags/base.go @@ -69,7 +69,7 @@ var ( Name: "grpc-gateway-corsdomain", Usage: "Comma separated list of domains from which to accept cross origin requests " + "(browser enforced). This flag has no effect if not used with --grpc-gateway-port.", - Value: "http://localhost:4242,http://127.0.0.1:4242", + Value: "http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200", } // MinSyncPeers specifies the required number of successful peer handshakes in order // to start syncing with external peers. diff --git a/beacon-chain/rpc/beacon/validators.go b/beacon-chain/rpc/beacon/validators.go index 8c222c7a22a6..1942e9796219 100644 --- a/beacon-chain/rpc/beacon/validators.go +++ b/beacon-chain/rpc/beacon/validators.go @@ -80,7 +80,6 @@ func (bs *Server) ListValidatorBalances( }) continue } - filtered[index] = true if index >= uint64(len(balances)) { @@ -88,10 +87,13 @@ func (bs *Server) ListValidatorBalances( index, len(balances)) } + val := validators[index] + st := validatorStatus(val, requestedEpoch) res = append(res, ðpb.ValidatorBalances_Balance{ PublicKey: pubKey, Index: index, Balance: balances[index], + Status: st.String(), }) balancesCount = len(res) } @@ -103,10 +105,13 @@ func (bs *Server) ListValidatorBalances( } if !filtered[index] { + val := validators[index] + st := validatorStatus(val, requestedEpoch) res = append(res, ðpb.ValidatorBalances_Balance{ PublicKey: validators[index].PublicKey, Index: index, Balance: balances[index], + Status: st.String(), }) } balancesCount = len(res) @@ -140,10 +145,13 @@ func (bs *Server) ListValidatorBalances( // Return everything. for i := start; i < end; i++ { pubkey := requestedState.PubkeyAtIndex(uint64(i)) + val := validators[i] + st := validatorStatus(val, requestedEpoch) res = append(res, ðpb.ValidatorBalances_Balance{ PublicKey: pubkey[:], Index: uint64(i), Balance: balances[i], + Status: st.String(), }) } return ðpb.ValidatorBalances{ @@ -838,3 +846,26 @@ func validatorHasExited(validator *ethpb.Validator, currentEpoch uint64) bool { } return true } + +func validatorStatus(validator *ethpb.Validator, epoch uint64) ethpb.ValidatorStatus { + farFutureEpoch := params.BeaconConfig().FarFutureEpoch + if validator == nil { + return ethpb.ValidatorStatus_UNKNOWN_STATUS + } + if epoch < validator.ActivationEligibilityEpoch { + return ethpb.ValidatorStatus_DEPOSITED + } + if epoch < validator.ActivationEpoch { + return ethpb.ValidatorStatus_PENDING + } + if validator.ExitEpoch == farFutureEpoch { + return ethpb.ValidatorStatus_ACTIVE + } + if epoch < validator.ExitEpoch { + if validator.Slashed { + return ethpb.ValidatorStatus_SLASHING + } + return ethpb.ValidatorStatus_EXITING + } + return ethpb.ValidatorStatus_EXITED +} diff --git a/beacon-chain/rpc/beacon/validators_test.go b/beacon-chain/rpc/beacon/validators_test.go index 5b1763d6d8b0..7ff3ee803ab3 100644 --- a/beacon-chain/rpc/beacon/validators_test.go +++ b/beacon-chain/rpc/beacon/validators_test.go @@ -139,6 +139,7 @@ func TestServer_ListValidatorBalances_DefaultResponse_NoArchive(t *testing.T) { PublicKey: pubKey(uint64(i)), Index: uint64(i), Balance: params.BeaconConfig().MaxEffectiveBalance, + Status: "EXITED", } } st := testutil.NewBeaconState() @@ -246,7 +247,7 @@ func TestServer_ListValidatorBalances_Pagination_Default(t *testing.T) { {req: ðpb.ListValidatorBalancesRequest{PublicKeys: [][]byte{pubKey(99)}, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {Index: 99, PublicKey: pubKey(99), Balance: 99}, + {Index: 99, PublicKey: pubKey(99), Balance: 99, Status: "EXITED"}, }, NextPageToken: "", TotalSize: 1, @@ -255,9 +256,9 @@ func TestServer_ListValidatorBalances_Pagination_Default(t *testing.T) { {req: ðpb.ListValidatorBalancesRequest{Indices: []uint64{1, 2, 3}, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {Index: 1, PublicKey: pubKey(1), Balance: 1}, - {Index: 2, PublicKey: pubKey(2), Balance: 2}, - {Index: 3, PublicKey: pubKey(3), Balance: 3}, + {Index: 1, PublicKey: pubKey(1), Balance: 1, Status: "EXITED"}, + {Index: 2, PublicKey: pubKey(2), Balance: 2, Status: "EXITED"}, + {Index: 3, PublicKey: pubKey(3), Balance: 3, Status: "EXITED"}, }, NextPageToken: "", TotalSize: 3, @@ -266,9 +267,9 @@ func TestServer_ListValidatorBalances_Pagination_Default(t *testing.T) { {req: ðpb.ListValidatorBalancesRequest{PublicKeys: [][]byte{pubKey(10), pubKey(11), pubKey(12)}, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {Index: 10, PublicKey: pubKey(10), Balance: 10}, - {Index: 11, PublicKey: pubKey(11), Balance: 11}, - {Index: 12, PublicKey: pubKey(12), Balance: 12}, + {Index: 10, PublicKey: pubKey(10), Balance: 10, Status: "EXITED"}, + {Index: 11, PublicKey: pubKey(11), Balance: 11, Status: "EXITED"}, + {Index: 12, PublicKey: pubKey(12), Balance: 12, Status: "EXITED"}, }, NextPageToken: "", TotalSize: 3, @@ -276,9 +277,9 @@ func TestServer_ListValidatorBalances_Pagination_Default(t *testing.T) { {req: ðpb.ListValidatorBalancesRequest{PublicKeys: [][]byte{pubKey(2), pubKey(3)}, Indices: []uint64{3, 4}, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, // Duplication res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {Index: 2, PublicKey: pubKey(2), Balance: 2}, - {Index: 3, PublicKey: pubKey(3), Balance: 3}, - {Index: 4, PublicKey: pubKey(4), Balance: 4}, + {Index: 2, PublicKey: pubKey(2), Balance: 2, Status: "EXITED"}, + {Index: 3, PublicKey: pubKey(3), Balance: 3, Status: "EXITED"}, + {Index: 4, PublicKey: pubKey(4), Balance: 4, Status: "EXITED"}, }, NextPageToken: "", TotalSize: 3, @@ -286,8 +287,8 @@ func TestServer_ListValidatorBalances_Pagination_Default(t *testing.T) { {req: ðpb.ListValidatorBalancesRequest{PublicKeys: [][]byte{{}}, Indices: []uint64{3, 4}, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, // Public key has a blank value res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {Index: 3, PublicKey: pubKey(3), Balance: 3}, - {Index: 4, PublicKey: pubKey(4), Balance: 4}, + {Index: 3, PublicKey: pubKey(3), Balance: 3, Status: "EXITED"}, + {Index: 4, PublicKey: pubKey(4), Balance: 4, Status: "EXITED"}, }, NextPageToken: "", TotalSize: 2, @@ -331,35 +332,35 @@ func TestServer_ListValidatorBalances_Pagination_CustomPageSizes(t *testing.T) { {req: ðpb.ListValidatorBalancesRequest{PageToken: strconv.Itoa(1), PageSize: 3, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {PublicKey: pubKey(3), Index: 3, Balance: uint64(3)}, - {PublicKey: pubKey(4), Index: 4, Balance: uint64(4)}, - {PublicKey: pubKey(5), Index: 5, Balance: uint64(5)}}, + {PublicKey: pubKey(3), Index: 3, Balance: uint64(3), Status: "EXITED"}, + {PublicKey: pubKey(4), Index: 4, Balance: uint64(4), Status: "EXITED"}, + {PublicKey: pubKey(5), Index: 5, Balance: uint64(5), Status: "EXITED"}}, NextPageToken: strconv.Itoa(2), TotalSize: int32(count)}}, {req: ðpb.ListValidatorBalancesRequest{PageToken: strconv.Itoa(10), PageSize: 5, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {PublicKey: pubKey(50), Index: 50, Balance: uint64(50)}, - {PublicKey: pubKey(51), Index: 51, Balance: uint64(51)}, - {PublicKey: pubKey(52), Index: 52, Balance: uint64(52)}, - {PublicKey: pubKey(53), Index: 53, Balance: uint64(53)}, - {PublicKey: pubKey(54), Index: 54, Balance: uint64(54)}}, + {PublicKey: pubKey(50), Index: 50, Balance: uint64(50), Status: "EXITED"}, + {PublicKey: pubKey(51), Index: 51, Balance: uint64(51), Status: "EXITED"}, + {PublicKey: pubKey(52), Index: 52, Balance: uint64(52), Status: "EXITED"}, + {PublicKey: pubKey(53), Index: 53, Balance: uint64(53), Status: "EXITED"}, + {PublicKey: pubKey(54), Index: 54, Balance: uint64(54), Status: "EXITED"}}, NextPageToken: strconv.Itoa(11), TotalSize: int32(count)}}, {req: ðpb.ListValidatorBalancesRequest{PageToken: strconv.Itoa(33), PageSize: 3, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {PublicKey: pubKey(99), Index: 99, Balance: uint64(99)}, - {PublicKey: pubKey(100), Index: 100, Balance: uint64(100)}, - {PublicKey: pubKey(101), Index: 101, Balance: uint64(101)}, + {PublicKey: pubKey(99), Index: 99, Balance: uint64(99), Status: "EXITED"}, + {PublicKey: pubKey(100), Index: 100, Balance: uint64(100), Status: "EXITED"}, + {PublicKey: pubKey(101), Index: 101, Balance: uint64(101), Status: "EXITED"}, }, NextPageToken: "34", TotalSize: int32(count)}}, {req: ðpb.ListValidatorBalancesRequest{PageSize: 2, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}}, res: ðpb.ValidatorBalances{ Balances: []*ethpb.ValidatorBalances_Balance{ - {PublicKey: pubKey(0), Index: 0, Balance: uint64(0)}, - {PublicKey: pubKey(1), Index: 1, Balance: uint64(1)}}, + {PublicKey: pubKey(0), Index: 0, Balance: uint64(0), Status: "EXITED"}, + {PublicKey: pubKey(1), Index: 1, Balance: uint64(1), Status: "EXITED"}}, NextPageToken: strconv.Itoa(1), TotalSize: int32(count)}}, } @@ -1901,3 +1902,86 @@ func TestServer_GetIndividualVotes_Working(t *testing.T) { } assert.DeepEqual(t, wanted, res, "Unexpected response") } + +func Test_validatorStatus(t *testing.T) { + tests := []struct { + name string + validator *ethpb.Validator + epoch uint64 + want ethpb.ValidatorStatus + }{ + { + name: "Unknown", + validator: nil, + epoch: 0, + want: ethpb.ValidatorStatus_UNKNOWN_STATUS, + }, + { + name: "Deposited", + validator: ðpb.Validator{ + ActivationEligibilityEpoch: uint64(1), + }, + epoch: 0, + want: ethpb.ValidatorStatus_DEPOSITED, + }, + { + name: "Pending", + validator: ðpb.Validator{ + ActivationEligibilityEpoch: uint64(0), + ActivationEpoch: uint64(1), + }, + epoch: 0, + want: ethpb.ValidatorStatus_PENDING, + }, + { + name: "Active", + validator: ðpb.Validator{ + ActivationEligibilityEpoch: uint64(0), + ActivationEpoch: uint64(0), + ExitEpoch: params.BeaconConfig().FarFutureEpoch, + }, + epoch: 0, + want: ethpb.ValidatorStatus_ACTIVE, + }, + { + name: "Slashed", + validator: ðpb.Validator{ + ActivationEligibilityEpoch: uint64(0), + ActivationEpoch: uint64(0), + ExitEpoch: uint64(5), + Slashed: true, + }, + epoch: 4, + want: ethpb.ValidatorStatus_SLASHING, + }, + { + name: "Exiting", + validator: ðpb.Validator{ + ActivationEligibilityEpoch: uint64(0), + ActivationEpoch: uint64(0), + ExitEpoch: uint64(5), + Slashed: false, + }, + epoch: 4, + want: ethpb.ValidatorStatus_EXITING, + }, + { + name: "Exiting", + validator: ðpb.Validator{ + ActivationEligibilityEpoch: uint64(0), + ActivationEpoch: uint64(0), + ExitEpoch: uint64(3), + Slashed: false, + }, + epoch: 4, + want: ethpb.ValidatorStatus_EXITED, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := validatorStatus(tt.validator, tt.epoch); got != tt.want { + t.Errorf("validatorStatus() = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/go.sum b/go.sum index 91832b959b84..b32996a65500 100644 --- a/go.sum +++ b/go.sum @@ -1217,6 +1217,7 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go4.org v0.0.0-20180809161055-417644f6feb5 h1:+hE86LblG4AyDgwMCLTE6FOlM9+qjHSYS+rKqxUVdsM= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= diff --git a/proto/validator/accounts/v2/web_api.pb.go b/proto/validator/accounts/v2/web_api.pb.go index 4b62597ef0e7..70234dcacc45 100755 --- a/proto/validator/accounts/v2/web_api.pb.go +++ b/proto/validator/accounts/v2/web_api.pb.go @@ -64,12 +64,10 @@ type CreateWalletRequest struct { WalletPassword string `protobuf:"bytes,3,opt,name=wallet_password,json=walletPassword,proto3" json:"wallet_password,omitempty"` Mnemonic string `protobuf:"bytes,4,opt,name=mnemonic,proto3" json:"mnemonic,omitempty"` NumAccounts uint64 `protobuf:"varint,5,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` - KeystoresImported []string `protobuf:"bytes,6,rep,name=keystores_imported,json=keystoresImported,proto3" json:"keystores_imported,omitempty"` - KeystoresPassword string `protobuf:"bytes,7,opt,name=keystores_password,json=keystoresPassword,proto3" json:"keystores_password,omitempty"` - RemoteAddr string `protobuf:"bytes,8,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"` - RemoteCrtPath string `protobuf:"bytes,9,opt,name=remote_crt_path,json=remoteCrtPath,proto3" json:"remote_crt_path,omitempty"` - RemoteKeyPath string `protobuf:"bytes,10,opt,name=remote_key_path,json=remoteKeyPath,proto3" json:"remote_key_path,omitempty"` - RemoteCaCrtPath string `protobuf:"bytes,11,opt,name=remote_ca_crt_path,json=remoteCaCrtPath,proto3" json:"remote_ca_crt_path,omitempty"` + RemoteAddr string `protobuf:"bytes,6,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"` + RemoteCrtPath string `protobuf:"bytes,7,opt,name=remote_crt_path,json=remoteCrtPath,proto3" json:"remote_crt_path,omitempty"` + RemoteKeyPath string `protobuf:"bytes,8,opt,name=remote_key_path,json=remoteKeyPath,proto3" json:"remote_key_path,omitempty"` + RemoteCaCrtPath string `protobuf:"bytes,9,opt,name=remote_ca_crt_path,json=remoteCaCrtPath,proto3" json:"remote_ca_crt_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -143,20 +141,6 @@ func (m *CreateWalletRequest) GetNumAccounts() uint64 { return 0 } -func (m *CreateWalletRequest) GetKeystoresImported() []string { - if m != nil { - return m.KeystoresImported - } - return nil -} - -func (m *CreateWalletRequest) GetKeystoresPassword() string { - if m != nil { - return m.KeystoresPassword - } - return "" -} - func (m *CreateWalletRequest) GetRemoteAddr() string { if m != nil { return m.RemoteAddr @@ -240,6 +224,53 @@ func (m *CreateWalletResponse) GetAccountsCreated() *DepositDataResponse { return nil } +type DefaultWalletResponse struct { + WalletDir string `protobuf:"bytes,1,opt,name=wallet_dir,json=walletDir,proto3" json:"wallet_dir,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DefaultWalletResponse) Reset() { *m = DefaultWalletResponse{} } +func (m *DefaultWalletResponse) String() string { return proto.CompactTextString(m) } +func (*DefaultWalletResponse) ProtoMessage() {} +func (*DefaultWalletResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8a5153635bfe042e, []int{2} +} +func (m *DefaultWalletResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DefaultWalletResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DefaultWalletResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DefaultWalletResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DefaultWalletResponse.Merge(m, src) +} +func (m *DefaultWalletResponse) XXX_Size() int { + return m.Size() +} +func (m *DefaultWalletResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DefaultWalletResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DefaultWalletResponse proto.InternalMessageInfo + +func (m *DefaultWalletResponse) GetWalletDir() string { + if m != nil { + return m.WalletDir + } + return "" +} + type EditWalletConfigRequest struct { RemoteAddr string `protobuf:"bytes,1,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"` RemoteCrtPath string `protobuf:"bytes,2,opt,name=remote_crt_path,json=remoteCrtPath,proto3" json:"remote_crt_path,omitempty"` @@ -254,7 +285,7 @@ func (m *EditWalletConfigRequest) Reset() { *m = EditWalletConfigRequest func (m *EditWalletConfigRequest) String() string { return proto.CompactTextString(m) } func (*EditWalletConfigRequest) ProtoMessage() {} func (*EditWalletConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{2} + return fileDescriptor_8a5153635bfe042e, []int{3} } func (m *EditWalletConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -322,7 +353,7 @@ func (m *GenerateMnemonicResponse) Reset() { *m = GenerateMnemonicRespon func (m *GenerateMnemonicResponse) String() string { return proto.CompactTextString(m) } func (*GenerateMnemonicResponse) ProtoMessage() {} func (*GenerateMnemonicResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{3} + return fileDescriptor_8a5153635bfe042e, []int{4} } func (m *GenerateMnemonicResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -371,7 +402,7 @@ func (m *WalletResponse) Reset() { *m = WalletResponse{} } func (m *WalletResponse) String() string { return proto.CompactTextString(m) } func (*WalletResponse) ProtoMessage() {} func (*WalletResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{4} + return fileDescriptor_8a5153635bfe042e, []int{5} } func (m *WalletResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -435,7 +466,7 @@ func (m *ListAccountsRequest) Reset() { *m = ListAccountsRequest{} } func (m *ListAccountsRequest) String() string { return proto.CompactTextString(m) } func (*ListAccountsRequest) ProtoMessage() {} func (*ListAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{5} + return fileDescriptor_8a5153635bfe042e, []int{6} } func (m *ListAccountsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -505,7 +536,7 @@ func (m *ListAccountsResponse) Reset() { *m = ListAccountsResponse{} } func (m *ListAccountsResponse) String() string { return proto.CompactTextString(m) } func (*ListAccountsResponse) ProtoMessage() {} func (*ListAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{6} + return fileDescriptor_8a5153635bfe042e, []int{7} } func (m *ListAccountsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -569,7 +600,7 @@ func (m *Account) Reset() { *m = Account{} } func (m *Account) String() string { return proto.CompactTextString(m) } func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{7} + return fileDescriptor_8a5153635bfe042e, []int{8} } func (m *Account) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -638,7 +669,7 @@ func (m *AccountRequest) Reset() { *m = AccountRequest{} } func (m *AccountRequest) String() string { return proto.CompactTextString(m) } func (*AccountRequest) ProtoMessage() {} func (*AccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{8} + return fileDescriptor_8a5153635bfe042e, []int{9} } func (m *AccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -683,6 +714,7 @@ func (m *AccountRequest) GetIndices() []uint64 { type AuthRequest struct { Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` + WalletDir string `protobuf:"bytes,2,opt,name=wallet_dir,json=walletDir,proto3" json:"wallet_dir,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -692,7 +724,7 @@ func (m *AuthRequest) Reset() { *m = AuthRequest{} } func (m *AuthRequest) String() string { return proto.CompactTextString(m) } func (*AuthRequest) ProtoMessage() {} func (*AuthRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{9} + return fileDescriptor_8a5153635bfe042e, []int{10} } func (m *AuthRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -728,6 +760,13 @@ func (m *AuthRequest) GetPassword() string { return "" } +func (m *AuthRequest) GetWalletDir() string { + if m != nil { + return m.WalletDir + } + return "" +} + type AuthResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` TokenExpiration uint64 `protobuf:"varint,2,opt,name=token_expiration,json=tokenExpiration,proto3" json:"token_expiration,omitempty"` @@ -740,7 +779,7 @@ func (m *AuthResponse) Reset() { *m = AuthResponse{} } func (m *AuthResponse) String() string { return proto.CompactTextString(m) } func (*AuthResponse) ProtoMessage() {} func (*AuthResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{10} + return fileDescriptor_8a5153635bfe042e, []int{11} } func (m *AuthResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -798,7 +837,7 @@ func (m *NodeConnectionResponse) Reset() { *m = NodeConnectionResponse{} func (m *NodeConnectionResponse) String() string { return proto.CompactTextString(m) } func (*NodeConnectionResponse) ProtoMessage() {} func (*NodeConnectionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{11} + return fileDescriptor_8a5153635bfe042e, []int{12} } func (m *NodeConnectionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -863,8 +902,9 @@ func (m *NodeConnectionResponse) GetDepositContractAddress() []byte { } type ChangePasswordRequest struct { - Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` - PasswordConfirmation string `protobuf:"bytes,2,opt,name=password_confirmation,json=passwordConfirmation,proto3" json:"password_confirmation,omitempty"` + CurrentPassword string `protobuf:"bytes,1,opt,name=current_password,json=currentPassword,proto3" json:"current_password,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + PasswordConfirmation string `protobuf:"bytes,3,opt,name=password_confirmation,json=passwordConfirmation,proto3" json:"password_confirmation,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -874,7 +914,7 @@ func (m *ChangePasswordRequest) Reset() { *m = ChangePasswordRequest{} } func (m *ChangePasswordRequest) String() string { return proto.CompactTextString(m) } func (*ChangePasswordRequest) ProtoMessage() {} func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{12} + return fileDescriptor_8a5153635bfe042e, []int{13} } func (m *ChangePasswordRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -903,6 +943,13 @@ func (m *ChangePasswordRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ChangePasswordRequest proto.InternalMessageInfo +func (m *ChangePasswordRequest) GetCurrentPassword() string { + if m != nil { + return m.CurrentPassword + } + return "" +} + func (m *ChangePasswordRequest) GetPassword() string { if m != nil { return m.Password @@ -928,7 +975,7 @@ func (m *HasWalletResponse) Reset() { *m = HasWalletResponse{} } func (m *HasWalletResponse) String() string { return proto.CompactTextString(m) } func (*HasWalletResponse) ProtoMessage() {} func (*HasWalletResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{13} + return fileDescriptor_8a5153635bfe042e, []int{14} } func (m *HasWalletResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -976,7 +1023,7 @@ func (m *ImportKeystoresRequest) Reset() { *m = ImportKeystoresRequest{} func (m *ImportKeystoresRequest) String() string { return proto.CompactTextString(m) } func (*ImportKeystoresRequest) ProtoMessage() {} func (*ImportKeystoresRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{14} + return fileDescriptor_8a5153635bfe042e, []int{15} } func (m *ImportKeystoresRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1030,7 +1077,7 @@ func (m *ImportKeystoresResponse) Reset() { *m = ImportKeystoresResponse func (m *ImportKeystoresResponse) String() string { return proto.CompactTextString(m) } func (*ImportKeystoresResponse) ProtoMessage() {} func (*ImportKeystoresResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{15} + return fileDescriptor_8a5153635bfe042e, []int{16} } func (m *ImportKeystoresResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1077,7 +1124,7 @@ func (m *CreateAccountRequest) Reset() { *m = CreateAccountRequest{} } func (m *CreateAccountRequest) String() string { return proto.CompactTextString(m) } func (*CreateAccountRequest) ProtoMessage() {} func (*CreateAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{16} + return fileDescriptor_8a5153635bfe042e, []int{17} } func (m *CreateAccountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1126,7 +1173,7 @@ func (m *DepositMessage) Reset() { *m = DepositMessage{} } func (m *DepositMessage) String() string { return proto.CompactTextString(m) } func (*DepositMessage) ProtoMessage() {} func (*DepositMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{17} + return fileDescriptor_8a5153635bfe042e, []int{18} } func (m *DepositMessage) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1187,7 +1234,7 @@ func (m *DepositDataResponse) Reset() { *m = DepositDataResponse{} } func (m *DepositDataResponse) String() string { return proto.CompactTextString(m) } func (*DepositDataResponse) ProtoMessage() {} func (*DepositDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{18} + return fileDescriptor_8a5153635bfe042e, []int{19} } func (m *DepositDataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1234,7 +1281,7 @@ func (m *DepositDataResponse_DepositData) Reset() { *m = DepositDataResp func (m *DepositDataResponse_DepositData) String() string { return proto.CompactTextString(m) } func (*DepositDataResponse_DepositData) ProtoMessage() {} func (*DepositDataResponse_DepositData) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{18, 0} + return fileDescriptor_8a5153635bfe042e, []int{19, 0} } func (m *DepositDataResponse_DepositData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1282,7 +1329,7 @@ func (m *BackupAccountsRequest) Reset() { *m = BackupAccountsRequest{} } func (m *BackupAccountsRequest) String() string { return proto.CompactTextString(m) } func (*BackupAccountsRequest) ProtoMessage() {} func (*BackupAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{19} + return fileDescriptor_8a5153635bfe042e, []int{20} } func (m *BackupAccountsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1336,7 +1383,7 @@ func (m *BackupAccountsResponse) Reset() { *m = BackupAccountsResponse{} func (m *BackupAccountsResponse) String() string { return proto.CompactTextString(m) } func (*BackupAccountsResponse) ProtoMessage() {} func (*BackupAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{20} + return fileDescriptor_8a5153635bfe042e, []int{21} } func (m *BackupAccountsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1383,7 +1430,7 @@ func (m *DeleteAccountsRequest) Reset() { *m = DeleteAccountsRequest{} } func (m *DeleteAccountsRequest) String() string { return proto.CompactTextString(m) } func (*DeleteAccountsRequest) ProtoMessage() {} func (*DeleteAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{21} + return fileDescriptor_8a5153635bfe042e, []int{22} } func (m *DeleteAccountsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1430,7 +1477,7 @@ func (m *DeleteAccountsResponse) Reset() { *m = DeleteAccountsResponse{} func (m *DeleteAccountsResponse) String() string { return proto.CompactTextString(m) } func (*DeleteAccountsResponse) ProtoMessage() {} func (*DeleteAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{22} + return fileDescriptor_8a5153635bfe042e, []int{23} } func (m *DeleteAccountsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1470,6 +1517,7 @@ func init() { proto.RegisterEnum("ethereum.validator.accounts.v2.KeymanagerKind", KeymanagerKind_name, KeymanagerKind_value) proto.RegisterType((*CreateWalletRequest)(nil), "ethereum.validator.accounts.v2.CreateWalletRequest") proto.RegisterType((*CreateWalletResponse)(nil), "ethereum.validator.accounts.v2.CreateWalletResponse") + proto.RegisterType((*DefaultWalletResponse)(nil), "ethereum.validator.accounts.v2.DefaultWalletResponse") proto.RegisterType((*EditWalletConfigRequest)(nil), "ethereum.validator.accounts.v2.EditWalletConfigRequest") proto.RegisterType((*GenerateMnemonicResponse)(nil), "ethereum.validator.accounts.v2.GenerateMnemonicResponse") proto.RegisterType((*WalletResponse)(nil), "ethereum.validator.accounts.v2.WalletResponse") @@ -1501,126 +1549,130 @@ func init() { } var fileDescriptor_8a5153635bfe042e = []byte{ - // 1896 bytes of a gzipped FileDescriptorProto + // 1960 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0xa7, 0xec, 0x24, 0xe3, 0x3c, 0x3b, 0x4e, 0x52, 0x49, 0x3c, 0x5e, 0xcf, 0x4c, 0x92, 0xa9, - 0x65, 0x27, 0x1f, 0xb3, 0xb1, 0x17, 0x67, 0x77, 0x26, 0x84, 0x03, 0x9a, 0x71, 0xbc, 0x3b, 0xa3, - 0xec, 0xcc, 0x8e, 0x7a, 0x23, 0xf6, 0x04, 0xad, 0x8a, 0xbb, 0xc6, 0x2e, 0xd9, 0xee, 0xf6, 0x76, - 0x97, 0xf3, 0xc5, 0x6d, 0xc5, 0x15, 0x0e, 0xcb, 0x01, 0x21, 0xc1, 0x81, 0x91, 0xb8, 0xc0, 0x65, - 0x91, 0x90, 0x90, 0x38, 0x70, 0xe0, 0xc4, 0x11, 0x89, 0x3b, 0xa0, 0x11, 0x27, 0x8e, 0xfc, 0x05, - 0xa8, 0x3e, 0xba, 0xdb, 0x76, 0x3a, 0x38, 0x1e, 0xb4, 0x97, 0xc8, 0xf5, 0xea, 0x7d, 0xfc, 0xfa, - 0xbd, 0x57, 0xef, 0x23, 0xb0, 0xd5, 0xf3, 0x3d, 0xe1, 0x55, 0x4e, 0x68, 0x87, 0x3b, 0x54, 0x78, - 0x7e, 0x85, 0x36, 0x1a, 0x5e, 0xdf, 0x15, 0x41, 0xe5, 0xa4, 0x5a, 0x39, 0x65, 0xc7, 0x36, 0xed, - 0xf1, 0xb2, 0xe2, 0xc1, 0xab, 0x4c, 0xb4, 0x98, 0xcf, 0xfa, 0xdd, 0x72, 0xc4, 0x5d, 0x0e, 0xb9, - 0xcb, 0x27, 0xd5, 0xd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6, 0x23, 0x49, 0x90, 0x70, 0x69, 0xa7, 0xa3, 0xb2, 0x23, 0x63, 0xc9, 0x9f, 0xe4, - 0x15, 0x82, 0xe5, 0x61, 0x50, 0x26, 0xbe, 0x35, 0xc8, 0x44, 0x05, 0x0c, 0x29, 0xe7, 0x6e, 0x8c, - 0x73, 0xae, 0xd1, 0x61, 0x45, 0x82, 0x32, 0x89, 0x5d, 0x76, 0x26, 0x53, 0x24, 0xc2, 0x64, 0x92, - 0x5d, 0x92, 0x5f, 0x44, 0xb8, 0xee, 0x00, 0x08, 0x4f, 0xd0, 0x8e, 0xfe, 0xa8, 0xb4, 0xfa, 0xa8, - 0x59, 0x45, 0x91, 0x5f, 0x45, 0x7e, 0x87, 0xe0, 0x86, 0x51, 0x8e, 0xab, 0xb0, 0x62, 0xac, 0x73, - 0xb7, 0x69, 0xf7, 0xfa, 0xc7, 0x1d, 0xde, 0xb0, 0xc3, 0x18, 0xe4, 0xac, 0xa5, 0xf8, 0xf2, 0x85, - 0xba, 0x3b, 0x64, 0xe7, 0xb2, 0x20, 0x1b, 0x48, 0xb6, 0x4b, 0xbb, 0x61, 0x68, 0xb2, 0x86, 0xf6, - 0x9c, 0x76, 0x99, 0x44, 0x3a, 0x1a, 0x80, 0xb4, 0x52, 0x38, 0xe7, 0x0c, 0x79, 0x7f, 0x43, 0xf2, - 0xf9, 0xfc, 0x44, 0xb5, 0xc2, 0xc1, 0xb7, 0x96, 0x8f, 0xc9, 0xea, 0xa9, 0x1d, 0x42, 0x3e, 0xf4, - 0x47, 0x5c, 0x1a, 0x62, 0xb8, 0xda, 0xa9, 0x39, 0x0b, 0x7a, 0x21, 0xca, 0x00, 0x17, 0xe1, 0x06, - 0x77, 0x1d, 0xde, 0x60, 0x41, 0x31, 0xb5, 0x9e, 0xde, 0x9c, 0xb2, 0xc2, 0x23, 0xd9, 0x82, 0xec, - 0xa3, 0xbe, 0x68, 0x85, 0x9a, 0x4a, 0x90, 0x89, 0x9a, 0x80, 0x79,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f8, 0x84, 0x06, 0x23, 0x95, 0xf4, 0x6d, 0x98, 0x33, 0x95, 0x94, 0x9d, 0xf1, 0x40, 0x3d, - 0x37, 0xf9, 0xed, 0x39, 0x4d, 0xac, 0x2b, 0x1a, 0x39, 0x81, 0x82, 0x9e, 0x06, 0x0e, 0xc3, 0x6e, - 0x1f, 0x97, 0x8f, 0xa4, 0x51, 0x02, 0x4d, 0x36, 0x4a, 0xa4, 0xae, 0x18, 0x25, 0xc8, 0x21, 0xdc, - 0xbc, 0x64, 0x37, 0x8e, 0x7e, 0x68, 0xce, 0xbe, 0x9c, 0xd8, 0x38, 0xbc, 0x8b, 0x9e, 0x61, 0x40, - 0xbe, 0x1d, 0x36, 0xfe, 0x91, 0x97, 0x31, 0x3a, 0x30, 0xa1, 0x4b, 0x03, 0x13, 0xf9, 0x25, 0x82, - 0xbc, 0xa9, 0x83, 0xcf, 0x58, 0x10, 0xd0, 0x26, 0xc3, 0x5b, 0x30, 0xd3, 0xeb, 0x1f, 0x47, 0x4f, - 0xff, 0xf1, 0xe2, 0x7f, 0xfe, 0xbe, 0x36, 0x17, 0x04, 0x17, 0x3b, 0xb2, 0x88, 0xec, 0x93, 0xf7, - 0xf7, 0x88, 0x65, 0x18, 0xf0, 0x13, 0x28, 0x9c, 0x72, 0xd1, 0x72, 0x7c, 0x7a, 0x4a, 0x3b, 0x72, - 0x26, 0x70, 0x98, 0x2b, 0x38, 0xed, 0x04, 0xea, 0xc3, 0x2f, 0x89, 0xee, 0x56, 0x89, 0xb5, 0x12, - 0x0b, 0xd4, 0x62, 0x7e, 0x5c, 0x80, 0x19, 0xda, 0x95, 0x90, 0x54, 0x86, 0x4e, 0x59, 0xe6, 0x44, - 0x7e, 0x93, 0x82, 0xa5, 0x84, 0xe1, 0x01, 0xb7, 0x61, 0x31, 0xcc, 0x4a, 0x59, 0x54, 0xec, 0x0e, - 0x0f, 0x84, 0xa9, 0xa7, 0xdf, 0x7d, 0x83, 0x61, 0x64, 0x88, 0x16,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b7, 0xc6, 0xc5, 0xff, 0x52, 0x69, 0x22, 0x6f, 0x7f, 0xf1, 0xb7, 0x7f, 0xfd, 0x34, 0x75, - 0x07, 0xdf, 0x92, 0xcb, 0x63, 0xbc, 0x52, 0xea, 0xca, 0x54, 0xd1, 0xe5, 0x0a, 0xff, 0x0a, 0x41, - 0x6e, 0x70, 0x9e, 0xc7, 0x63, 0xa7, 0xec, 0x84, 0x55, 0xaf, 0xf4, 0xfe, 0x64, 0x42, 0x06, 0xe0, - 0x3d, 0x05, 0x70, 0x9d, 0x24, 0x03, 0xd4, 0xc3, 0xff, 0x3e, 0xda, 0xc6, 0xaf, 0x10, 0x80, 0x1c, - 0xd9, 0xf5, 0xec, 0x86, 0x1f, 0x8e, 0x33, 0x76, 0xc5, 0x78, 0x5f, 0x9a, 0x70, 0x25, 0x21, 0xf7, - 0x15, 0xbe, 0x77, 0xc8, 0x7a, 0x32, 0x3e, 0xa5, 0xbb, 0xc2, 0x1c, 0x2e, 0x24, 0x48, 0x01, 0xb9, - 0x41, 0x9b, 0x57, 0x06, 0x72, 0x52, 0x10, 0xb7, 0x15, 0x88, 0x02, 0x5e, 0x4e, 0x02, 0x81, 0x7f, - 0x8c, 0x60, 0x61, 0x74, 0x29, 0xb8, 0xd2, 0xf4, 0xde, 0x38, 0xd3, 0x57, 0xad, 0x17, 0x64, 0x43, - 0x81, 0xb8, 0x8b, 0xd7, 0x86, 0x41, 0x84, 0x2b, 0x46, 0xa5, 0x69, 0x04, 0xf1, 0x4f, 0x10, 0xe4, - 0x87, 0xdb, 0x31, 0xfe, 0x60, 0x6c, 0x6e, 0x24, 0xb5, 0xef, 0xd2, 0x15, 0x1f, 0x41, 0x76, 0x14, - 0x94, 0x0d, 0x42, 0x12, 0x83, 0x12, 0x16, 0x96, 0x28, 0x2c, 0xbf, 0x47, 0x30, 0x3f, 0xd2, 0x03, - 0xf1, 0x83, 0x71, 0x88, 0x92, 0x9b, 0x75, 0xe9, 0xe1, 0xc4, 0x72, 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 0x10, 0xae, 0x36, 0x6a, 0xce, 0x82, 0x7e, 0x88, 0x32, 0xc0, + 0x25, 0x98, 0xe3, 0xae, 0xc3, 0x9b, 0x2c, 0x28, 0xa5, 0xd6, 0xa6, 0x36, 0xa6, 0xad, 0x70, 0x49, + 0x9e, 0x40, 0xf6, 0xd1, 0x40, 0xb4, 0x43, 0x49, 0x65, 0x48, 0x47, 0x85, 0xc7, 0x3c, 0xd5, 0x70, + 0x1d, 0xcb, 0x5d, 0xa9, 0x78, 0xee, 0xfa, 0x04, 0x72, 0x5a, 0x92, 0x71, 0xf3, 0x32, 0xcc, 0x68, + 0xbf, 0x68, 0x39, 0x7a, 0x81, 0x37, 0xa1, 0xa0, 0x3e, 0x6c, 0x76, 0xda, 0xe7, 0xbe, 0xba, 0x94, + 0x12, 0x35, 0x6d, 0x2d, 0x28, 0x7a, 0x23, 0x22, 0x93, 0x7f, 0x20, 0x28, 0x3e, 0xf3, 0x1c, 0x56, + 0xf7, 0x5c, 0x97, 0x35, 0x25, 0x29, 0x92, 0xfd, 0x1e, 0x2c, 0x1f, 0x31, 0xda, 0xf4, 0x5c, 0xdb, + 0xf5, 0x1c, 0x66, 0x33, 0xd7, 0xe9, 0x7b, 0xdc, 0x15, 0x46, 0x15, 0xd6, 0x7b, 0xf2, 0x6c, 0xc3, + 0xec, 0xe0, 0x9b, 0x90, 0x69, 0x6a, 0x39, 0x26, 0xd5, 0xa7, 0xad, 0x21, 0x41, 0xda, 0x27, 0x38, + 0x73, 0x9b, 0xdc, 0x6d, 0x29, 0xdf, 0xa4, 0xad, 0x70, 0x29, 0x1d, 0xdc, 0x62, 0x2e, 0x0b, 0x78, + 0x60, 0x0b, 0xde, 0x63, 0xca, 0x25, 0xd3, 0x56, 0xd6, 0xd0, 0x0e, 0x79, 0x8f, 0xe1, 0x1d, 0x28, + 0x85, 0x0e, 0x6e, 0x7a, 0xae, 0xf0, 0x69, 0x53, 0xa8, 0x14, 0xcd, 0x02, 0x5d, 0x7a, 0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, 0xf4, 0xd7, 0x57, 0xab, + 0xe8, 0x9f, 0xaf, 0x56, 0xd1, 0xd1, 0xac, 0x72, 0xcc, 0xf6, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, + 0xd3, 0x5f, 0x4c, 0xa1, 0x46, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1637,6 +1689,7 @@ const _ = grpc.SupportPackageIsVersion4 type WalletClient interface { HasWallet(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*HasWalletResponse, error) CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) + DefaultWalletPath(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*DefaultWalletResponse, error) EditConfig(ctx context.Context, in *EditWalletConfigRequest, opts ...grpc.CallOption) (*WalletResponse, error) WalletConfig(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*WalletResponse, error) GenerateMnemonic(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*GenerateMnemonicResponse, error) @@ -1670,6 +1723,15 @@ func (c *walletClient) CreateWallet(ctx context.Context, in *CreateWalletRequest return out, nil } +func (c *walletClient) DefaultWalletPath(ctx context.Context, in *types.Empty, opts ...grpc.CallOption) (*DefaultWalletResponse, error) { + out := new(DefaultWalletResponse) + err := c.cc.Invoke(ctx, "/ethereum.validator.accounts.v2.Wallet/DefaultWalletPath", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *walletClient) EditConfig(ctx context.Context, in *EditWalletConfigRequest, opts ...grpc.CallOption) (*WalletResponse, error) { out := new(WalletResponse) err := c.cc.Invoke(ctx, "/ethereum.validator.accounts.v2.Wallet/EditConfig", in, out, opts...) @@ -1719,6 +1781,7 @@ func (c *walletClient) ImportKeystores(ctx context.Context, in *ImportKeystoresR type WalletServer interface { HasWallet(context.Context, *types.Empty) (*HasWalletResponse, error) CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error) + DefaultWalletPath(context.Context, *types.Empty) (*DefaultWalletResponse, error) EditConfig(context.Context, *EditWalletConfigRequest) (*WalletResponse, error) WalletConfig(context.Context, *types.Empty) (*WalletResponse, error) GenerateMnemonic(context.Context, *types.Empty) (*GenerateMnemonicResponse, error) @@ -1736,6 +1799,9 @@ func (*UnimplementedWalletServer) HasWallet(ctx context.Context, req *types.Empt func (*UnimplementedWalletServer) CreateWallet(ctx context.Context, req *CreateWalletRequest) (*CreateWalletResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateWallet not implemented") } +func (*UnimplementedWalletServer) DefaultWalletPath(ctx context.Context, req *types.Empty) (*DefaultWalletResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DefaultWalletPath not implemented") +} func (*UnimplementedWalletServer) EditConfig(ctx context.Context, req *EditWalletConfigRequest) (*WalletResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EditConfig not implemented") } @@ -1792,6 +1858,24 @@ func _Wallet_CreateWallet_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Wallet_DefaultWalletPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(types.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletServer).DefaultWalletPath(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.validator.accounts.v2.Wallet/DefaultWalletPath", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletServer).DefaultWalletPath(ctx, req.(*types.Empty)) + } + return interceptor(ctx, in, info, handler) +} + func _Wallet_EditConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EditWalletConfigRequest) if err := dec(in); err != nil { @@ -1894,6 +1978,10 @@ var _Wallet_serviceDesc = grpc.ServiceDesc{ MethodName: "CreateWallet", Handler: _Wallet_CreateWallet_Handler, }, + { + MethodName: "DefaultWalletPath", + Handler: _Wallet_DefaultWalletPath_Handler, + }, { MethodName: "EditConfig", Handler: _Wallet_EditConfig_Handler, @@ -2308,44 +2396,28 @@ func (m *CreateWalletRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.RemoteCaCrtPath) i = encodeVarintWebApi(dAtA, i, uint64(len(m.RemoteCaCrtPath))) i-- - dAtA[i] = 0x5a + dAtA[i] = 0x4a } if len(m.RemoteKeyPath) > 0 { i -= len(m.RemoteKeyPath) copy(dAtA[i:], m.RemoteKeyPath) i = encodeVarintWebApi(dAtA, i, uint64(len(m.RemoteKeyPath))) i-- - dAtA[i] = 0x52 + dAtA[i] = 0x42 } if len(m.RemoteCrtPath) > 0 { i -= len(m.RemoteCrtPath) copy(dAtA[i:], m.RemoteCrtPath) i = encodeVarintWebApi(dAtA, i, uint64(len(m.RemoteCrtPath))) i-- - dAtA[i] = 0x4a + dAtA[i] = 0x3a } if len(m.RemoteAddr) > 0 { i -= len(m.RemoteAddr) copy(dAtA[i:], m.RemoteAddr) i = encodeVarintWebApi(dAtA, i, uint64(len(m.RemoteAddr))) i-- - dAtA[i] = 0x42 - } - if len(m.KeystoresPassword) > 0 { - i -= len(m.KeystoresPassword) - copy(dAtA[i:], m.KeystoresPassword) - i = encodeVarintWebApi(dAtA, i, uint64(len(m.KeystoresPassword))) - i-- - dAtA[i] = 0x3a - } - if len(m.KeystoresImported) > 0 { - for iNdEx := len(m.KeystoresImported) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.KeystoresImported[iNdEx]) - copy(dAtA[i:], m.KeystoresImported[iNdEx]) - i = encodeVarintWebApi(dAtA, i, uint64(len(m.KeystoresImported[iNdEx]))) - i-- - dAtA[i] = 0x32 - } + dAtA[i] = 0x32 } if m.NumAccounts != 0 { i = encodeVarintWebApi(dAtA, i, uint64(m.NumAccounts)) @@ -2432,6 +2504,40 @@ func (m *CreateWalletResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DefaultWalletResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DefaultWalletResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DefaultWalletResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.WalletDir) > 0 { + i -= len(m.WalletDir) + copy(dAtA[i:], m.WalletDir) + i = encodeVarintWebApi(dAtA, i, uint64(len(m.WalletDir))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *EditWalletConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2824,6 +2930,13 @@ func (m *AuthRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.WalletDir) > 0 { + i -= len(m.WalletDir) + copy(dAtA[i:], m.WalletDir) + i = encodeVarintWebApi(dAtA, i, uint64(len(m.WalletDir))) + i-- + dAtA[i] = 0x12 + } if len(m.Password) > 0 { i -= len(m.Password) copy(dAtA[i:], m.Password) @@ -2968,13 +3081,20 @@ func (m *ChangePasswordRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.PasswordConfirmation) i = encodeVarintWebApi(dAtA, i, uint64(len(m.PasswordConfirmation))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } if len(m.Password) > 0 { i -= len(m.Password) copy(dAtA[i:], m.Password) i = encodeVarintWebApi(dAtA, i, uint64(len(m.Password))) i-- + dAtA[i] = 0x12 + } + if len(m.CurrentPassword) > 0 { + i -= len(m.CurrentPassword) + copy(dAtA[i:], m.CurrentPassword) + i = encodeVarintWebApi(dAtA, i, uint64(len(m.CurrentPassword))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -3445,16 +3565,6 @@ func (m *CreateWalletRequest) Size() (n int) { if m.NumAccounts != 0 { n += 1 + sovWebApi(uint64(m.NumAccounts)) } - if len(m.KeystoresImported) > 0 { - for _, s := range m.KeystoresImported { - l = len(s) - n += 1 + l + sovWebApi(uint64(l)) - } - } - l = len(m.KeystoresPassword) - if l > 0 { - n += 1 + l + sovWebApi(uint64(l)) - } l = len(m.RemoteAddr) if l > 0 { n += 1 + l + sovWebApi(uint64(l)) @@ -3497,6 +3607,22 @@ func (m *CreateWalletResponse) Size() (n int) { return n } +func (m *DefaultWalletResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.WalletDir) + if l > 0 { + n += 1 + l + sovWebApi(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *EditWalletConfigRequest) Size() (n int) { if m == nil { return 0 @@ -3681,6 +3807,10 @@ func (m *AuthRequest) Size() (n int) { if l > 0 { n += 1 + l + sovWebApi(uint64(l)) } + l = len(m.WalletDir) + if l > 0 { + n += 1 + l + sovWebApi(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -3741,6 +3871,10 @@ func (m *ChangePasswordRequest) Size() (n int) { } var l int _ = l + l = len(m.CurrentPassword) + if l > 0 { + n += 1 + l + sovWebApi(uint64(l)) + } l = len(m.Password) if l > 0 { n += 1 + l + sovWebApi(uint64(l)) @@ -4130,70 +4264,6 @@ func (m *CreateWalletRequest) Unmarshal(dAtA []byte) error { } } case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KeystoresImported", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWebApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWebApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWebApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.KeystoresImported = append(m.KeystoresImported, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field KeystoresPassword", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWebApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthWebApi - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWebApi - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.KeystoresPassword = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RemoteAddr", wireType) } @@ -4225,7 +4295,7 @@ func (m *CreateWalletRequest) Unmarshal(dAtA []byte) error { } m.RemoteAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RemoteCrtPath", wireType) } @@ -4257,7 +4327,7 @@ func (m *CreateWalletRequest) Unmarshal(dAtA []byte) error { } m.RemoteCrtPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 10: + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RemoteKeyPath", wireType) } @@ -4289,7 +4359,7 @@ func (m *CreateWalletRequest) Unmarshal(dAtA []byte) error { } m.RemoteKeyPath = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 11: + case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field RemoteCaCrtPath", wireType) } @@ -4472,6 +4542,92 @@ func (m *CreateWalletResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *DefaultWalletResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWebApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DefaultWalletResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DefaultWalletResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WalletDir", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWebApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWebApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWebApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WalletDir = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWebApi(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthWebApi + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthWebApi + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *EditWalletConfigRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5665,6 +5821,38 @@ func (m *AuthRequest) Unmarshal(dAtA []byte) error { } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WalletDir", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWebApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWebApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWebApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WalletDir = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipWebApi(dAtA[iNdEx:]) @@ -6004,6 +6192,38 @@ func (m *ChangePasswordRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentPassword", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWebApi + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWebApi + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWebApi + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CurrentPassword = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Password", wireType) } @@ -6035,7 +6255,7 @@ func (m *ChangePasswordRequest) Unmarshal(dAtA []byte) error { } m.Password = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PasswordConfirmation", wireType) } diff --git a/proto/validator/accounts/v2/web_api.proto b/proto/validator/accounts/v2/web_api.proto index 67e760d5253a..1c8a77da8ac3 100644 --- a/proto/validator/accounts/v2/web_api.proto +++ b/proto/validator/accounts/v2/web_api.proto @@ -18,6 +18,11 @@ service Wallet { body: "*" }; } + rpc DefaultWalletPath(google.protobuf.Empty) returns (DefaultWalletResponse) { + option (google.api.http) = { + get: "/v2/validator/wallet/default", + }; + } rpc EditConfig(EditWalletConfigRequest) returns (WalletResponse) { option (google.api.http) = { post: "/v2/validator/wallet/config/edit", @@ -115,24 +120,24 @@ message CreateWalletRequest { string mnemonic = 4; // Number of accounts. uint64 num_accounts = 5; - // JSON-encoded keystore files to import during wallet creation. - repeated string keystores_imported = 6; - // Password to unlock imported keystore files. - string keystores_password = 7; // Remote address such as host.example.com:4000 for a gRPC remote signer server. - string remote_addr = 8; + string remote_addr = 6; // Path to client.crt for secure TLS connections to a remote signer server. - string remote_crt_path = 9; + string remote_crt_path = 7; // Path to client.key for secure TLS connections to a remote signer server. - string remote_key_path = 10; + string remote_key_path = 8; // Path to ca.crt for secure TLS connections to a remote signer server. - string remote_ca_crt_path = 11; + string remote_ca_crt_path = 9; } message CreateWalletResponse { - WalletResponse wallet = 1; - DepositDataResponse accounts_created = 2; + WalletResponse wallet = 1; + DepositDataResponse accounts_created = 2; +} + +message DefaultWalletResponse { + string wallet_dir = 1; } message EditWalletConfigRequest { @@ -205,6 +210,7 @@ message AccountRequest { message AuthRequest { string password = 1; + string wallet_dir = 2; } message AuthResponse { @@ -228,8 +234,9 @@ message NodeConnectionResponse { } message ChangePasswordRequest { - string password = 1; - string password_confirmation = 2; + string current_password = 1; + string password = 2; + string password_confirmation = 3; } message HasWalletResponse { diff --git a/proto/validator/accounts/v2_gateway/web_api.pb.go b/proto/validator/accounts/v2_gateway/web_api.pb.go index 1544b1e93d82..be48cf56258b 100755 --- a/proto/validator/accounts/v2_gateway/web_api.pb.go +++ b/proto/validator/accounts/v2_gateway/web_api.pb.go @@ -62,12 +62,10 @@ type CreateWalletRequest struct { WalletPassword string `protobuf:"bytes,3,opt,name=wallet_password,json=walletPassword,proto3" json:"wallet_password,omitempty"` Mnemonic string `protobuf:"bytes,4,opt,name=mnemonic,proto3" json:"mnemonic,omitempty"` NumAccounts uint64 `protobuf:"varint,5,opt,name=num_accounts,json=numAccounts,proto3" json:"num_accounts,omitempty"` - KeystoresImported []string `protobuf:"bytes,6,rep,name=keystores_imported,json=keystoresImported,proto3" json:"keystores_imported,omitempty"` - KeystoresPassword string `protobuf:"bytes,7,opt,name=keystores_password,json=keystoresPassword,proto3" json:"keystores_password,omitempty"` - RemoteAddr string `protobuf:"bytes,8,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"` - RemoteCrtPath string `protobuf:"bytes,9,opt,name=remote_crt_path,json=remoteCrtPath,proto3" json:"remote_crt_path,omitempty"` - RemoteKeyPath string `protobuf:"bytes,10,opt,name=remote_key_path,json=remoteKeyPath,proto3" json:"remote_key_path,omitempty"` - RemoteCaCrtPath string `protobuf:"bytes,11,opt,name=remote_ca_crt_path,json=remoteCaCrtPath,proto3" json:"remote_ca_crt_path,omitempty"` + RemoteAddr string `protobuf:"bytes,6,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"` + RemoteCrtPath string `protobuf:"bytes,7,opt,name=remote_crt_path,json=remoteCrtPath,proto3" json:"remote_crt_path,omitempty"` + RemoteKeyPath string `protobuf:"bytes,8,opt,name=remote_key_path,json=remoteKeyPath,proto3" json:"remote_key_path,omitempty"` + RemoteCaCrtPath string `protobuf:"bytes,9,opt,name=remote_ca_crt_path,json=remoteCaCrtPath,proto3" json:"remote_ca_crt_path,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -133,20 +131,6 @@ func (m *CreateWalletRequest) GetNumAccounts() uint64 { return 0 } -func (m *CreateWalletRequest) GetKeystoresImported() []string { - if m != nil { - return m.KeystoresImported - } - return nil -} - -func (m *CreateWalletRequest) GetKeystoresPassword() string { - if m != nil { - return m.KeystoresPassword - } - return "" -} - func (m *CreateWalletRequest) GetRemoteAddr() string { if m != nil { return m.RemoteAddr @@ -222,6 +206,45 @@ func (m *CreateWalletResponse) GetAccountsCreated() *DepositDataResponse { return nil } +type DefaultWalletResponse struct { + WalletDir string `protobuf:"bytes,1,opt,name=wallet_dir,json=walletDir,proto3" json:"wallet_dir,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DefaultWalletResponse) Reset() { *m = DefaultWalletResponse{} } +func (m *DefaultWalletResponse) String() string { return proto.CompactTextString(m) } +func (*DefaultWalletResponse) ProtoMessage() {} +func (*DefaultWalletResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8a5153635bfe042e, []int{2} +} + +func (m *DefaultWalletResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DefaultWalletResponse.Unmarshal(m, b) +} +func (m *DefaultWalletResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DefaultWalletResponse.Marshal(b, m, deterministic) +} +func (m *DefaultWalletResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_DefaultWalletResponse.Merge(m, src) +} +func (m *DefaultWalletResponse) XXX_Size() int { + return xxx_messageInfo_DefaultWalletResponse.Size(m) +} +func (m *DefaultWalletResponse) XXX_DiscardUnknown() { + xxx_messageInfo_DefaultWalletResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_DefaultWalletResponse proto.InternalMessageInfo + +func (m *DefaultWalletResponse) GetWalletDir() string { + if m != nil { + return m.WalletDir + } + return "" +} + type EditWalletConfigRequest struct { RemoteAddr string `protobuf:"bytes,1,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"` RemoteCrtPath string `protobuf:"bytes,2,opt,name=remote_crt_path,json=remoteCrtPath,proto3" json:"remote_crt_path,omitempty"` @@ -236,7 +259,7 @@ func (m *EditWalletConfigRequest) Reset() { *m = EditWalletConfigRequest func (m *EditWalletConfigRequest) String() string { return proto.CompactTextString(m) } func (*EditWalletConfigRequest) ProtoMessage() {} func (*EditWalletConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{2} + return fileDescriptor_8a5153635bfe042e, []int{3} } func (m *EditWalletConfigRequest) XXX_Unmarshal(b []byte) error { @@ -296,7 +319,7 @@ func (m *GenerateMnemonicResponse) Reset() { *m = GenerateMnemonicRespon func (m *GenerateMnemonicResponse) String() string { return proto.CompactTextString(m) } func (*GenerateMnemonicResponse) ProtoMessage() {} func (*GenerateMnemonicResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{3} + return fileDescriptor_8a5153635bfe042e, []int{4} } func (m *GenerateMnemonicResponse) XXX_Unmarshal(b []byte) error { @@ -337,7 +360,7 @@ func (m *WalletResponse) Reset() { *m = WalletResponse{} } func (m *WalletResponse) String() string { return proto.CompactTextString(m) } func (*WalletResponse) ProtoMessage() {} func (*WalletResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{4} + return fileDescriptor_8a5153635bfe042e, []int{5} } func (m *WalletResponse) XXX_Unmarshal(b []byte) error { @@ -393,7 +416,7 @@ func (m *ListAccountsRequest) Reset() { *m = ListAccountsRequest{} } func (m *ListAccountsRequest) String() string { return proto.CompactTextString(m) } func (*ListAccountsRequest) ProtoMessage() {} func (*ListAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{5} + return fileDescriptor_8a5153635bfe042e, []int{6} } func (m *ListAccountsRequest) XXX_Unmarshal(b []byte) error { @@ -455,7 +478,7 @@ func (m *ListAccountsResponse) Reset() { *m = ListAccountsResponse{} } func (m *ListAccountsResponse) String() string { return proto.CompactTextString(m) } func (*ListAccountsResponse) ProtoMessage() {} func (*ListAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{6} + return fileDescriptor_8a5153635bfe042e, []int{7} } func (m *ListAccountsResponse) XXX_Unmarshal(b []byte) error { @@ -511,7 +534,7 @@ func (m *Account) Reset() { *m = Account{} } func (m *Account) String() string { return proto.CompactTextString(m) } func (*Account) ProtoMessage() {} func (*Account) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{7} + return fileDescriptor_8a5153635bfe042e, []int{8} } func (m *Account) XXX_Unmarshal(b []byte) error { @@ -572,7 +595,7 @@ func (m *AccountRequest) Reset() { *m = AccountRequest{} } func (m *AccountRequest) String() string { return proto.CompactTextString(m) } func (*AccountRequest) ProtoMessage() {} func (*AccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{8} + return fileDescriptor_8a5153635bfe042e, []int{9} } func (m *AccountRequest) XXX_Unmarshal(b []byte) error { @@ -609,6 +632,7 @@ func (m *AccountRequest) GetIndices() []uint64 { type AuthRequest struct { Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` + WalletDir string `protobuf:"bytes,2,opt,name=wallet_dir,json=walletDir,proto3" json:"wallet_dir,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -618,7 +642,7 @@ func (m *AuthRequest) Reset() { *m = AuthRequest{} } func (m *AuthRequest) String() string { return proto.CompactTextString(m) } func (*AuthRequest) ProtoMessage() {} func (*AuthRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{9} + return fileDescriptor_8a5153635bfe042e, []int{10} } func (m *AuthRequest) XXX_Unmarshal(b []byte) error { @@ -646,6 +670,13 @@ func (m *AuthRequest) GetPassword() string { return "" } +func (m *AuthRequest) GetWalletDir() string { + if m != nil { + return m.WalletDir + } + return "" +} + type AuthResponse struct { Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` TokenExpiration uint64 `protobuf:"varint,2,opt,name=token_expiration,json=tokenExpiration,proto3" json:"token_expiration,omitempty"` @@ -658,7 +689,7 @@ func (m *AuthResponse) Reset() { *m = AuthResponse{} } func (m *AuthResponse) String() string { return proto.CompactTextString(m) } func (*AuthResponse) ProtoMessage() {} func (*AuthResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{10} + return fileDescriptor_8a5153635bfe042e, []int{11} } func (m *AuthResponse) XXX_Unmarshal(b []byte) error { @@ -708,7 +739,7 @@ func (m *NodeConnectionResponse) Reset() { *m = NodeConnectionResponse{} func (m *NodeConnectionResponse) String() string { return proto.CompactTextString(m) } func (*NodeConnectionResponse) ProtoMessage() {} func (*NodeConnectionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{11} + return fileDescriptor_8a5153635bfe042e, []int{12} } func (m *NodeConnectionResponse) XXX_Unmarshal(b []byte) error { @@ -765,8 +796,9 @@ func (m *NodeConnectionResponse) GetDepositContractAddress() []byte { } type ChangePasswordRequest struct { - Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` - PasswordConfirmation string `protobuf:"bytes,2,opt,name=password_confirmation,json=passwordConfirmation,proto3" json:"password_confirmation,omitempty"` + CurrentPassword string `protobuf:"bytes,1,opt,name=current_password,json=currentPassword,proto3" json:"current_password,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + PasswordConfirmation string `protobuf:"bytes,3,opt,name=password_confirmation,json=passwordConfirmation,proto3" json:"password_confirmation,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -776,7 +808,7 @@ func (m *ChangePasswordRequest) Reset() { *m = ChangePasswordRequest{} } func (m *ChangePasswordRequest) String() string { return proto.CompactTextString(m) } func (*ChangePasswordRequest) ProtoMessage() {} func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{12} + return fileDescriptor_8a5153635bfe042e, []int{13} } func (m *ChangePasswordRequest) XXX_Unmarshal(b []byte) error { @@ -797,6 +829,13 @@ func (m *ChangePasswordRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ChangePasswordRequest proto.InternalMessageInfo +func (m *ChangePasswordRequest) GetCurrentPassword() string { + if m != nil { + return m.CurrentPassword + } + return "" +} + func (m *ChangePasswordRequest) GetPassword() string { if m != nil { return m.Password @@ -822,7 +861,7 @@ func (m *HasWalletResponse) Reset() { *m = HasWalletResponse{} } func (m *HasWalletResponse) String() string { return proto.CompactTextString(m) } func (*HasWalletResponse) ProtoMessage() {} func (*HasWalletResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{13} + return fileDescriptor_8a5153635bfe042e, []int{14} } func (m *HasWalletResponse) XXX_Unmarshal(b []byte) error { @@ -862,7 +901,7 @@ func (m *ImportKeystoresRequest) Reset() { *m = ImportKeystoresRequest{} func (m *ImportKeystoresRequest) String() string { return proto.CompactTextString(m) } func (*ImportKeystoresRequest) ProtoMessage() {} func (*ImportKeystoresRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{14} + return fileDescriptor_8a5153635bfe042e, []int{15} } func (m *ImportKeystoresRequest) XXX_Unmarshal(b []byte) error { @@ -908,7 +947,7 @@ func (m *ImportKeystoresResponse) Reset() { *m = ImportKeystoresResponse func (m *ImportKeystoresResponse) String() string { return proto.CompactTextString(m) } func (*ImportKeystoresResponse) ProtoMessage() {} func (*ImportKeystoresResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{15} + return fileDescriptor_8a5153635bfe042e, []int{16} } func (m *ImportKeystoresResponse) XXX_Unmarshal(b []byte) error { @@ -947,7 +986,7 @@ func (m *CreateAccountRequest) Reset() { *m = CreateAccountRequest{} } func (m *CreateAccountRequest) String() string { return proto.CompactTextString(m) } func (*CreateAccountRequest) ProtoMessage() {} func (*CreateAccountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{16} + return fileDescriptor_8a5153635bfe042e, []int{17} } func (m *CreateAccountRequest) XXX_Unmarshal(b []byte) error { @@ -988,7 +1027,7 @@ func (m *DepositMessage) Reset() { *m = DepositMessage{} } func (m *DepositMessage) String() string { return proto.CompactTextString(m) } func (*DepositMessage) ProtoMessage() {} func (*DepositMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{17} + return fileDescriptor_8a5153635bfe042e, []int{18} } func (m *DepositMessage) XXX_Unmarshal(b []byte) error { @@ -1041,7 +1080,7 @@ func (m *DepositDataResponse) Reset() { *m = DepositDataResponse{} } func (m *DepositDataResponse) String() string { return proto.CompactTextString(m) } func (*DepositDataResponse) ProtoMessage() {} func (*DepositDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{18} + return fileDescriptor_8a5153635bfe042e, []int{19} } func (m *DepositDataResponse) XXX_Unmarshal(b []byte) error { @@ -1080,7 +1119,7 @@ func (m *DepositDataResponse_DepositData) Reset() { *m = DepositDataResp func (m *DepositDataResponse_DepositData) String() string { return proto.CompactTextString(m) } func (*DepositDataResponse_DepositData) ProtoMessage() {} func (*DepositDataResponse_DepositData) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{18, 0} + return fileDescriptor_8a5153635bfe042e, []int{19, 0} } func (m *DepositDataResponse_DepositData) XXX_Unmarshal(b []byte) error { @@ -1120,7 +1159,7 @@ func (m *BackupAccountsRequest) Reset() { *m = BackupAccountsRequest{} } func (m *BackupAccountsRequest) String() string { return proto.CompactTextString(m) } func (*BackupAccountsRequest) ProtoMessage() {} func (*BackupAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{19} + return fileDescriptor_8a5153635bfe042e, []int{20} } func (m *BackupAccountsRequest) XXX_Unmarshal(b []byte) error { @@ -1166,7 +1205,7 @@ func (m *BackupAccountsResponse) Reset() { *m = BackupAccountsResponse{} func (m *BackupAccountsResponse) String() string { return proto.CompactTextString(m) } func (*BackupAccountsResponse) ProtoMessage() {} func (*BackupAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{20} + return fileDescriptor_8a5153635bfe042e, []int{21} } func (m *BackupAccountsResponse) XXX_Unmarshal(b []byte) error { @@ -1205,7 +1244,7 @@ func (m *DeleteAccountsRequest) Reset() { *m = DeleteAccountsRequest{} } func (m *DeleteAccountsRequest) String() string { return proto.CompactTextString(m) } func (*DeleteAccountsRequest) ProtoMessage() {} func (*DeleteAccountsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{21} + return fileDescriptor_8a5153635bfe042e, []int{22} } func (m *DeleteAccountsRequest) XXX_Unmarshal(b []byte) error { @@ -1244,7 +1283,7 @@ func (m *DeleteAccountsResponse) Reset() { *m = DeleteAccountsResponse{} func (m *DeleteAccountsResponse) String() string { return proto.CompactTextString(m) } func (*DeleteAccountsResponse) ProtoMessage() {} func (*DeleteAccountsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8a5153635bfe042e, []int{22} + return fileDescriptor_8a5153635bfe042e, []int{23} } func (m *DeleteAccountsResponse) XXX_Unmarshal(b []byte) error { @@ -1276,6 +1315,7 @@ func init() { proto.RegisterEnum("ethereum.validator.accounts.v2.KeymanagerKind", KeymanagerKind_name, KeymanagerKind_value) proto.RegisterType((*CreateWalletRequest)(nil), "ethereum.validator.accounts.v2.CreateWalletRequest") proto.RegisterType((*CreateWalletResponse)(nil), "ethereum.validator.accounts.v2.CreateWalletResponse") + proto.RegisterType((*DefaultWalletResponse)(nil), "ethereum.validator.accounts.v2.DefaultWalletResponse") proto.RegisterType((*EditWalletConfigRequest)(nil), "ethereum.validator.accounts.v2.EditWalletConfigRequest") proto.RegisterType((*GenerateMnemonicResponse)(nil), "ethereum.validator.accounts.v2.GenerateMnemonicResponse") proto.RegisterType((*WalletResponse)(nil), "ethereum.validator.accounts.v2.WalletResponse") @@ -1307,125 +1347,129 @@ func init() { } var fileDescriptor_8a5153635bfe042e = []byte{ - // 1878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x6f, 0x23, 0x49, - 0x15, 0xa7, 0xed, 0x7c, 0x38, 0xcf, 0x8e, 0x93, 0x54, 0x12, 0x8f, 0xd7, 0x33, 0xb3, 0xc9, 0xd4, - 0xb2, 0x93, 0x8f, 0xd9, 0xd8, 0x8b, 0xb3, 0x3b, 0x13, 0xc2, 0x01, 0xcd, 0x38, 0xde, 0x9d, 0x51, - 0x76, 0x66, 0x47, 0xbd, 0x11, 0x7b, 0x82, 0x56, 0xc5, 0x5d, 0xd3, 0x2e, 0xd9, 0xee, 0xee, 0xed, - 0x2e, 0xe7, 0x8b, 0xdb, 0x8a, 0x2b, 0x1c, 0x96, 0x03, 0x42, 0x82, 0x03, 0x23, 0x71, 0x81, 0xcb, - 0x20, 0x21, 0x21, 0x71, 0xe0, 0xc0, 0xbf, 0xc0, 0x1d, 0x2e, 0x9c, 0x38, 0xf2, 0x17, 0xa0, 0xfa, - 0xe8, 0x6e, 0xdb, 0xe9, 0xd0, 0xc9, 0x20, 0x2e, 0x91, 0xeb, 0xd5, 0xfb, 0xf8, 0xf5, 0x7b, 0xaf, - 0xde, 0x47, 0x60, 0xcb, 0x0f, 0x3c, 0xee, 0x35, 0x4e, 0x48, 0x9f, 0xd9, 0x84, 0x7b, 0x41, 0x83, - 0x74, 0x3a, 0xde, 0xd0, 0xe5, 0x61, 0xe3, 0xa4, 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85, 0xec, 0x42, 0x19, 0x99, 0x36, 0x0b, 0x82, - 0xf0, 0x05, 0xbb, 0xa0, 0xe8, 0x2e, 0x80, 0xbc, 0xe4, 0x5e, 0x8f, 0xba, 0x3a, 0x61, 0x24, 0xfb, - 0x91, 0x20, 0x08, 0xb8, 0xa4, 0xdf, 0x97, 0xd9, 0x51, 0x30, 0xc5, 0x4f, 0xfc, 0xda, 0x80, 0x95, - 0x71, 0x50, 0x3a, 0xbe, 0x2d, 0x28, 0xc4, 0x05, 0xcc, 0x90, 0xce, 0xdd, 0xc8, 0x72, 0xae, 0xd6, - 0x61, 0xc6, 0x82, 0x22, 0x89, 0x5d, 0x7a, 0x26, 0x52, 0x24, 0xc6, 0xa4, 0x93, 0x5d, 0x90, 0x5f, - 0xc6, 0xb8, 0xee, 0x02, 0x70, 0x8f, 0x93, 0xbe, 0xfa, 0xa8, 0xbc, 0xfc, 0xa8, 0x39, 0x49, 0x11, - 0x5f, 0x85, 0xff, 0x60, 0xc0, 0xac, 0x56, 0x8e, 0x9a, 0xb0, 0xaa, 0xad, 0x33, 0xd7, 0xb1, 0xfc, - 0xe1, 0x71, 0x9f, 0x75, 0xac, 0x28, 0x06, 0x25, 0x73, 0x39, 0xb9, 0x7c, 0x29, 0xef, 0x0e, 0xe9, - 0xb9, 0x28, 0xc8, 0x1a, 0x92, 0xe5, 0x92, 0x41, 0x14, 0x9a, 0xa2, 0xa6, 0xbd, 0x20, 0x03, 0x2a, - 0x90, 0x4e, 0x06, 0x20, 0x2f, 0x15, 0xce, 0xdb, 0x63, 0xde, 0xdf, 0x10, 0x7c, 0x01, 0x3b, 0x91, - 0xad, 0x70, 0xf4, 0xad, 0x95, 0x13, 0xb2, 0x7c, 0x6a, 0x87, 0x50, 0x8e, 0xfc, 0x91, 0x94, 0x86, - 0x04, 0xae, 0x72, 0x6a, 0xc9, 0x04, 0x3f, 0x42, 0x19, 0xa2, 0x2a, 0xcc, 0x32, 0xd7, 0x66, 0x1d, - 0x1a, 0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xe2, 0x4c, 0x5f, 0x68, 0xf0, 0x07, 0x12, 0xe7, 0x7d, 0x34, 0x81, 0xb3, 0x2b, 0x91, 0x34, - 0xe4, 0x92, 0xd3, 0x89, 0xa5, 0x9a, 0xdf, 0xe4, 0x60, 0x4a, 0xec, 0x5a, 0xe8, 0x6b, 0x03, 0xa6, - 0x3f, 0xf3, 0x1c, 0xe6, 0xa2, 0x07, 0x99, 0x3b, 0x72, 0xb2, 0xc6, 0xd5, 0x3e, 0xb8, 0x1e, 0xf3, - 0x78, 0x62, 0xe2, 0xe5, 0x71, 0x6c, 0x7d, 0x61, 0x57, 0x44, 0xf9, 0x27, 0x06, 0xcc, 0x7c, 0xc1, - 0x1c, 0x77, 0xe8, 0xff, 0x3f, 0x51, 0xac, 0x49, 0x14, 0xef, 0xe0, 0x89, 0x5e, 0x12, 0x4a, 0xc3, - 0xfb, 0xc6, 0xf6, 0xf1, 0x8c, 0x0c, 0xc5, 0xee, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x86, 0x7d, - 0xe0, 0x8d, 0x88, 0x16, 0x00, 0x00, + // 1942 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x6f, 0x23, 0xc7, + 0x11, 0xce, 0x50, 0x2f, 0xb2, 0x48, 0x51, 0x54, 0x4b, 0xe2, 0xd2, 0xdc, 0x97, 0xb6, 0x6d, 0xaf, + 0x1e, 0xeb, 0x25, 0x1d, 0xca, 0xde, 0x55, 0x94, 0x43, 0xb0, 0x4b, 0xd1, 0x5e, 0x41, 0xde, 0xf5, + 0x62, 0x2c, 0xc4, 0xa7, 0x64, 0xd0, 0xe2, 0xf4, 0x52, 0x0d, 0x92, 0x33, 0xf4, 0x4c, 0x53, 0xaf, + 0xdc, 0x8c, 0x1c, 0x72, 0x48, 0x72, 0xb0, 0x0f, 0x41, 0x0e, 0x39, 0x64, 0x81, 0x20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16, 0x63, 0x63, 0x83, 0xec, + 0x76, 0x2f, 0xb3, 0xd4, 0x87, 0xd9, 0x2f, 0x25, 0x65, 0x02, 0xc1, 0xef, 0x48, 0x30, 0x77, 0xd0, + 0xad, 0x54, 0x30, 0xb6, 0x3a, 0x83, 0x5e, 0x1b, 0x00, 0x62, 0x10, 0x51, 0x1d, 0x29, 0x7a, 0x9c, + 0xa5, 0xeb, 0x92, 0xa1, 0xa5, 0x7e, 0xcd, 0x01, 0x0d, 0x3f, 0x90, 0xe8, 0xde, 0xc5, 0xab, 0xe9, + 0xa6, 0x92, 0xb2, 0x9b, 0xd4, 0x66, 0x5c, 0xd8, 0x8b, 0x43, 0x29, 0xaa, 0xf3, 0x52, 0x4b, 0x5d, + 0x17, 0xc4, 0x2d, 0x09, 0xa2, 0x8a, 0x96, 0xd3, 0x40, 0xa0, 0x5f, 0x18, 0x50, 0x49, 0x8e, 0x3a, + 0x97, 0xaa, 0xde, 0xce, 0x52, 0x7d, 0xd9, 0xd0, 0x84, 0xd7, 0x24, 0x88, 0x7b, 0xe8, 0x6e, 0x1c, + 0x44, 0x30, 0x38, 0x35, 0x7b, 0xfa, 0x20, 0xfa, 0xa5, 0x01, 0xe5, 0x78, 0x13, 0x81, 0x32, 0x43, + 0x23, 0xb5, 0xe9, 0xa8, 0x5f, 0x72, 0x09, 0xfc, 0x50, 0x42, 0x59, 0xc3, 0x38, 0xd5, 0x29, 0x41, + 0x8e, 0x0b, 0xdd, 0xf2, 0x67, 0x03, 0x16, 0x12, 0xe5, 0x18, 0x3d, 0xca, 0x42, 0x94, 0xde, 0x37, + 0xd4, 0x1f, 0x5f, 0xfb, 0x9c, 0x36, 0xdf, 0xfb, 0x12, 0xf3, 0x26, 0x7e, 0x37, 0x15, 0x73, 0xd8, + 0x42, 0x34, 0x55, 0x03, 0xb0, 0x63, 0x6c, 0xb6, 0xfe, 0x3a, 0x03, 0xf9, 0xf0, 0xff, 0x91, 0x3f, + 0x1a, 0x30, 0x1f, 0x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f, 0xff, 0xd4, 0x80, 0xd9, 0xcf, 0x58, + 0xcf, 0x19, 0x8f, 0xbe, 0x4d, 0x14, 0x77, 0x25, 0x8a, 0xb7, 0x70, 0xa2, 0x96, 0xf8, 0x52, 0xf1, + 0x8e, 0xb1, 0x79, 0x38, 0x2b, 0x5d, 0xb1, 0xf5, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x1a, + 0x5b, 0xca, 0x38, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1442,6 +1486,7 @@ const _ = grpc.SupportPackageIsVersion6 type WalletClient interface { HasWallet(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*HasWalletResponse, error) CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) + DefaultWalletPath(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DefaultWalletResponse, error) EditConfig(ctx context.Context, in *EditWalletConfigRequest, opts ...grpc.CallOption) (*WalletResponse, error) WalletConfig(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*WalletResponse, error) GenerateMnemonic(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GenerateMnemonicResponse, error) @@ -1475,6 +1520,15 @@ func (c *walletClient) CreateWallet(ctx context.Context, in *CreateWalletRequest return out, nil } +func (c *walletClient) DefaultWalletPath(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*DefaultWalletResponse, error) { + out := new(DefaultWalletResponse) + err := c.cc.Invoke(ctx, "/ethereum.validator.accounts.v2.Wallet/DefaultWalletPath", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *walletClient) EditConfig(ctx context.Context, in *EditWalletConfigRequest, opts ...grpc.CallOption) (*WalletResponse, error) { out := new(WalletResponse) err := c.cc.Invoke(ctx, "/ethereum.validator.accounts.v2.Wallet/EditConfig", in, out, opts...) @@ -1524,6 +1578,7 @@ func (c *walletClient) ImportKeystores(ctx context.Context, in *ImportKeystoresR type WalletServer interface { HasWallet(context.Context, *empty.Empty) (*HasWalletResponse, error) CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error) + DefaultWalletPath(context.Context, *empty.Empty) (*DefaultWalletResponse, error) EditConfig(context.Context, *EditWalletConfigRequest) (*WalletResponse, error) WalletConfig(context.Context, *empty.Empty) (*WalletResponse, error) GenerateMnemonic(context.Context, *empty.Empty) (*GenerateMnemonicResponse, error) @@ -1541,6 +1596,9 @@ func (*UnimplementedWalletServer) HasWallet(ctx context.Context, req *empty.Empt func (*UnimplementedWalletServer) CreateWallet(ctx context.Context, req *CreateWalletRequest) (*CreateWalletResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateWallet not implemented") } +func (*UnimplementedWalletServer) DefaultWalletPath(ctx context.Context, req *empty.Empty) (*DefaultWalletResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DefaultWalletPath not implemented") +} func (*UnimplementedWalletServer) EditConfig(ctx context.Context, req *EditWalletConfigRequest) (*WalletResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method EditConfig not implemented") } @@ -1597,6 +1655,24 @@ func _Wallet_CreateWallet_Handler(srv interface{}, ctx context.Context, dec func return interceptor(ctx, in, info, handler) } +func _Wallet_DefaultWalletPath_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(empty.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletServer).DefaultWalletPath(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ethereum.validator.accounts.v2.Wallet/DefaultWalletPath", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletServer).DefaultWalletPath(ctx, req.(*empty.Empty)) + } + return interceptor(ctx, in, info, handler) +} + func _Wallet_EditConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(EditWalletConfigRequest) if err := dec(in); err != nil { @@ -1699,6 +1775,10 @@ var _Wallet_serviceDesc = grpc.ServiceDesc{ MethodName: "CreateWallet", Handler: _Wallet_CreateWallet_Handler, }, + { + MethodName: "DefaultWalletPath", + Handler: _Wallet_DefaultWalletPath_Handler, + }, { MethodName: "EditConfig", Handler: _Wallet_EditConfig_Handler, diff --git a/proto/validator/accounts/v2_gateway/web_api.pb.gw.go b/proto/validator/accounts/v2_gateway/web_api.pb.gw.go index 4097b9a0f68d..df0168fc34d8 100755 --- a/proto/validator/accounts/v2_gateway/web_api.pb.gw.go +++ b/proto/validator/accounts/v2_gateway/web_api.pb.gw.go @@ -84,6 +84,24 @@ func local_request_Wallet_CreateWallet_0(ctx context.Context, marshaler runtime. } +func request_Wallet_DefaultWalletPath_0(ctx context.Context, marshaler runtime.Marshaler, client WalletClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq empty.Empty + var metadata runtime.ServerMetadata + + msg, err := client.DefaultWalletPath(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Wallet_DefaultWalletPath_0(ctx context.Context, marshaler runtime.Marshaler, server WalletServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq empty.Empty + var metadata runtime.ServerMetadata + + msg, err := server.DefaultWalletPath(ctx, &protoReq) + return msg, metadata, err + +} + func request_Wallet_EditConfig_0(ctx context.Context, marshaler runtime.Marshaler, client WalletClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq EditWalletConfigRequest var metadata runtime.ServerMetadata @@ -491,6 +509,26 @@ func RegisterWalletHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) + mux.Handle("GET", pattern_Wallet_DefaultWalletPath_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Wallet_DefaultWalletPath_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Wallet_DefaultWalletPath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Wallet_EditConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -836,6 +874,26 @@ func RegisterWalletHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) + mux.Handle("GET", pattern_Wallet_DefaultWalletPath_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Wallet_DefaultWalletPath_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Wallet_DefaultWalletPath_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("POST", pattern_Wallet_EditConfig_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -944,6 +1002,8 @@ var ( pattern_Wallet_CreateWallet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "validator", "wallet", "create"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Wallet_DefaultWalletPath_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "validator", "wallet", "default"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Wallet_EditConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"v2", "validator", "wallet", "config", "edit"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Wallet_WalletConfig_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v2", "validator", "wallet"}, "", runtime.AssumeColonVerbOpt(true))) @@ -960,6 +1020,8 @@ var ( forward_Wallet_CreateWallet_0 = runtime.ForwardResponseMessage + forward_Wallet_DefaultWalletPath_0 = runtime.ForwardResponseMessage + forward_Wallet_EditConfig_0 = runtime.ForwardResponseMessage forward_Wallet_WalletConfig_0 = runtime.ForwardResponseMessage diff --git a/validator/accounts/v2/accounts_backup_test.go b/validator/accounts/v2/accounts_backup_test.go index 24794962e19a..a060d57cd411 100644 --- a/validator/accounts/v2/accounts_backup_test.go +++ b/validator/accounts/v2/accounts_backup_test.go @@ -186,14 +186,15 @@ func TestBackupAccounts_Noninteractive_Direct(t *testing.T) { backupPasswordFile: backupPasswordFile, backupDir: backupDir, }) - _, err = CreateWalletWithKeymanager(cliCtx.Context, &CreateWalletConfig{ + w, err := CreateWalletWithKeymanager(cliCtx.Context, &CreateWalletConfig{ WalletCfg: &wallet.Config{ WalletDir: walletDir, KeymanagerKind: v2keymanager.Direct, - WalletPassword: "Passwordz0320$", + WalletPassword: password, }, }) require.NoError(t, err) + require.NoError(t, w.SaveHashedPassword(cliCtx.Context)) // We attempt to import accounts we wrote to the keys directory // into our newly created wallet. diff --git a/validator/accounts/v2/accounts_delete_test.go b/validator/accounts/v2/accounts_delete_test.go index 902f926b283f..affef06f9c22 100644 --- a/validator/accounts/v2/accounts_delete_test.go +++ b/validator/accounts/v2/accounts_delete_test.go @@ -59,6 +59,7 @@ func TestDeleteAccounts_Noninteractive(t *testing.T) { }, }) require.NoError(t, err) + require.NoError(t, w.SaveHashedPassword(cliCtx.Context)) // We attempt to import accounts. require.NoError(t, ImportAccountsCli(cliCtx)) diff --git a/validator/accounts/v2/accounts_exit_test.go b/validator/accounts/v2/accounts_exit_test.go index af72722c34e4..15fa50ca6d9a 100644 --- a/validator/accounts/v2/accounts_exit_test.go +++ b/validator/accounts/v2/accounts_exit_test.go @@ -19,6 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/shared/testutil/require" "github.com/prysmaticlabs/prysm/validator/accounts/v2/wallet" v2keymanager "github.com/prysmaticlabs/prysm/validator/keymanager/v2" + "github.com/prysmaticlabs/prysm/validator/keymanager/v2/direct" ) func TestExitAccountsCli_Ok(t *testing.T) { @@ -71,14 +72,15 @@ func TestExitAccountsCli_Ok(t *testing.T) { // Flag required for ExitAccounts to work. voluntaryExitPublicKeys: keystore.Pubkey, }) - _, err = CreateWalletWithKeymanager(cliCtx.Context, &CreateWalletConfig{ + w, err := CreateWalletWithKeymanager(cliCtx.Context, &CreateWalletConfig{ WalletCfg: &wallet.Config{ WalletDir: walletDir, KeymanagerKind: v2keymanager.Direct, - WalletPassword: "Passwordz0320$", + WalletPassword: password, }, }) require.NoError(t, err) + require.NoError(t, w.SaveHashedPassword(cliCtx.Context)) require.NoError(t, ImportAccountsCli(cliCtx)) validatingPublicKeys, keymanager, err := prepareWallet(cliCtx) @@ -109,6 +111,7 @@ func TestExitAccountsCli_Ok(t *testing.T) { } func TestPrepareWallet_EmptyWalletReturnsError(t *testing.T) { + direct.ResetCaches() walletDir, _, passwordFilePath := setupWalletAndPasswordsDir(t) cliCtx := setupWalletCtx(t, &testWalletConfig{ walletDir: walletDir, diff --git a/validator/accounts/v2/accounts_import.go b/validator/accounts/v2/accounts_import.go index 6b8e6aa95947..1c3c2a63621b 100644 --- a/validator/accounts/v2/accounts_import.go +++ b/validator/accounts/v2/accounts_import.go @@ -68,8 +68,8 @@ func (fileNames byDerivationPath) Swap(i, j int) { // ImportAccountsConfig defines values to run the import accounts function. type ImportAccountsConfig struct { - Wallet *wallet.Wallet Keystores []*v2keymanager.Keystore + Keymanager *direct.Keymanager AccountPassword string } @@ -103,10 +103,19 @@ func ImportAccountsCli(cliCtx *cli.Context) error { return errors.Wrap(err, "could not initialize wallet") } + km, err := w.InitializeKeymanager(cliCtx.Context, true /* skip mnemonic confirm */) + if err != nil { + return err + } + keymanager, ok := km.(*direct.Keymanager) + if !ok { + return errors.Wrap(err, "Only non-HD wallets can import keystores") + } + // Check if the user wishes to import a one-off, private key directly // as an account into the Prysm validator. if cliCtx.IsSet(flags.ImportPrivateKeyFileFlag.Name) { - return importPrivateKeyAsAccount(cliCtx, w) + return importPrivateKeyAsAccount(cliCtx, w, keymanager) } keysDir, err := prompt.InputDirectory(cliCtx, prompt.ImportKeysDirPromptText, flags.KeysDirFlag) @@ -172,7 +181,7 @@ func ImportAccountsCli(cliCtx *cli.Context) error { } fmt.Println("Importing accounts, this may take a while...") if err := ImportAccounts(cliCtx.Context, &ImportAccountsConfig{ - Wallet: w, + Keymanager: keymanager, Keystores: keystoresImported, AccountPassword: accountsPassword, }); err != nil { @@ -188,27 +197,7 @@ func ImportAccountsCli(cliCtx *cli.Context) error { // ImportAccounts can import external, EIP-2335 compliant keystore.json files as // new accounts into the Prysm validator wallet. func ImportAccounts(ctx context.Context, cfg *ImportAccountsConfig) error { - if cfg.Wallet.KeymanagerKind() != v2keymanager.Direct { - return errors.New( - "only non-HD wallets can import accounts, try creating a new wallet with wallet-v2 create", - ) - } - opts, err := cfg.Wallet.ReadKeymanagerConfigFromDisk(ctx) - if err != nil { - return err - } - directOpts, err := direct.UnmarshalOptionsFile(opts) - if err != nil { - return err - } - km, err := direct.NewKeymanager(ctx, &direct.SetupConfig{ - Wallet: cfg.Wallet, - Opts: directOpts, - }) - if err != nil { - return err - } - return km.ImportKeystores( + return cfg.Keymanager.ImportKeystores( ctx, cfg.Keystores, cfg.AccountPassword, @@ -217,7 +206,7 @@ func ImportAccounts(ctx context.Context, cfg *ImportAccountsConfig) error { // Imports a one-off file containing a private key as a hex string into // the Prysm validator's accounts. -func importPrivateKeyAsAccount(cliCtx *cli.Context, wallet *wallet.Wallet) error { +func importPrivateKeyAsAccount(cliCtx *cli.Context, wallet *wallet.Wallet, keymanager *direct.Keymanager) error { privKeyFile := cliCtx.String(flags.ImportPrivateKeyFileFlag.Name) fullPath, err := fileutil.ExpandPath(privKeyFile) if err != nil { @@ -251,7 +240,7 @@ func importPrivateKeyAsAccount(cliCtx *cli.Context, wallet *wallet.Wallet) error if err := ImportAccounts( cliCtx.Context, &ImportAccountsConfig{ - Wallet: wallet, + Keymanager: keymanager, AccountPassword: wallet.Password(), Keystores: []*v2keymanager.Keystore{keystore}, }, diff --git a/validator/accounts/v2/accounts_import_test.go b/validator/accounts/v2/accounts_import_test.go index 37318d063219..bd2fbe60614c 100644 --- a/validator/accounts/v2/accounts_import_test.go +++ b/validator/accounts/v2/accounts_import_test.go @@ -1,6 +1,7 @@ package v2 import ( + "context" "crypto/rand" "encoding/json" "fmt" @@ -27,6 +28,7 @@ import ( ) func TestImport_Noninteractive(t *testing.T) { + direct.ResetCaches() walletDir, passwordsDir, passwordFilePath := setupWalletAndPasswordsDir(t) randPath, err := rand.Int(rand.Reader, big.NewInt(1000000)) require.NoError(t, err, "Could not generate random file path") @@ -52,6 +54,7 @@ func TestImport_Noninteractive(t *testing.T) { }, }) require.NoError(t, err) + require.NoError(t, w.SaveHashedPassword(context.Background())) keymanager, err := direct.NewKeymanager( cliCtx.Context, &direct.SetupConfig{ @@ -87,6 +90,7 @@ func TestImport_Noninteractive(t *testing.T) { } func TestImport_Noninteractive_RandomName(t *testing.T) { + direct.ResetCaches() walletDir, passwordsDir, passwordFilePath := setupWalletAndPasswordsDir(t) randPath, err := rand.Int(rand.Reader, big.NewInt(1000000)) require.NoError(t, err, "Could not generate random file path") @@ -112,6 +116,7 @@ func TestImport_Noninteractive_RandomName(t *testing.T) { }, }) require.NoError(t, err) + require.NoError(t, w.SaveHashedPassword(context.Background())) keymanager, err := direct.NewKeymanager( cliCtx.Context, &direct.SetupConfig{ @@ -147,6 +152,7 @@ func TestImport_Noninteractive_RandomName(t *testing.T) { } func TestImport_Noninteractive_Filepath(t *testing.T) { + direct.ResetCaches() walletDir, passwordsDir, passwordFilePath := setupWalletAndPasswordsDir(t) randPath, err := rand.Int(rand.Reader, big.NewInt(1000000)) require.NoError(t, err, "Could not generate random file path") @@ -173,6 +179,7 @@ func TestImport_Noninteractive_Filepath(t *testing.T) { }, }) require.NoError(t, err) + require.NoError(t, w.SaveHashedPassword(context.Background())) keymanager, err := direct.NewKeymanager( cliCtx.Context, &direct.SetupConfig{ @@ -203,6 +210,7 @@ func TestImport_Noninteractive_Filepath(t *testing.T) { } func TestImport_SortByDerivationPath(t *testing.T) { + direct.ResetCaches() type test struct { name string input []string @@ -298,6 +306,7 @@ func Test_importPrivateKeyAsAccount(t *testing.T) { }, }) require.NoError(t, err) + require.NoError(t, wallet.SaveHashedPassword(context.Background())) keymanager, err := direct.NewKeymanager( cliCtx.Context, &direct.SetupConfig{ @@ -306,7 +315,7 @@ func Test_importPrivateKeyAsAccount(t *testing.T) { }, ) require.NoError(t, err) - assert.NoError(t, importPrivateKeyAsAccount(cliCtx, wallet)) + assert.NoError(t, importPrivateKeyAsAccount(cliCtx, wallet, keymanager)) // We re-instantiate the keymanager and check we now have 1 public key. keymanager, err = direct.NewKeymanager( diff --git a/validator/flags/flags.go b/validator/flags/flags.go index 6d9d66ce3408..1a8852e39b8a 100644 --- a/validator/flags/flags.go +++ b/validator/flags/flags.go @@ -118,7 +118,7 @@ var ( Name: "grpc-gateway-corsdomain", Usage: "Comma separated list of domains from which to accept cross origin requests " + "(browser enforced). This flag has no effect if not used with --grpc-gateway-port.", - Value: "http://localhost:4242,http://127.0.0.1:4242", + Value: "http://localhost:4242,http://127.0.0.1:4242,http://localhost:4200", } // KeyManager specifies the key manager to use. KeyManager = &cli.StringFlag{ diff --git a/validator/keymanager/v2/derived/BUILD.bazel b/validator/keymanager/v2/derived/BUILD.bazel index a155a49a7e24..737711efd92f 100644 --- a/validator/keymanager/v2/derived/BUILD.bazel +++ b/validator/keymanager/v2/derived/BUILD.bazel @@ -5,7 +5,6 @@ go_library( name = "go_default_library", srcs = [ "backup.go", - "deposit.go", "derived.go", "mnemonic.go", ], @@ -16,7 +15,6 @@ go_library( ], deps = [ "//beacon-chain/core/helpers:go_default_library", - "//contracts/deposit-contract:go_default_library", "//proto/validator/accounts/v2:go_default_library", "//shared/bls:go_default_library", "//shared/bytesutil:go_default_library", @@ -28,17 +26,9 @@ go_library( "//shared/rand:go_default_library", "//validator/accounts/v2/iface:go_default_library", "//validator/keymanager/v2:go_default_library", - "@com_github_ethereum_go_ethereum//accounts/abi/bind:go_default_library", - "@com_github_ethereum_go_ethereum//accounts/keystore:go_default_library", - "@com_github_ethereum_go_ethereum//common:go_default_library", - "@com_github_ethereum_go_ethereum//crypto:go_default_library", - "@com_github_ethereum_go_ethereum//ethclient:go_default_library", - "@com_github_ethereum_go_ethereum//rpc:go_default_library", "@com_github_google_uuid//:go_default_library", - "@com_github_k0kubun_go_ansi//:go_default_library", "@com_github_pkg_errors//:go_default_library", "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", - "@com_github_schollz_progressbar_v3//:go_default_library", "@com_github_sirupsen_logrus//:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", "@com_github_wealdtech_go_eth2_util//:go_default_library", @@ -50,30 +40,19 @@ go_test( name = "go_default_test", srcs = [ "backup_test.go", - "deposit_test.go", "derived_test.go", "mnemonic_test.go", ], embed = [":go_default_library"], deps = [ - "//contracts/deposit-contract:go_default_library", "//proto/validator/accounts/v2:go_default_library", "//shared/bls:go_default_library", "//shared/bytesutil:go_default_library", - "//shared/interop:go_default_library", - "//shared/params:go_default_library", "//shared/rand:go_default_library", - "//shared/testutil:go_default_library", "//shared/testutil/assert:go_default_library", "//shared/testutil/require:go_default_library", - "//shared/trieutil:go_default_library", "//validator/accounts/v2/testing:go_default_library", - "@com_github_ethereum_go_ethereum//:go_default_library", - "@com_github_ethereum_go_ethereum//common:go_default_library", "@com_github_google_uuid//:go_default_library", - "@com_github_prysmaticlabs_ethereumapis//eth/v1alpha1:go_default_library", - "@com_github_prysmaticlabs_go_ssz//:go_default_library", - "@com_github_sirupsen_logrus//:go_default_library", "@com_github_sirupsen_logrus//hooks/test:go_default_library", "@com_github_tyler_smith_go_bip39//:go_default_library", "@com_github_wealdtech_go_eth2_util//:go_default_library", diff --git a/validator/keymanager/v2/derived/backup.go b/validator/keymanager/v2/derived/backup.go index 91db623e4a34..8ee25569ee26 100644 --- a/validator/keymanager/v2/derived/backup.go +++ b/validator/keymanager/v2/derived/backup.go @@ -20,9 +20,11 @@ func (dr *Keymanager) ExtractKeystores( ) ([]*v2keymanager.Keystore, error) { encryptor := keystorev4.New() keystores := make([]*v2keymanager.Keystore, len(publicKeys)) + lock.RLock() + defer lock.RUnlock() for i, pk := range publicKeys { pubKeyBytes := pk.Marshal() - secretKey, ok := dr.secretKeysCache[bytesutil.ToBytes48(pubKeyBytes)] + secretKey, ok := secretKeysCache[bytesutil.ToBytes48(pubKeyBytes)] if !ok { return nil, fmt.Errorf( "secret key for public key %#x not found in cache", diff --git a/validator/keymanager/v2/derived/backup_test.go b/validator/keymanager/v2/derived/backup_test.go index 199aa30bea87..40510b0ac099 100644 --- a/validator/keymanager/v2/derived/backup_test.go +++ b/validator/keymanager/v2/derived/backup_test.go @@ -12,15 +12,16 @@ import ( ) func TestDerivedKeymanager_ExtractKeystores(t *testing.T) { - dr := &Keymanager{ - secretKeysCache: make(map[[48]byte]bls.SecretKey), - } + secretKeysCache = make(map[[48]byte]bls.SecretKey) + dr := &Keymanager{} validatingKeys := make([]bls.SecretKey, 10) + lock.Lock() for i := 0; i < len(validatingKeys); i++ { secretKey := bls.RandKey() validatingKeys[i] = secretKey - dr.secretKeysCache[bytesutil.ToBytes48(secretKey.PublicKey().Marshal())] = secretKey + secretKeysCache[bytesutil.ToBytes48(secretKey.PublicKey().Marshal())] = secretKey } + lock.Unlock() ctx := context.Background() password := "password" diff --git a/validator/keymanager/v2/derived/deposit.go b/validator/keymanager/v2/derived/deposit.go deleted file mode 100644 index 0b00f872e6e2..000000000000 --- a/validator/keymanager/v2/derived/deposit.go +++ /dev/null @@ -1,168 +0,0 @@ -package derived - -import ( - "fmt" - "math/big" - "strings" - "time" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/accounts/keystore" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethclient" - "github.com/ethereum/go-ethereum/rpc" - "github.com/k0kubun/go-ansi" - "github.com/pkg/errors" - contracts "github.com/prysmaticlabs/prysm/contracts/deposit-contract" - "github.com/prysmaticlabs/prysm/shared/bls" - "github.com/prysmaticlabs/prysm/shared/bytesutil" - "github.com/prysmaticlabs/prysm/shared/depositutil" - "github.com/prysmaticlabs/prysm/shared/fileutil" - "github.com/prysmaticlabs/prysm/shared/params" - "github.com/schollz/progressbar/v3" - "github.com/sirupsen/logrus" - util "github.com/wealdtech/go-eth2-util" -) - -// SendDepositConfig contains all the required information for -// the derived keymanager to submit a 32 ETH deposit from the user's -// eth1 wallet to an eth1 RPC endpoint. -type SendDepositConfig struct { - DepositContractAddress string - DepositDelaySeconds time.Duration - DepositPublicKeys []bls.PublicKey - Eth1KeystoreUTCFile string - Eth1KeystorePasswordFile string - Eth1PrivateKey string - Web3Provider string -} - -// SendDepositTx to the validator deposit contract on the eth1 chain -// using a defined configuration by first unlocking the user's eth1 wallet, -// then generating the deposit data for a desired validator account, finally -// submitting the transaction via an eth1 web3 endpoint. -func (dr *Keymanager) SendDepositTx(conf *SendDepositConfig) error { - var txOps *bind.TransactOpts - rpcClient, err := rpc.Dial(conf.Web3Provider) - if err != nil { - return err - } - client := ethclient.NewClient(rpcClient) - depositAmountInGwei := params.BeaconConfig().MaxEffectiveBalance - - if conf.Eth1PrivateKey != "" { - // User inputs private key, sign tx with private key - privKey, err := crypto.HexToECDSA(conf.Eth1PrivateKey) - if err != nil { - return err - } - txOps = bind.NewKeyedTransactor(privKey) - txOps.Value = new(big.Int).Mul(big.NewInt(int64(depositAmountInGwei)), big.NewInt(1e9)) - } else { - // User inputs keystore json file, sign tx with keystore json - password, err := fileutil.ReadFileAsBytes(conf.Eth1KeystorePasswordFile) - if err != nil { - return err - } - // #nosec - Inclusion of file via variable is OK for this tool. - keyJSON, err := fileutil.ReadFileAsBytes(conf.Eth1KeystoreUTCFile) - if err != nil { - return err - } - privKey, err := keystore.DecryptKey(keyJSON, strings.TrimRight(string(password), "\r\n")) - if err != nil { - return err - } - - txOps = bind.NewKeyedTransactor(privKey.PrivateKey) - txOps.Value = new(big.Int).Mul(big.NewInt(int64(depositAmountInGwei)), big.NewInt(1e9)) - txOps.GasLimit = 500000 - } - - depositContract, err := contracts.NewDepositContract(common.HexToAddress(conf.DepositContractAddress), client) - if err != nil { - return err - } - wantedPubKeys := make(map[[48]byte]bool, len(conf.DepositPublicKeys)) - for _, pk := range conf.DepositPublicKeys { - wantedPubKeys[bytesutil.ToBytes48(pk.Marshal())] = true - } - bar := initializeProgressBar(int(dr.seedCfg.NextAccount), "Sending deposit transactions...") - for i := uint64(0); i < dr.seedCfg.NextAccount; i++ { - validatingKeyPath := fmt.Sprintf(ValidatingKeyDerivationPathTemplate, i) - validatingKey, err := util.PrivateKeyFromSeedAndPath(dr.seed, validatingKeyPath) - if err != nil { - return errors.Wrapf(err, "failed to read validating key for account %d", i) - } - if ok := wantedPubKeys[bytesutil.ToBytes48(validatingKey.PublicKey().Marshal())]; !ok { - continue - } - withdrawalKeyPath := fmt.Sprintf(WithdrawalKeyDerivationPathTemplate, i) - withdrawalKey, err := util.PrivateKeyFromSeedAndPath(dr.seed, withdrawalKeyPath) - if err != nil { - return errors.Wrapf(err, "failed to read withdrawal key for account %d", i) - } - validatingKeyBLS, err := bls.SecretKeyFromBytes(validatingKey.Marshal()) - if err != nil { - return err - } - withdrawalKeyBLS, err := bls.SecretKeyFromBytes(withdrawalKey.Marshal()) - if err != nil { - return err - } - data, depositRoot, err := depositutil.DepositInput(validatingKeyBLS, withdrawalKeyBLS, depositAmountInGwei) - if err != nil { - log.Errorf("Could not generate deposit input data: %v", err) - continue - } - tx, err := depositContract.Deposit( - txOps, - data.PublicKey, - data.WithdrawalCredentials, - data.Signature, - depositRoot, - ) - if err != nil { - log.Errorf("Unable to send transaction to contract: %v", err) - continue - } - log.WithFields(logrus.Fields{ - "Transaction Hash": fmt.Sprintf("%#x", tx.Hash()), - }).Infof( - "Deposit %d sent to contract address %v for validator with a public key %#x", - i, - conf.DepositContractAddress, - validatingKey.PublicKey().Marshal(), - ) - log.Infof( - "You can monitor your transaction on Etherscan here https://goerli.etherscan.io/tx/0x%x", - tx.Hash(), - ) - log.Infof("Waiting for a short delay of %v seconds...", conf.DepositDelaySeconds) - if err := bar.Add(1); err != nil { - log.Errorf("Could not increase progress bar percentage: %v", err) - } - time.Sleep(conf.DepositDelaySeconds) - } - log.Infof("Successfully sent all validator deposits!") - return nil -} - -func initializeProgressBar(numItems int, msg string) *progressbar.ProgressBar { - return progressbar.NewOptions( - numItems, - progressbar.OptionFullWidth(), - progressbar.OptionSetWriter(ansi.NewAnsiStdout()), - progressbar.OptionEnableColorCodes(true), - progressbar.OptionSetTheme(progressbar.Theme{ - Saucer: "[green]=[reset]", - SaucerHead: "[green]>[reset]", - SaucerPadding: " ", - BarStart: "[", - BarEnd: "]", - }), - progressbar.OptionOnCompletion(func() { fmt.Println() }), - progressbar.OptionSetDescription(msg), - ) -} diff --git a/validator/keymanager/v2/derived/deposit_test.go b/validator/keymanager/v2/derived/deposit_test.go deleted file mode 100644 index 805a41d97fc3..000000000000 --- a/validator/keymanager/v2/derived/deposit_test.go +++ /dev/null @@ -1,130 +0,0 @@ -package derived - -import ( - "context" - "encoding/binary" - "fmt" - "io/ioutil" - "testing" - "time" - - "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/common" - ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" - "github.com/prysmaticlabs/go-ssz" - contracts "github.com/prysmaticlabs/prysm/contracts/deposit-contract" - "github.com/prysmaticlabs/prysm/shared/interop" - "github.com/prysmaticlabs/prysm/shared/params" - "github.com/prysmaticlabs/prysm/shared/testutil" - "github.com/prysmaticlabs/prysm/shared/testutil/assert" - "github.com/prysmaticlabs/prysm/shared/testutil/require" - "github.com/prysmaticlabs/prysm/shared/trieutil" - "github.com/sirupsen/logrus" -) - -func init() { - logrus.SetLevel(logrus.DebugLevel) - logrus.SetOutput(ioutil.Discard) -} - -func sendDepositsTest( - t *testing.T, - testAcc *contracts.TestAccount, - numberOfDeposits, numberOfValidators uint64, -) []*ethpb.Deposit { - deposits := make([]*ethpb.Deposit, 0, numberOfValidators) - depositDelay := int64(1) - depositContractAddrStr := testAcc.ContractAddr.Hex() - - privKeys, pubKeys, err := interop.DeterministicallyGenerateKeys(0, numberOfValidators) - require.NoError(t, err, "Unable to generate keys") - - depositData, depositDataRoots, err := interop.DepositDataFromKeys(privKeys, pubKeys) - require.NoError(t, err, "Unable to generate deposit data from keys") - - for i, data := range depositData { - dataRoot := [32]byte{} - copy(dataRoot[:], depositDataRoots[i]) - - pubKey := pubKeys[i] - - deposits = append(deposits, ðpb.Deposit{ - Data: data, - }) - - for j := uint64(0); j < numberOfDeposits; j++ { - tx, err := testAcc.Contract.Deposit(testAcc.TxOpts, data.PublicKey, data.WithdrawalCredentials, data.Signature, dataRoot) - require.NoError(t, err, "Unable to send transaction to contract") - - testAcc.Backend.Commit() - - log.WithFields(logrus.Fields{ - "Transaction Hash": fmt.Sprintf("%#x", tx.Hash()), - }).Infof("Deposit %d sent to contract address %v for validator with a public key %#x", j, depositContractAddrStr, pubKey.Marshal()) - - time.Sleep(time.Duration(depositDelay) * time.Second) - } - } - return deposits -} - -func TestSendDepositTx(t *testing.T) { - testutil.ResetCache() - testAcc, err := contracts.Setup() - require.NoError(t, err, "Unable to set up simulated backend") - - testAcc.Backend.Commit() - - testAcc.TxOpts.Value = contracts.Amount32Eth() - testAcc.TxOpts.GasLimit = 1000000 - - numberOfValidators := uint64(2) - numberOfDeposits := uint64(5) - deposits := sendDepositsTest(t, testAcc, numberOfDeposits, numberOfValidators) - - query := ethereum.FilterQuery{ - Addresses: []common.Address{ - testAcc.ContractAddr, - }, - } - - logs, err := testAcc.Backend.FilterLogs(context.Background(), query) - require.NoError(t, err, "Unable to retrieve logs") - require.NotEqual(t, 0, len(logs), "No logs") - require.Equal(t, int(numberOfDeposits*numberOfValidators), len(logs), "No sufficient number of logs") - - j := 0 - for i, log := range logs { - loggedPubkey, withCreds, _, loggedSig, index, err := contracts.UnpackDepositLogData(log.Data) - require.NoError(t, err, "Unable to unpack logs") - assert.Equal(t, uint64(i), binary.LittleEndian.Uint64(index), "Retrieved merkle tree index is incorrect %d", index) - assert.DeepEqual(t, deposits[j].Data.PublicKey, loggedPubkey, "Pubkey is not the same as the data that was put in i: %d", i) - assert.DeepEqual(t, deposits[j].Data.Signature, loggedSig, "Proof of Possession is not the same as the data that was put in i: %d", i) - assert.DeepEqual(t, deposits[j].Data.WithdrawalCredentials, withCreds, "Withdrawal Credentials is not the same as the data that was put in i: %d", i) - - if i == int(numberOfDeposits)-1 { - j++ - } - } - - encodedDeposits := make([][]byte, numberOfValidators*numberOfDeposits) - for i := 0; i < int(numberOfValidators); i++ { - hashedDeposit, err := ssz.HashTreeRoot(deposits[i].Data) - require.NoError(t, err, "Could not tree hash deposit data") - for j := 0; j < int(numberOfDeposits); j++ { - encodedDeposits[i*int(numberOfDeposits)+j] = hashedDeposit[:] - } - } - - depositTrie, err := trieutil.GenerateTrieFromItems(encodedDeposits, int(params.BeaconConfig().DepositContractTreeDepth)) - require.NoError(t, err, "Could not generate trie") - - root := depositTrie.Root() - - for i, encodedDeposit := range encodedDeposits { - proof, err := depositTrie.MerkleProof(i) - require.NoError(t, err, "Could not generate proof") - require.Equal(t, true, trieutil.VerifyMerkleBranch(root[:], encodedDeposit, i, proof, params.BeaconConfig().DepositContractTreeDepth), - "Unable verify deposit merkle branch of deposit root for root: %#x, encodedDeposit: %#x, i : %d", root[:], encodedDeposit, i) - } -} diff --git a/validator/keymanager/v2/derived/derived.go b/validator/keymanager/v2/derived/derived.go index 3e707055c03c..82ed1794d768 100644 --- a/validator/keymanager/v2/derived/derived.go +++ b/validator/keymanager/v2/derived/derived.go @@ -29,7 +29,12 @@ import ( keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4" ) -var log = logrus.WithField("prefix", "derived-keymanager-v2") +var ( + log = logrus.WithField("prefix", "derived-keymanager-v2") + lock sync.RWMutex + orderedPublicKeys = make([][48]byte, 0) + secretKeysCache = make(map[[48]byte]bls.SecretKey) +) const ( // EIPVersion used by this derived keymanager implementation. @@ -76,13 +81,18 @@ type Keymanager struct { wallet iface.Wallet opts *KeymanagerOpts mnemonicGenerator SeedPhraseFactory - publicKeysCache [][48]byte - secretKeysCache map[[48]byte]bls.SecretKey - lock sync.RWMutex seedCfg *SeedConfig seed []byte } +// ResetCaches for the keymanager. +func ResetCaches() { + lock.Lock() + orderedPublicKeys = make([][48]byte, 0) + secretKeysCache = make(map[[48]byte]bls.SecretKey) + lock.Unlock() +} + // DefaultKeymanagerOpts for a derived keymanager implementation. func DefaultKeymanagerOpts() *KeymanagerOpts { return &KeymanagerOpts{ @@ -248,12 +258,12 @@ func (dr *Keymanager) WriteEncryptedSeedToWallet(ctx context.Context, mnemonic s // ValidatingAccountNames for the derived keymanager. func (dr *Keymanager) ValidatingAccountNames(ctx context.Context) ([]string, error) { - dr.lock.RLock() - names := make([]string, len(dr.publicKeysCache)) - for i, pubKey := range dr.publicKeysCache { + lock.RLock() + names := make([]string, len(orderedPublicKeys)) + for i, pubKey := range orderedPublicKeys { names[i] = petnames.DeterministicName(bytesutil.FromBytes48(pubKey), "-") } - dr.lock.RUnlock() + lock.RUnlock() return names, nil } @@ -317,13 +327,13 @@ func (dr *Keymanager) CreateAccount(ctx context.Context) ([]byte, *pb.Deposit_Da "validatingKeyPath": path.Join(dr.wallet.AccountsDir(), validatingKeyPath), }).Info("Successfully created new validator account") - dr.lock.Lock() + lock.Lock() dr.seedCfg.NextAccount++ // Append the new account keys to the account keys caches publicKey := bytesutil.ToBytes48(blsValidatingKey.PublicKey().Marshal()) - dr.publicKeysCache = append(dr.publicKeysCache, publicKey) - dr.secretKeysCache[publicKey] = blsValidatingKey - dr.lock.Unlock() + orderedPublicKeys = append(orderedPublicKeys, publicKey) + secretKeysCache[publicKey] = blsValidatingKey + lock.Unlock() encodedCfg, err := marshalEncryptedSeedFile(dr.seedCfg) if err != nil { return nil, nil, errors.Wrap(err, "could not marshal encrypted seed file") @@ -340,9 +350,9 @@ func (dr *Keymanager) Sign(ctx context.Context, req *validatorpb.SignRequest) (b if rawPubKey == nil { return nil, errors.New("nil public key in request") } - dr.lock.RLock() - secretKey, ok := dr.secretKeysCache[bytesutil.ToBytes48(rawPubKey)] - dr.lock.RUnlock() + lock.RLock() + secretKey, ok := secretKeysCache[bytesutil.ToBytes48(rawPubKey)] + lock.RUnlock() if !ok { return nil, errors.New("no signing key found in keys cache") } @@ -351,11 +361,11 @@ func (dr *Keymanager) Sign(ctx context.Context, req *validatorpb.SignRequest) (b // FetchValidatingPublicKeys fetches the list of validating public keys from the keymanager. func (dr *Keymanager) FetchValidatingPublicKeys(ctx context.Context) ([][48]byte, error) { - dr.lock.RLock() - keys := dr.publicKeysCache + lock.RLock() + keys := orderedPublicKeys result := make([][48]byte, len(keys)) copy(result, keys) - dr.lock.RUnlock() + lock.RUnlock() return result, nil } @@ -432,21 +442,21 @@ func (dr *Keymanager) RefreshWalletPassword(ctx context.Context) error { // Append the public and the secret key for the provided secret key to their respective caches func (dr *Keymanager) appendKeysToCaches(secretKey bls.SecretKey) error { publicKey := bytesutil.ToBytes48(secretKey.PublicKey().Marshal()) - dr.lock.Lock() - dr.publicKeysCache = append(dr.publicKeysCache, publicKey) - dr.secretKeysCache[publicKey] = secretKey - dr.lock.Unlock() + lock.Lock() + orderedPublicKeys = append(orderedPublicKeys, publicKey) + secretKeysCache[publicKey] = secretKey + lock.Unlock() return nil } // Initialize public and secret key caches used to speed up the functions // FetchValidatingPublicKeys and Sign as part of the Keymanager instance initialization func (dr *Keymanager) initializeKeysCachesFromSeed() error { - dr.lock.Lock() - defer dr.lock.Unlock() + lock.Lock() + defer lock.Unlock() count := dr.seedCfg.NextAccount - dr.publicKeysCache = make([][48]byte, count) - dr.secretKeysCache = make(map[[48]byte]bls.SecretKey, count) + orderedPublicKeys = make([][48]byte, count) + secretKeysCache = make(map[[48]byte]bls.SecretKey, count) for i := uint64(0); i < count; i++ { validatingKeyPath := fmt.Sprintf(ValidatingKeyDerivationPathTemplate, i) derivedKey, err := util.PrivateKeyFromSeedAndPath(dr.seed, validatingKeyPath) @@ -462,8 +472,8 @@ func (dr *Keymanager) initializeKeysCachesFromSeed() error { ) } publicKey := bytesutil.ToBytes48(secretKey.PublicKey().Marshal()) - dr.publicKeysCache[i] = publicKey - dr.secretKeysCache[publicKey] = secretKey + orderedPublicKeys[i] = publicKey + secretKeysCache[publicKey] = secretKey } return nil } diff --git a/validator/keymanager/v2/direct/backup.go b/validator/keymanager/v2/direct/backup.go index 2f9c8db80fd6..df8233c0ee39 100644 --- a/validator/keymanager/v2/direct/backup.go +++ b/validator/keymanager/v2/direct/backup.go @@ -18,11 +18,13 @@ import ( func (dr *Keymanager) ExtractKeystores( ctx context.Context, publicKeys []bls.PublicKey, password string, ) ([]*v2keymanager.Keystore, error) { + lock.Lock() + defer lock.Unlock() encryptor := keystorev4.New() keystores := make([]*v2keymanager.Keystore, len(publicKeys)) for i, pk := range publicKeys { pubKeyBytes := pk.Marshal() - secretKey, ok := dr.secretKeysCache[bytesutil.ToBytes48(pubKeyBytes)] + secretKey, ok := secretKeysCache[bytesutil.ToBytes48(pubKeyBytes)] if !ok { return nil, fmt.Errorf( "secret key for public key %#x not found in cache", diff --git a/validator/keymanager/v2/direct/backup_test.go b/validator/keymanager/v2/direct/backup_test.go index c0d62e35d553..f607a06d0f86 100644 --- a/validator/keymanager/v2/direct/backup_test.go +++ b/validator/keymanager/v2/direct/backup_test.go @@ -12,15 +12,16 @@ import ( ) func TestDirectKeymanager_ExtractKeystores(t *testing.T) { - dr := &Keymanager{ - secretKeysCache: make(map[[48]byte]bls.SecretKey), - } + secretKeysCache = make(map[[48]byte]bls.SecretKey) + lock.Lock() + dr := &Keymanager{} validatingKeys := make([]bls.SecretKey, 10) for i := 0; i < len(validatingKeys); i++ { secretKey := bls.RandKey() validatingKeys[i] = secretKey - dr.secretKeysCache[bytesutil.ToBytes48(secretKey.PublicKey().Marshal())] = secretKey + secretKeysCache[bytesutil.ToBytes48(secretKey.PublicKey().Marshal())] = secretKey } + lock.Unlock() ctx := context.Background() password := "password" diff --git a/validator/keymanager/v2/direct/direct.go b/validator/keymanager/v2/direct/direct.go index 89916d775694..78ffa8ee28d5 100644 --- a/validator/keymanager/v2/direct/direct.go +++ b/validator/keymanager/v2/direct/direct.go @@ -29,7 +29,12 @@ import ( keystorev4 "github.com/wealdtech/go-eth2-wallet-encryptor-keystorev4" ) -var log = logrus.WithField("prefix", "direct-keymanager-v2") +var ( + log = logrus.WithField("prefix", "direct-keymanager-v2") + lock sync.RWMutex + orderedPublicKeys = make([][48]byte, 0) + secretKeysCache = make(map[[48]byte]bls.SecretKey) +) const ( // KeystoreFileNameFormat exposes the filename the keystore should be formatted in. @@ -50,9 +55,6 @@ type Keymanager struct { wallet iface.Wallet opts *KeymanagerOpts accountsStore *AccountStore - publicKeysCache [][48]byte - secretKeysCache map[[48]byte]bls.SecretKey - lock sync.RWMutex accountsChangedFeed *event.Feed } @@ -79,13 +81,19 @@ type SetupConfig struct { Mnemonic string } +// ResetCaches for the keymanager. +func ResetCaches() { + lock.Lock() + orderedPublicKeys = make([][48]byte, 0) + secretKeysCache = make(map[[48]byte]bls.SecretKey) + lock.Unlock() +} + // NewKeymanager instantiates a new direct keymanager from configuration options. func NewKeymanager(ctx context.Context, cfg *SetupConfig) (*Keymanager, error) { k := &Keymanager{ wallet: cfg.Wallet, opts: cfg.Opts, - publicKeysCache: [][48]byte{}, - secretKeysCache: make(map[[48]byte]bls.SecretKey), accountsStore: &AccountStore{}, accountsChangedFeed: new(event.Feed), } @@ -104,8 +112,6 @@ func NewKeymanager(ctx context.Context, cfg *SetupConfig) (*Keymanager, error) { // NewInteropKeymanager instantiates a new direct keymanager with the deterministically generated interop keys. func NewInteropKeymanager(ctx context.Context, offset uint64, numValidatorKeys uint64) (*Keymanager, error) { k := &Keymanager{ - publicKeysCache: make([][48]byte, numValidatorKeys), - secretKeysCache: make(map[[48]byte]bls.SecretKey, numValidatorKeys), accountsChangedFeed: new(event.Feed), } if numValidatorKeys == 0 { @@ -115,11 +121,15 @@ func NewInteropKeymanager(ctx context.Context, offset uint64, numValidatorKeys u if err != nil { return nil, errors.Wrap(err, "could not generate interop keys") } + lock.Lock() + pubKeys := make([][48]byte, numValidatorKeys) for i := uint64(0); i < numValidatorKeys; i++ { publicKey := bytesutil.ToBytes48(publicKeys[i].Marshal()) - k.publicKeysCache[i] = publicKey - k.secretKeysCache[publicKey] = secretKeys[i] + pubKeys[i] = publicKey + secretKeysCache[publicKey] = secretKeys[i] } + orderedPublicKeys = pubKeys + lock.Unlock() return k, nil } @@ -173,31 +183,31 @@ func (dr *Keymanager) SubscribeAccountChanges(pubKeysChan chan [][48]byte) event // ValidatingAccountNames for a direct keymanager. func (dr *Keymanager) ValidatingAccountNames() ([]string, error) { - dr.lock.RLock() - names := make([]string, len(dr.publicKeysCache)) - for i, pubKey := range dr.publicKeysCache { + lock.RLock() + names := make([]string, len(orderedPublicKeys)) + for i, pubKey := range orderedPublicKeys { names[i] = petnames.DeterministicName(bytesutil.FromBytes48(pubKey), "-") } - dr.lock.RUnlock() + lock.RUnlock() return names, nil } // Initialize public and secret key caches that are used to speed up the functions // FetchValidatingPublicKeys and Sign func (dr *Keymanager) initializeKeysCachesFromKeystore() error { - dr.lock.Lock() - defer dr.lock.Unlock() + lock.Lock() + defer lock.Unlock() count := len(dr.accountsStore.PrivateKeys) - dr.publicKeysCache = make([][48]byte, count) - dr.secretKeysCache = make(map[[48]byte]bls.SecretKey, count) + orderedPublicKeys = make([][48]byte, count) + secretKeysCache = make(map[[48]byte]bls.SecretKey, count) for i, publicKey := range dr.accountsStore.PublicKeys { publicKey48 := bytesutil.ToBytes48(publicKey) - dr.publicKeysCache[i] = publicKey48 + orderedPublicKeys[i] = publicKey48 secretKey, err := bls.SecretKeyFromBytes(dr.accountsStore.PrivateKeys[i]) if err != nil { return errors.Wrap(err, "failed to initialize keys caches from account keystore") } - dr.secretKeysCache[publicKey48] = secretKey + secretKeysCache[publicKey48] = secretKey } return nil } @@ -327,11 +337,11 @@ func (dr *Keymanager) DeleteAccounts(ctx context.Context, publicKeys [][]byte) e // FetchValidatingPublicKeys fetches the list of public keys from the direct account keystores. func (dr *Keymanager) FetchValidatingPublicKeys(ctx context.Context) ([][48]byte, error) { - dr.lock.RLock() - keys := dr.publicKeysCache + lock.RLock() + keys := orderedPublicKeys result := make([][48]byte, len(keys)) copy(result, keys) - dr.lock.RUnlock() + lock.RUnlock() return result, nil } @@ -341,9 +351,9 @@ func (dr *Keymanager) Sign(ctx context.Context, req *validatorpb.SignRequest) (b if publicKey == nil { return nil, errors.New("nil public key in request") } - dr.lock.RLock() - secretKey, ok := dr.secretKeysCache[bytesutil.ToBytes48(publicKey)] - dr.lock.RUnlock() + lock.RLock() + secretKey, ok := secretKeysCache[bytesutil.ToBytes48(publicKey)] + lock.RUnlock() if !ok { return nil, errors.New("no signing key found in keys cache") } diff --git a/validator/keymanager/v2/direct/direct_test.go b/validator/keymanager/v2/direct/direct_test.go index 302a8479ba8a..e487dc80452f 100644 --- a/validator/keymanager/v2/direct/direct_test.go +++ b/validator/keymanager/v2/direct/direct_test.go @@ -223,9 +223,8 @@ func TestDirectKeymanager_Sign_NoPublicKeyInCache(t *testing.T) { req := &validatorpb.SignRequest{ PublicKey: []byte("hello world"), } - dr := &Keymanager{ - secretKeysCache: make(map[[48]byte]bls.SecretKey), - } + secretKeysCache = make(map[[48]byte]bls.SecretKey) + dr := &Keymanager{} _, err := dr.Sign(context.Background(), req) assert.ErrorContains(t, "no signing key found in keys cache", err) } diff --git a/validator/keymanager/v2/direct/refresh_test.go b/validator/keymanager/v2/direct/refresh_test.go index 649833697c1a..ee5735d979d9 100644 --- a/validator/keymanager/v2/direct/refresh_test.go +++ b/validator/keymanager/v2/direct/refresh_test.go @@ -39,12 +39,14 @@ func TestDirectKeymanager_reloadAccountsFromKeystore(t *testing.T) { // Check that the public keys were added to the public keys cache. for i, keyBytes := range pubKeys { - require.Equal(t, bytesutil.ToBytes48(keyBytes), dr.publicKeysCache[i]) + require.Equal(t, bytesutil.ToBytes48(keyBytes), orderedPublicKeys[i]) } // Check that the secret keys were added to the secret keys cache. + lock.RLock() + defer lock.RUnlock() for i, keyBytes := range privKeys { - privKey, ok := dr.secretKeysCache[bytesutil.ToBytes48(pubKeys[i])] + privKey, ok := secretKeysCache[bytesutil.ToBytes48(pubKeys[i])] require.Equal(t, true, ok) require.Equal(t, bytesutil.ToBytes48(keyBytes), bytesutil.ToBytes48(privKey.Marshal())) } diff --git a/validator/node/node.go b/validator/node/node.go index fca74d5db979..1d7b19346ab5 100644 --- a/validator/node/node.go +++ b/validator/node/node.go @@ -400,6 +400,7 @@ func (s *ValidatorClient) registerRPCService(cliCtx *cli.Context) error { rpcHost := cliCtx.String(flags.RPCHost.Name) rpcPort := cliCtx.Int(flags.RPCPort.Name) nodeGatewayEndpoint := cliCtx.String(flags.BeaconRPCGatewayProviderFlag.Name) + walletDir := cliCtx.String(flags.WalletDirFlag.Name) server := rpc.NewServer(cliCtx.Context, &rpc.Config{ ValDB: s.db, Host: rpcHost, @@ -409,6 +410,7 @@ func (s *ValidatorClient) registerRPCService(cliCtx *cli.Context) error { SyncChecker: vs, GenesisFetcher: vs, NodeGatewayEndpoint: nodeGatewayEndpoint, + WalletDir: walletDir, }) return s.services.RegisterService(server) } diff --git a/validator/rpc/BUILD.bazel b/validator/rpc/BUILD.bazel index 0c67c205981f..d3f0fca35255 100644 --- a/validator/rpc/BUILD.bazel +++ b/validator/rpc/BUILD.bazel @@ -79,6 +79,7 @@ go_test( "//validator/accounts/v2/wallet:go_default_library", "//validator/client:go_default_library", "//validator/db/testing:go_default_library", + "//validator/flags:go_default_library", "//validator/keymanager/v2:go_default_library", "//validator/keymanager/v2/derived:go_default_library", "//validator/keymanager/v2/direct:go_default_library", diff --git a/validator/rpc/accounts_test.go b/validator/rpc/accounts_test.go index 2a3ac3681be0..12ee3711d328 100644 --- a/validator/rpc/accounts_test.go +++ b/validator/rpc/accounts_test.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "io/ioutil" + "path/filepath" "testing" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" @@ -17,10 +18,12 @@ import ( "github.com/prysmaticlabs/prysm/shared/testutil/require" v2 "github.com/prysmaticlabs/prysm/validator/accounts/v2" "github.com/prysmaticlabs/prysm/validator/accounts/v2/wallet" + "github.com/prysmaticlabs/prysm/validator/flags" v2keymanager "github.com/prysmaticlabs/prysm/validator/keymanager/v2" "github.com/prysmaticlabs/prysm/validator/keymanager/v2/derived" ) +var defaultWalletPath = filepath.Join(flags.DefaultValidatorDir(), flags.WalletDefaultDirName) var _ accountCreator = (*mockAccountCreator)(nil) type mockAccountCreator struct { diff --git a/validator/rpc/auth.go b/validator/rpc/auth.go index c05ec76afb39..ccdba7867076 100644 --- a/validator/rpc/auth.go +++ b/validator/rpc/auth.go @@ -22,30 +22,34 @@ import ( ) var ( - tokenExpiryLength = 20 * time.Minute + tokenExpiryLength = time.Hour hashCost = 8 ) // Signup to authenticate access to the validator RPC API using bcrypt and // a sufficiently strong password check. func (s *Server) Signup(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error) { + walletDir := s.walletDir + if strings.TrimSpace(req.WalletDir) != "" { + walletDir = req.WalletDir + } // First, we check if the validator already has a password. In this case, - // the user should NOT be able to signup and the function will return an error. - if fileutil.FileExists(filepath.Join(defaultWalletPath, wallet.HashedPasswordFileName)) { - return nil, status.Error(codes.PermissionDenied, "Validator already has a password set, cannot signup") + // the user should be logged in as normal. + if fileutil.FileExists(filepath.Join(walletDir, wallet.HashedPasswordFileName)) { + return s.Login(ctx, req) } // We check the strength of the password to ensure it is high-entropy, // has the required character count, and contains only unicode characters. if err := promptutil.ValidatePasswordInput(req.Password); err != nil { - return nil, status.Error(codes.InvalidArgument, "Could not validate password input") + return nil, status.Error(codes.InvalidArgument, "Could not validate wallet password input") } hashedPassword, err := bcrypt.GenerateFromPassword([]byte(req.Password), hashCost) if err != nil { return nil, errors.Wrap(err, "could not generate hashed password") } - hashFilePath := filepath.Join(defaultWalletPath, wallet.HashedPasswordFileName) + hashFilePath := filepath.Join(walletDir, wallet.HashedPasswordFileName) // Write the config file to disk. - if err := os.MkdirAll(defaultWalletPath, os.ModePerm); err != nil { + if err := os.MkdirAll(walletDir, os.ModePerm); err != nil { return nil, status.Error(codes.Internal, err.Error()) } if err := ioutil.WriteFile(hashFilePath, hashedPassword, params.BeaconIoConfig().ReadWritePermissions); err != nil { @@ -56,19 +60,29 @@ func (s *Server) Signup(ctx context.Context, req *pb.AuthRequest) (*pb.AuthRespo // Login to authenticate with the validator RPC API using a password. func (s *Server) Login(ctx context.Context, req *pb.AuthRequest) (*pb.AuthResponse, error) { - hashedPasswordPath := filepath.Join(defaultWalletPath, wallet.HashedPasswordFileName) - if fileutil.FileExists(hashedPasswordPath) { - hashedPassword, err := fileutil.ReadFileAsBytes(hashedPasswordPath) - if err != nil { - return nil, status.Error(codes.Internal, "Could not retrieve hashed password from disk") - } - // Compare the stored hashed password, with the hashed version of the password that was received. - if err := bcrypt.CompareHashAndPassword(hashedPassword, []byte(req.Password)); err != nil { - return nil, status.Error(codes.Unauthenticated, "Incorrect password") - } + walletDir := s.walletDir + if strings.TrimSpace(req.WalletDir) != "" { + walletDir = req.WalletDir + } + // We check the strength of the password to ensure it is high-entropy, + // has the required character count, and contains only unicode characters. + if err := promptutil.ValidatePasswordInput(req.Password); err != nil { + return nil, status.Error(codes.InvalidArgument, "Could not validate wallet password input") + } + hashedPasswordPath := filepath.Join(walletDir, wallet.HashedPasswordFileName) + if !fileutil.FileExists(hashedPasswordPath) { + return nil, status.Error(codes.Internal, "Could not find hashed password on disk") + } + hashedPassword, err := fileutil.ReadFileAsBytes(hashedPasswordPath) + if err != nil { + return nil, status.Error(codes.Internal, "Could not retrieve hashed password from disk") + } + // Compare the stored hashed password, with the hashed version of the password that was received. + if err := bcrypt.CompareHashAndPassword(hashedPassword, []byte(req.Password)); err != nil { + return nil, status.Error(codes.Unauthenticated, "Incorrect password") } if err := s.initializeWallet(ctx, &wallet.Config{ - WalletDir: defaultWalletPath, + WalletDir: walletDir, WalletPassword: req.Password, }); err != nil { if strings.Contains(err.Error(), "invalid checksum") { @@ -146,6 +160,15 @@ func (s *Server) initializeWallet(ctx context.Context, cfg *wallet.Config) error } s.keymanager = km s.wallet = w - s.walletInitializedFeed.Send(w) + s.walletDir = cfg.WalletDir + + // Only send over feed if we have validating keys. + validatingPublicKeys, err := km.FetchValidatingPublicKeys(ctx) + if err != nil { + return errors.Wrap(err, "could not check for validating public keys") + } + if len(validatingPublicKeys) > 0 { + s.walletInitializedFeed.Send(w) + } return nil } diff --git a/validator/rpc/auth_test.go b/validator/rpc/auth_test.go index 00ae45721db5..e5340b9a8ac3 100644 --- a/validator/rpc/auth_test.go +++ b/validator/rpc/auth_test.go @@ -4,7 +4,6 @@ import ( "context" "crypto/rand" "fmt" - "io/ioutil" "math/big" "os" "path/filepath" @@ -13,7 +12,6 @@ import ( pb "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2" "github.com/prysmaticlabs/prysm/shared/event" "github.com/prysmaticlabs/prysm/shared/fileutil" - "github.com/prysmaticlabs/prysm/shared/params" "github.com/prysmaticlabs/prysm/shared/testutil" "github.com/prysmaticlabs/prysm/shared/testutil/assert" "github.com/prysmaticlabs/prysm/shared/testutil/require" @@ -34,32 +32,6 @@ func setupWalletDir(t testing.TB) string { return walletDir } -func TestServer_Signup_PasswordAlreadyExists(t *testing.T) { - valDB := dbtest.SetupDB(t, [][48]byte{}) - ctx := context.Background() - ss := &Server{ - valDB: valDB, - } - - // Save a hash password preemptively to the database. - localWalletDir := setupWalletDir(t) - defaultWalletPath = localWalletDir - hashedPassword := []byte("2093402934902839489238492") - require.NoError(t, ioutil.WriteFile( - filepath.Join(defaultWalletPath, wallet.HashedPasswordFileName), - hashedPassword, - params.BeaconIoConfig().ReadWritePermissions, - )) - - // Attempt to signup despite already having a hashed password in the DB - // which should immediately fail. - strongPass := "29384283xasjasd32%%&*@*#*" - _, err := ss.Signup(ctx, &pb.AuthRequest{ - Password: strongPass, - }) - require.ErrorContains(t, "Validator already has a password set, cannot signup", err) -} - func TestServer_SignupAndLogin_RoundTrip(t *testing.T) { valDB := dbtest.SetupDB(t, [][48]byte{}) ctx := context.Background() @@ -71,12 +43,13 @@ func TestServer_SignupAndLogin_RoundTrip(t *testing.T) { ss := &Server{ valDB: valDB, walletInitializedFeed: new(event.Feed), + walletDir: defaultWalletPath, } weakPass := "password" _, err := ss.Signup(ctx, &pb.AuthRequest{ Password: weakPass, }) - require.ErrorContains(t, "Could not validate password input", err) + require.ErrorContains(t, "Could not validate wallet password input", err) // We assert we are able to signup with a strong password. _, err = ss.Signup(ctx, &pb.AuthRequest{ diff --git a/validator/rpc/intercepter.go b/validator/rpc/intercepter.go index bdd0fefa5bc7..e2bb4f4dc0dc 100644 --- a/validator/rpc/intercepter.go +++ b/validator/rpc/intercepter.go @@ -6,7 +6,6 @@ import ( "sync" "github.com/dgrijalva/jwt-go" - "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -17,10 +16,11 @@ import ( // authentication from our API. var ( noAuthPaths = map[string]bool{ - "/ethereum.validator.accounts.v2.Auth/Signup": true, - "/ethereum.validator.accounts.v2.Auth/Login": true, - "/ethereum.validator.accounts.v2.Wallet/HasWallet": true, - "/ethereum.validator.accounts.v2.Wallet/GenerateMnemonic": true, + "/ethereum.validator.accounts.v2.Auth/Signup": true, + "/ethereum.validator.accounts.v2.Auth/Login": true, + "/ethereum.validator.accounts.v2.Wallet/HasWallet": true, + "/ethereum.validator.accounts.v2.Wallet/GenerateMnemonic": true, + "/ethereum.validator.accounts.v2.Wallet/DefaultWalletPath": true, } authLock sync.RWMutex ) @@ -70,7 +70,7 @@ func (s *Server) authorize(ctx context.Context) error { token := strings.Split(authHeader[0], "Bearer ")[1] _, err := jwt.Parse(token, checkParsedKey) if err != nil { - return errors.Wrap(err, "Could not parse JWT token") + return status.Errorf(codes.Unauthenticated, "Could not parse JWT token: %v", err) } return nil } diff --git a/validator/rpc/server.go b/validator/rpc/server.go index 89a9f27d69d4..dcc84429cd4f 100644 --- a/validator/rpc/server.go +++ b/validator/rpc/server.go @@ -37,6 +37,7 @@ type Config struct { CertFlag string KeyFlag string ValDB db.Database + WalletDir string ValidatorService *client.ValidatorService SyncChecker client.SyncChecker GenesisFetcher client.GenesisFetcher @@ -61,6 +62,7 @@ type Server struct { validatorService *client.ValidatorService syncChecker client.SyncChecker genesisFetcher client.GenesisFetcher + walletDir string wallet *v2.Wallet walletInitializedFeed *event.Feed walletInitialized bool @@ -81,6 +83,7 @@ func NewServer(ctx context.Context, cfg *Config) *Server { validatorService: cfg.ValidatorService, syncChecker: cfg.SyncChecker, genesisFetcher: cfg.GenesisFetcher, + walletDir: cfg.WalletDir, walletInitializedFeed: cfg.WalletInitializedFeed, walletInitialized: false, nodeGatewayEndpoint: cfg.NodeGatewayEndpoint, diff --git a/validator/rpc/wallet.go b/validator/rpc/wallet.go index 19b2914a6d88..3c70986615ed 100644 --- a/validator/rpc/wallet.go +++ b/validator/rpc/wallet.go @@ -6,9 +6,12 @@ import ( "encoding/json" "io/ioutil" "path/filepath" + "strings" ptypes "github.com/gogo/protobuf/types" pb "github.com/prysmaticlabs/prysm/proto/validator/accounts/v2" + "github.com/prysmaticlabs/prysm/shared/fileutil" + "github.com/prysmaticlabs/prysm/shared/promptutil" "github.com/prysmaticlabs/prysm/shared/rand" v2 "github.com/prysmaticlabs/prysm/validator/accounts/v2" "github.com/prysmaticlabs/prysm/validator/accounts/v2/wallet" @@ -17,12 +20,11 @@ import ( "github.com/prysmaticlabs/prysm/validator/keymanager/v2/derived" "github.com/prysmaticlabs/prysm/validator/keymanager/v2/direct" "github.com/tyler-smith/go-bip39" + "golang.org/x/crypto/bcrypt" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) -var defaultWalletPath = filepath.Join(flags.DefaultValidatorDir(), flags.WalletDefaultDirName) - const ( checkExistsErrMsg = "Could not check if wallet exists" checkValidityErrMsg = "Could not check if wallet is valid" @@ -33,7 +35,7 @@ const ( // HasWallet checks if a user has created a wallet before as well as whether or not // they have used the web UI before to set a wallet password. func (s *Server) HasWallet(ctx context.Context, _ *ptypes.Empty) (*pb.HasWalletResponse, error) { - exists, err := wallet.Exists(defaultWalletPath) + exists, err := wallet.Exists(s.walletDir) if err != nil { return nil, status.Errorf(codes.Internal, "Could not check if wallet exists: %v", err) } @@ -47,35 +49,50 @@ func (s *Server) HasWallet(ctx context.Context, _ *ptypes.Empty) (*pb.HasWalletR }, nil } +// DefaultWalletPath for the user, which is dependent on operating system. +func (s *Server) DefaultWalletPath(ctx context.Context, _ *ptypes.Empty) (*pb.DefaultWalletResponse, error) { + return &pb.DefaultWalletResponse{ + WalletDir: filepath.Join(flags.DefaultValidatorDir(), flags.WalletDefaultDirName), + }, nil +} + // CreateWallet via an API request, allowing a user to save a new // derived, direct, or remote wallet. func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) (*pb.CreateWalletResponse, error) { - // Currently defaultWalletPath is used as the wallet directory and req's WalletPath is ignored for simplicity - exists, err := wallet.Exists(defaultWalletPath) + walletDir := s.walletDir + if strings.TrimSpace(req.WalletPath) != "" { + walletDir = req.WalletPath + } + exists, err := wallet.Exists(walletDir) if err != nil { return nil, status.Errorf(codes.Internal, "Could not check for existing wallet: %v", err) } if exists { - return nil, status.Error(codes.AlreadyExists, "A wallet already exists at this location.") + if err := s.initializeWallet(ctx, &wallet.Config{ + WalletDir: walletDir, + WalletPassword: req.WalletPassword, + }); err != nil { + return nil, err + } + keymanagerKind := pb.KeymanagerKind_DIRECT + switch s.wallet.KeymanagerKind() { + case v2keymanager.Derived: + keymanagerKind = pb.KeymanagerKind_DERIVED + case v2keymanager.Remote: + keymanagerKind = pb.KeymanagerKind_REMOTE + } + return &pb.CreateWalletResponse{ + Wallet: &pb.WalletResponse{ + WalletPath: walletDir, + KeymanagerKind: keymanagerKind, + }, + }, nil } switch req.Keymanager { case pb.KeymanagerKind_DIRECT: - // Needs to unmarshal the keystores from the requests. - if req.KeystoresImported == nil || len(req.KeystoresImported) < 1 { - return nil, status.Error(codes.InvalidArgument, "No keystores included for import") - } - keystores := make([]*v2keymanager.Keystore, len(req.KeystoresImported)) - for i := 0; i < len(req.KeystoresImported); i++ { - encoded := req.KeystoresImported[i] - keystore := &v2keymanager.Keystore{} - if err := json.Unmarshal([]byte(encoded), &keystore); err != nil { - return nil, status.Errorf(codes.InvalidArgument, "Not a valid EIP-2335 keystore JSON file: %v", err) - } - keystores[i] = keystore - } w, err := v2.CreateWalletWithKeymanager(ctx, &v2.CreateWalletConfig{ WalletCfg: &wallet.Config{ - WalletDir: defaultWalletPath, + WalletDir: walletDir, KeymanagerKind: v2keymanager.Direct, WalletPassword: req.WalletPassword, }, @@ -84,16 +101,11 @@ func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) if err != nil { return nil, err } - // Import the uploaded accounts. - if err := v2.ImportAccounts(ctx, &v2.ImportAccountsConfig{ - Wallet: w, - Keystores: keystores, - AccountPassword: req.KeystoresPassword, - }); err != nil { + if err := w.SaveHashedPassword(ctx); err != nil { return nil, err } if err := s.initializeWallet(ctx, &wallet.Config{ - WalletDir: defaultWalletPath, + WalletDir: walletDir, KeymanagerKind: v2keymanager.Direct, WalletPassword: req.WalletPassword, }); err != nil { @@ -101,7 +113,7 @@ func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) } return &pb.CreateWalletResponse{ Wallet: &pb.WalletResponse{ - WalletPath: defaultWalletPath, + WalletPath: walletDir, KeymanagerKind: pb.KeymanagerKind_DIRECT, }, }, nil @@ -113,7 +125,7 @@ func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) return nil, status.Error(codes.InvalidArgument, "Must include mnemonic in request") } _, depositData, err := v2.RecoverWallet(ctx, &v2.RecoverWalletConfig{ - WalletDir: defaultWalletPath, + WalletDir: walletDir, WalletPassword: req.WalletPassword, Mnemonic: req.Mnemonic, NumAccounts: int64(req.NumAccounts), @@ -122,7 +134,7 @@ func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) return nil, err } if err := s.initializeWallet(ctx, &wallet.Config{ - WalletDir: defaultWalletPath, + WalletDir: walletDir, KeymanagerKind: v2keymanager.Direct, WalletPassword: req.WalletPassword, }); err != nil { @@ -141,7 +153,7 @@ func (s *Server) CreateWallet(ctx context.Context, req *pb.CreateWalletRequest) } return &pb.CreateWalletResponse{ Wallet: &pb.WalletResponse{ - WalletPath: defaultWalletPath, + WalletPath: walletDir, KeymanagerKind: pb.KeymanagerKind_DERIVED, }, AccountsCreated: &pb.DepositDataResponse{ @@ -162,7 +174,7 @@ func (s *Server) EditConfig(ctx context.Context, req *pb.EditWalletConfigRequest // WalletConfig returns the wallet's configuration. If no wallet exists, we return an empty response. func (s *Server) WalletConfig(ctx context.Context, _ *ptypes.Empty) (*pb.WalletResponse, error) { - exists, err := wallet.Exists(defaultWalletPath) + exists, err := wallet.Exists(s.walletDir) if err != nil { return nil, status.Errorf(codes.Internal, checkExistsErrMsg) } @@ -170,7 +182,7 @@ func (s *Server) WalletConfig(ctx context.Context, _ *ptypes.Empty) (*pb.WalletR // If no wallet is found, we simply return an empty response. return &pb.WalletResponse{}, nil } - valid, err := wallet.IsValid(defaultWalletPath) + valid, err := wallet.IsValid(s.walletDir) if err == wallet.ErrNoWalletFound { return &pb.WalletResponse{}, nil } @@ -207,7 +219,7 @@ func (s *Server) WalletConfig(ctx context.Context, _ *ptypes.Empty) (*pb.WalletR return nil, status.Errorf(codes.Internal, "Could not JSON unmarshal keymanager config: %v", err) } return &pb.WalletResponse{ - WalletPath: defaultWalletPath, + WalletPath: s.walletDir, KeymanagerKind: keymanagerKind, KeymanagerConfig: config, }, nil @@ -235,14 +247,14 @@ func (s *Server) GenerateMnemonic(ctx context.Context, _ *ptypes.Empty) (*pb.Gen // ChangePassword allows changing a wallet password via the API as // an authenticated method. func (s *Server) ChangePassword(ctx context.Context, req *pb.ChangePasswordRequest) (*ptypes.Empty, error) { - exists, err := wallet.Exists(defaultWalletPath) + exists, err := wallet.Exists(s.walletDir) if err != nil { return nil, status.Errorf(codes.Internal, checkExistsErrMsg) } if !exists { return nil, status.Errorf(codes.FailedPrecondition, noWalletMsg) } - valid, err := wallet.IsValid(defaultWalletPath) + valid, err := wallet.IsValid(s.walletDir) if err == wallet.ErrNoWalletFound { return nil, status.Errorf(codes.FailedPrecondition, noWalletMsg) } @@ -252,12 +264,26 @@ func (s *Server) ChangePassword(ctx context.Context, req *pb.ChangePasswordReque if !valid { return nil, status.Errorf(codes.FailedPrecondition, invalidWalletMsg) } - if req.Password == "" { - return nil, status.Error(codes.InvalidArgument, "Password cannot be empty") + if req.CurrentPassword == "" { + return nil, status.Error(codes.InvalidArgument, "Current wallet password cannot be empty") + } + hashedPasswordPath := filepath.Join(s.walletDir, wallet.HashedPasswordFileName) + if !fileutil.FileExists(hashedPasswordPath) { + return nil, status.Error(codes.FailedPrecondition, "Could not compare password from disk") + } + hashedPassword, err := fileutil.ReadFileAsBytes(hashedPasswordPath) + if err != nil { + return nil, status.Error(codes.FailedPrecondition, "Could not retrieve hashed password from disk") + } + if err := bcrypt.CompareHashAndPassword(hashedPassword, []byte(req.CurrentPassword)); err != nil { + return nil, status.Error(codes.Unauthenticated, "Incorrect wallet password") } if req.Password != req.PasswordConfirmation { return nil, status.Error(codes.InvalidArgument, "Password does not match confirmation") } + if err := promptutil.ValidatePasswordInput(req.Password); err != nil { + return nil, status.Error(codes.InvalidArgument, "Could not validate wallet password input") + } switch s.wallet.KeymanagerKind() { case v2keymanager.Direct: km, ok := s.keymanager.(*direct.Keymanager) @@ -297,7 +323,8 @@ func (s *Server) ImportKeystores( if s.wallet == nil { return nil, status.Error(codes.FailedPrecondition, "No wallet initialized") } - if s.wallet.KeymanagerKind() != v2keymanager.Direct { + keymanager, ok := s.keymanager.(*direct.Keymanager) + if !ok { return nil, status.Error(codes.FailedPrecondition, "Only Non-HD wallets can import keystores") } if req.KeystoresPassword == "" { @@ -324,12 +351,13 @@ func (s *Server) ImportKeystores( } // Import the uploaded accounts. if err := v2.ImportAccounts(ctx, &v2.ImportAccountsConfig{ - Wallet: s.wallet, + Keymanager: keymanager, Keystores: keystores, AccountPassword: req.KeystoresPassword, }); err != nil { return nil, err } + s.walletInitializedFeed.Send(s.wallet) return &pb.ImportKeystoresResponse{ ImportedPublicKeys: importedPubKeys, }, nil diff --git a/validator/rpc/wallet_test.go b/validator/rpc/wallet_test.go index b491056a19a9..359c9c8f945e 100644 --- a/validator/rpc/wallet_test.go +++ b/validator/rpc/wallet_test.go @@ -39,8 +39,10 @@ func createDirectWalletWithAccounts(t testing.TB, numAccounts int) (*Server, [][ km, err := w.InitializeKeymanager(ctx, true /* skip mnemonic confirm */) require.NoError(t, err) ss := &Server{ - keymanager: km, - wallet: w, + keymanager: km, + wallet: w, + walletDir: defaultWalletPath, + walletInitializedFeed: new(event.Feed), } // First we import accounts into the wallet. encryptor := keystorev4.New() @@ -82,21 +84,29 @@ func TestServer_CreateWallet_Direct(t *testing.T) { strongPass := "29384283xasjasd32%%&*@*#*" s := &Server{ walletInitializedFeed: new(event.Feed), + walletDir: defaultWalletPath, } + _, err := s.Signup(ctx, &pb.AuthRequest{ + Password: strongPass, + WalletDir: defaultWalletPath, + }) + require.NoError(t, err) req := &pb.CreateWalletRequest{ - WalletPath: localWalletDir, - Keymanager: pb.KeymanagerKind_DIRECT, - WalletPassword: strongPass, - KeystoresPassword: strongPass, + WalletPath: localWalletDir, + Keymanager: pb.KeymanagerKind_DIRECT, + WalletPassword: strongPass, } // We delete the directory at defaultWalletPath as CreateWallet will return an error if it tries to create a wallet // where a directory already exists require.NoError(t, os.RemoveAll(defaultWalletPath)) - _, err := s.CreateWallet(ctx, req) - require.ErrorContains(t, "No keystores included for import", err) - - req.KeystoresImported = []string{"badjson"} _, err = s.CreateWallet(ctx, req) + require.NoError(t, err) + + importReq := &pb.ImportKeystoresRequest{ + KeystoresPassword: strongPass, + KeystoresImported: []string{"badjson"}, + } + _, err = s.ImportKeystores(ctx, importReq) require.ErrorContains(t, "Not a valid EIP-2335 keystore", err) encryptor := keystorev4.New() @@ -119,8 +129,8 @@ func TestServer_CreateWallet_Direct(t *testing.T) { require.NoError(t, err) keystores[i] = string(encodedFile) } - req.KeystoresImported = keystores - _, err = s.CreateWallet(ctx, req) + importReq.KeystoresImported = keystores + _, err = s.ImportKeystores(ctx, importReq) require.NoError(t, err) } @@ -154,10 +164,6 @@ func TestServer_CreateWallet_Derived(t *testing.T) { _, err = s.CreateWallet(ctx, req) require.NoError(t, err) - - // Now trying to create a wallet where a previous wallet already exists. We expect an error. - _, err = s.CreateWallet(ctx, req) - require.ErrorContains(t, "wallet already exists at this location", err) } func TestServer_WalletConfig_NoWalletFound(t *testing.T) { @@ -174,6 +180,7 @@ func TestServer_WalletConfig(t *testing.T) { strongPass := "29384283xasjasd32%%&*@*#*" s := &Server{ walletInitializedFeed: new(event.Feed), + walletDir: defaultWalletPath, } // We attempt to create the wallet. w, err := v2.CreateWalletWithKeymanager(ctx, &v2.CreateWalletConfig{ @@ -210,9 +217,12 @@ func TestServer_ChangePassword_Preconditions(t *testing.T) { defaultWalletPath = localWalletDir ctx := context.Background() strongPass := "29384283xasjasd32%%&*@*#*" - ss := &Server{} + ss := &Server{ + walletDir: defaultWalletPath, + } _, err := ss.ChangePassword(ctx, &pb.ChangePasswordRequest{ - Password: "", + CurrentPassword: strongPass, + Password: "", }) assert.ErrorContains(t, noWalletMsg, err) // We attempt to create the wallet. @@ -231,10 +241,12 @@ func TestServer_ChangePassword_Preconditions(t *testing.T) { ss.walletInitialized = true ss.keymanager = km _, err = ss.ChangePassword(ctx, &pb.ChangePasswordRequest{ - Password: "", + CurrentPassword: strongPass, + Password: "", }) - assert.ErrorContains(t, "cannot be empty", err) + assert.ErrorContains(t, "Could not validate wallet password", err) _, err = ss.ChangePassword(ctx, &pb.ChangePasswordRequest{ + CurrentPassword: strongPass, Password: "abc", PasswordConfirmation: "def", }) @@ -245,6 +257,7 @@ func TestServer_ChangePassword_DirectKeymanager(t *testing.T) { ss, _ := createDirectWalletWithAccounts(t, 1) newPassword := "NewPassw0rdz%%%%pass" _, err := ss.ChangePassword(context.Background(), &pb.ChangePasswordRequest{ + CurrentPassword: ss.wallet.Password(), Password: newPassword, PasswordConfirmation: newPassword, }) @@ -269,12 +282,15 @@ func TestServer_ChangePassword_DerivedKeymanager(t *testing.T) { require.NoError(t, err) km, err := w.InitializeKeymanager(ctx, true /* skip mnemonic confirm */) require.NoError(t, err) - ss := &Server{} + ss := &Server{ + walletDir: defaultWalletPath, + } ss.wallet = w ss.walletInitialized = true ss.keymanager = km newPassword := "NewPassw0rdz%%%%pass" _, err = ss.ChangePassword(ctx, &pb.ChangePasswordRequest{ + CurrentPassword: strongPass, Password: newPassword, PasswordConfirmation: newPassword, }) @@ -287,7 +303,9 @@ func TestServer_HasWallet(t *testing.T) { defaultWalletPath = localWalletDir ctx := context.Background() strongPass := "29384283xasjasd32%%&*@*#*" - ss := &Server{} + ss := &Server{ + walletDir: defaultWalletPath, + } // First delete the created folder and check the response require.NoError(t, os.RemoveAll(defaultWalletPath)) resp, err := ss.HasWallet(ctx, &ptypes.Empty{}) @@ -383,6 +401,7 @@ func TestServer_ImportKeystores_FailedPreconditions(t *testing.T) { } func TestServer_ImportKeystores_OK(t *testing.T) { + direct.ResetCaches() localWalletDir := setupWalletDir(t) defaultWalletPath = localWalletDir ctx := context.Background() @@ -400,8 +419,9 @@ func TestServer_ImportKeystores_OK(t *testing.T) { km, err := w.InitializeKeymanager(ctx, true /* skip mnemonic confirm */) require.NoError(t, err) ss := &Server{ - keymanager: km, - wallet: w, + keymanager: km, + wallet: w, + walletInitializedFeed: new(event.Feed), } // Create 3 keystores. diff --git a/validator/web/handler_test.go b/validator/web/handler_test.go index 7eb97e50beaf..6d256a915d9e 100644 --- a/validator/web/handler_test.go +++ b/validator/web/handler_test.go @@ -37,7 +37,7 @@ func TestWebHandler(t *testing.T) { name: "favicon.ico", requestURI: "/favicon.ico", wantStatus: 200, - wantContentType: "image/vnd.microsoft.icon", + wantContentType: "", }, } @@ -47,7 +47,9 @@ func TestWebHandler(t *testing.T) { res := httptest.NewRecorder() webHandler(res, req) assert.Equal(t, tt.wantStatus, res.Result().StatusCode) - assert.Equal(t, tt.wantContentType, res.Result().Header.Get("Content-Type")) + if tt.wantContentType != "" { + assert.Equal(t, tt.wantContentType, res.Result().Header.Get("Content-Type")) + } }) } }