From 36e897cd4c6513d8e33f24168ec53b086347b4c3 Mon Sep 17 00:00:00 2001 From: Jamie Holdstock Date: Fri, 13 Sep 2019 02:11:24 +0100 Subject: [PATCH] Prevent unnecessary wallet rescans. (#519) * Prevent unnecessary wallet rescans. This is acheived by adding a new stakepoold RPC. Previously we used a single RPC to import redeem scripts, regardless of whether they were new or historic. A rescan was triggered every time a script was imported. This was problematic because on startup, dcrstakepool performs consistency checks against each back-end and may import multiple scripts into a single wallet simultaneously. I have split the `ImportScript` RPC into two `ImportNewScript` and `ImportMissingScripts`. `ImportNewScript` will never trigger a rescan because a new script should have no associated history. This is used when a new wallet is connected to the VSP. `ImportMissingScripts` is used by the consistency checks, and will import multiple scripts before triggering a single rescan. --- backend/stakepoold/rpc/api.proto | 16 +- backend/stakepoold/rpc/rpcserver/context.go | 46 +- backend/stakepoold/rpc/rpcserver/server.go | 22 +- backend/stakepoold/rpc/stakepoolrpc/api.pb.go | 436 +++++++++++------- controllers/main.go | 4 +- stakepooldclient/stakepooldclient.go | 68 +-- 6 files changed, 381 insertions(+), 211 deletions(-) diff --git a/backend/stakepoold/rpc/api.proto b/backend/stakepoold/rpc/api.proto index 63402863..ab6afb90 100644 --- a/backend/stakepoold/rpc/api.proto +++ b/backend/stakepoold/rpc/api.proto @@ -8,7 +8,8 @@ service StakepooldService { rpc GetLiveTickets (GetLiveTicketsRequest) returns (GetLiveTicketsResponse); rpc SetAddedLowFeeTickets (SetAddedLowFeeTicketsRequest) returns (SetAddedLowFeeTicketsResponse); rpc SetUserVotingPrefs (SetUserVotingPrefsRequest) returns (SetUserVotingPrefsResponse); - rpc ImportScript (ImportScriptRequest) returns (ImportScriptResponse); + rpc ImportNewScript (ImportNewScriptRequest) returns (ImportNewScriptResponse); + rpc ImportMissingScripts (ImportMissingScriptsRequest) returns (ImportMissingScriptsResponse); rpc StakePoolUserInfo (StakePoolUserInfoRequest) returns (StakePoolUserInfoResponse); rpc WalletInfo (WalletInfoRequest) returns (WalletInfoResponse); rpc ValidateAddress (ValidateAddressRequest) returns (ValidateAddressResponse); @@ -78,12 +79,17 @@ message AccountSyncAddressIndexRequest { message AccountSyncAddressIndexResponse { } -message ImportScriptRequest { +message ImportMissingScriptsRequest { + repeated bytes Scripts = 1; + int64 RescanHeight = 2; +} +message ImportMissingScriptsResponse { +} + +message ImportNewScriptRequest { bytes Script = 1; - bool Rescan = 2; - int64 RescanHeight = 3; } -message ImportScriptResponse { +message ImportNewScriptResponse { int64 HeightImported = 1; } diff --git a/backend/stakepoold/rpc/rpcserver/context.go b/backend/stakepoold/rpc/rpcserver/context.go index 5433ceac..934a5878 100644 --- a/backend/stakepoold/rpc/rpcserver/context.go +++ b/backend/stakepoold/rpc/rpcserver/context.go @@ -277,19 +277,53 @@ func (ctx *AppContext) UpdateTicketDataFromMySQL() error { return nil } -func (ctx *AppContext) ImportScript(script []byte, rescan bool, rescanHeight int64) (int64, error) { - err := ctx.WalletConnection.ImportScriptRescanFrom(script, rescan, int(rescanHeight)) +// ImportNewScript will import a redeem script into dcrwallet. No rescan is +// performed because we are importing a brand new script, it shouldn't have any +// associated history. Current block height is returned to indicate which height +// the new user has registered. +func (ctx *AppContext) ImportNewScript(script []byte) (int64, error) { + + err := ctx.WalletConnection.ImportScriptRescanFrom(script, false, 0) if err != nil { - log.Errorf("ImportScript: ImportScript rpc failed: %v", err) + log.Errorf("ImportNewScript: ImportScriptRescanFrom rpc failed: %v", err) return -1, err } - _, block, err := ctx.WalletConnection.GetBestBlock() + _, bestBlockHeight, err := ctx.WalletConnection.GetBestBlock() if err != nil { - log.Errorf("ImportScript: getBetBlock rpc failed: %v", err) + log.Errorf("ImportNewScript: GetBestBlock rpc failed: %v", err) return -1, err } - return block, nil + return bestBlockHeight, nil +} + +// ImportMissingScripts accepts a list of redeem scripts and a rescan height. It +// will import all but one of the scripts without triggering a wallet rescan, +// and finally trigger a rescan from the provided height after importing the +// last one. +func (ctx *AppContext) ImportMissingScripts(scripts [][]byte, rescanHeight int) error { + + // Import n-1 scripts without a rescan. + allButOne := scripts[:len(scripts)-1] + for _, script := range allButOne { + err := ctx.WalletConnection.ImportScriptRescanFrom(script, false, 0) + if err != nil { + log.Errorf("ImportMissingScripts: ImportScript rpc failed: %v", err) + return err + } + } + + // Import the last script and trigger a rescan + lastOne := scripts[len(scripts)-1] + err := ctx.WalletConnection.ImportScriptRescanFrom(lastOne, true, rescanHeight) + if err != nil { + log.Errorf("ImportMissingScripts: ImportScriptRescanFrom rpc failed: %v", err) + return err + } + + log.Infof("ImportMissingScripts: Imported %d scripts and triggered a rescan from height %d", len(scripts), rescanHeight) + + return nil } func (ctx *AppContext) AddMissingTicket(ticketHash []byte) error { diff --git a/backend/stakepoold/rpc/rpcserver/server.go b/backend/stakepoold/rpc/rpcserver/server.go index 9d3ea23a..99ffced0 100644 --- a/backend/stakepoold/rpc/rpcserver/server.go +++ b/backend/stakepoold/rpc/rpcserver/server.go @@ -34,8 +34,8 @@ const ( // collection cycle to also trigger a timeout but the current allocation // pattern of stakepoold is not known to cause such conditions at this time. GRPCCommandTimeout = time.Millisecond * 100 - semverString = "7.0.0" - semverMajor = 7 + semverString = "8.0.0" + semverMajor = 8 semverMinor = 0 semverPatch = 0 ) @@ -184,20 +184,32 @@ func (s *stakepooldServer) SetUserVotingPrefs(ctx context.Context, req *pb.SetUs return &pb.SetUserVotingPrefsResponse{}, nil } -func (s *stakepooldServer) ImportScript(ctx context.Context, req *pb.ImportScriptRequest) (*pb.ImportScriptResponse, error) { +func (s *stakepooldServer) ImportNewScript(ctx context.Context, req *pb.ImportNewScriptRequest) (*pb.ImportNewScriptResponse, error) { if !s.walletConnected() { return nil, ErrWalletNotConnected } - heightImported, err := s.appContext.ImportScript(req.Script, req.Rescan, req.RescanHeight) + heightImported, err := s.appContext.ImportNewScript(req.Script) if err != nil { return nil, err } - return &pb.ImportScriptResponse{ + return &pb.ImportNewScriptResponse{ HeightImported: heightImported, }, nil } +func (s *stakepooldServer) ImportMissingScripts(ctx context.Context, req *pb.ImportMissingScriptsRequest) (*pb.ImportMissingScriptsResponse, error) { + if !s.walletConnected() { + return nil, ErrWalletNotConnected + } + + err := s.appContext.ImportMissingScripts(req.Scripts, int(req.RescanHeight)) + if err != nil { + return nil, err + } + return &pb.ImportMissingScriptsResponse{}, nil +} + func (s *stakepooldServer) ListScripts(ctx context.Context, req *pb.ListScriptsRequest) (*pb.ListScriptsResponse, error) { if !s.walletConnected() { return nil, ErrWalletNotConnected diff --git a/backend/stakepoold/rpc/stakepoolrpc/api.pb.go b/backend/stakepoold/rpc/stakepoolrpc/api.pb.go index db70391f..f9f6039e 100644 --- a/backend/stakepoold/rpc/stakepoolrpc/api.pb.go +++ b/backend/stakepoold/rpc/stakepoolrpc/api.pb.go @@ -678,94 +678,156 @@ func (m *AccountSyncAddressIndexResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AccountSyncAddressIndexResponse proto.InternalMessageInfo -type ImportScriptRequest struct { - Script []byte `protobuf:"bytes,1,opt,name=Script,proto3" json:"Script,omitempty"` - Rescan bool `protobuf:"varint,2,opt,name=Rescan,proto3" json:"Rescan,omitempty"` - RescanHeight int64 `protobuf:"varint,3,opt,name=RescanHeight,proto3" json:"RescanHeight,omitempty"` +type ImportMissingScriptsRequest struct { + Scripts [][]byte `protobuf:"bytes,1,rep,name=Scripts,proto3" json:"Scripts,omitempty"` + RescanHeight int64 `protobuf:"varint,2,opt,name=RescanHeight,proto3" json:"RescanHeight,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *ImportScriptRequest) Reset() { *m = ImportScriptRequest{} } -func (m *ImportScriptRequest) String() string { return proto.CompactTextString(m) } -func (*ImportScriptRequest) ProtoMessage() {} -func (*ImportScriptRequest) Descriptor() ([]byte, []int) { +func (m *ImportMissingScriptsRequest) Reset() { *m = ImportMissingScriptsRequest{} } +func (m *ImportMissingScriptsRequest) String() string { return proto.CompactTextString(m) } +func (*ImportMissingScriptsRequest) ProtoMessage() {} +func (*ImportMissingScriptsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_00212fb1f9d3bf1c, []int{18} } -func (m *ImportScriptRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ImportScriptRequest.Unmarshal(m, b) +func (m *ImportMissingScriptsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportMissingScriptsRequest.Unmarshal(m, b) } -func (m *ImportScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ImportScriptRequest.Marshal(b, m, deterministic) +func (m *ImportMissingScriptsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportMissingScriptsRequest.Marshal(b, m, deterministic) } -func (m *ImportScriptRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImportScriptRequest.Merge(m, src) +func (m *ImportMissingScriptsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportMissingScriptsRequest.Merge(m, src) } -func (m *ImportScriptRequest) XXX_Size() int { - return xxx_messageInfo_ImportScriptRequest.Size(m) +func (m *ImportMissingScriptsRequest) XXX_Size() int { + return xxx_messageInfo_ImportMissingScriptsRequest.Size(m) } -func (m *ImportScriptRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ImportScriptRequest.DiscardUnknown(m) +func (m *ImportMissingScriptsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ImportMissingScriptsRequest.DiscardUnknown(m) } -var xxx_messageInfo_ImportScriptRequest proto.InternalMessageInfo +var xxx_messageInfo_ImportMissingScriptsRequest proto.InternalMessageInfo -func (m *ImportScriptRequest) GetScript() []byte { +func (m *ImportMissingScriptsRequest) GetScripts() [][]byte { if m != nil { - return m.Script + return m.Scripts } return nil } -func (m *ImportScriptRequest) GetRescan() bool { +func (m *ImportMissingScriptsRequest) GetRescanHeight() int64 { if m != nil { - return m.Rescan + return m.RescanHeight } - return false + return 0 +} + +type ImportMissingScriptsResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *ImportScriptRequest) GetRescanHeight() int64 { +func (m *ImportMissingScriptsResponse) Reset() { *m = ImportMissingScriptsResponse{} } +func (m *ImportMissingScriptsResponse) String() string { return proto.CompactTextString(m) } +func (*ImportMissingScriptsResponse) ProtoMessage() {} +func (*ImportMissingScriptsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{19} +} + +func (m *ImportMissingScriptsResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportMissingScriptsResponse.Unmarshal(m, b) +} +func (m *ImportMissingScriptsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportMissingScriptsResponse.Marshal(b, m, deterministic) +} +func (m *ImportMissingScriptsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportMissingScriptsResponse.Merge(m, src) +} +func (m *ImportMissingScriptsResponse) XXX_Size() int { + return xxx_messageInfo_ImportMissingScriptsResponse.Size(m) +} +func (m *ImportMissingScriptsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ImportMissingScriptsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportMissingScriptsResponse proto.InternalMessageInfo + +type ImportNewScriptRequest struct { + Script []byte `protobuf:"bytes,1,opt,name=Script,proto3" json:"Script,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ImportNewScriptRequest) Reset() { *m = ImportNewScriptRequest{} } +func (m *ImportNewScriptRequest) String() string { return proto.CompactTextString(m) } +func (*ImportNewScriptRequest) ProtoMessage() {} +func (*ImportNewScriptRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{20} +} + +func (m *ImportNewScriptRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportNewScriptRequest.Unmarshal(m, b) +} +func (m *ImportNewScriptRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportNewScriptRequest.Marshal(b, m, deterministic) +} +func (m *ImportNewScriptRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportNewScriptRequest.Merge(m, src) +} +func (m *ImportNewScriptRequest) XXX_Size() int { + return xxx_messageInfo_ImportNewScriptRequest.Size(m) +} +func (m *ImportNewScriptRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ImportNewScriptRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ImportNewScriptRequest proto.InternalMessageInfo + +func (m *ImportNewScriptRequest) GetScript() []byte { if m != nil { - return m.RescanHeight + return m.Script } - return 0 + return nil } -type ImportScriptResponse struct { +type ImportNewScriptResponse struct { HeightImported int64 `protobuf:"varint,1,opt,name=HeightImported,proto3" json:"HeightImported,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *ImportScriptResponse) Reset() { *m = ImportScriptResponse{} } -func (m *ImportScriptResponse) String() string { return proto.CompactTextString(m) } -func (*ImportScriptResponse) ProtoMessage() {} -func (*ImportScriptResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{19} +func (m *ImportNewScriptResponse) Reset() { *m = ImportNewScriptResponse{} } +func (m *ImportNewScriptResponse) String() string { return proto.CompactTextString(m) } +func (*ImportNewScriptResponse) ProtoMessage() {} +func (*ImportNewScriptResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_00212fb1f9d3bf1c, []int{21} } -func (m *ImportScriptResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ImportScriptResponse.Unmarshal(m, b) +func (m *ImportNewScriptResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ImportNewScriptResponse.Unmarshal(m, b) } -func (m *ImportScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ImportScriptResponse.Marshal(b, m, deterministic) +func (m *ImportNewScriptResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ImportNewScriptResponse.Marshal(b, m, deterministic) } -func (m *ImportScriptResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ImportScriptResponse.Merge(m, src) +func (m *ImportNewScriptResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ImportNewScriptResponse.Merge(m, src) } -func (m *ImportScriptResponse) XXX_Size() int { - return xxx_messageInfo_ImportScriptResponse.Size(m) +func (m *ImportNewScriptResponse) XXX_Size() int { + return xxx_messageInfo_ImportNewScriptResponse.Size(m) } -func (m *ImportScriptResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ImportScriptResponse.DiscardUnknown(m) +func (m *ImportNewScriptResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ImportNewScriptResponse.DiscardUnknown(m) } -var xxx_messageInfo_ImportScriptResponse proto.InternalMessageInfo +var xxx_messageInfo_ImportNewScriptResponse proto.InternalMessageInfo -func (m *ImportScriptResponse) GetHeightImported() int64 { +func (m *ImportNewScriptResponse) GetHeightImported() int64 { if m != nil { return m.HeightImported } @@ -783,7 +845,7 @@ func (m *StakePoolUserInfoRequest) Reset() { *m = StakePoolUserInfoReque func (m *StakePoolUserInfoRequest) String() string { return proto.CompactTextString(m) } func (*StakePoolUserInfoRequest) ProtoMessage() {} func (*StakePoolUserInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{20} + return fileDescriptor_00212fb1f9d3bf1c, []int{22} } func (m *StakePoolUserInfoRequest) XXX_Unmarshal(b []byte) error { @@ -823,7 +885,7 @@ func (m *StakePoolUserInfoResponse) Reset() { *m = StakePoolUserInfoResp func (m *StakePoolUserInfoResponse) String() string { return proto.CompactTextString(m) } func (*StakePoolUserInfoResponse) ProtoMessage() {} func (*StakePoolUserInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{21} + return fileDescriptor_00212fb1f9d3bf1c, []int{23} } func (m *StakePoolUserInfoResponse) XXX_Unmarshal(b []byte) error { @@ -868,7 +930,7 @@ func (m *WalletInfoRequest) Reset() { *m = WalletInfoRequest{} } func (m *WalletInfoRequest) String() string { return proto.CompactTextString(m) } func (*WalletInfoRequest) ProtoMessage() {} func (*WalletInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{22} + return fileDescriptor_00212fb1f9d3bf1c, []int{24} } func (m *WalletInfoRequest) XXX_Unmarshal(b []byte) error { @@ -903,7 +965,7 @@ func (m *WalletInfoResponse) Reset() { *m = WalletInfoResponse{} } func (m *WalletInfoResponse) String() string { return proto.CompactTextString(m) } func (*WalletInfoResponse) ProtoMessage() {} func (*WalletInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{23} + return fileDescriptor_00212fb1f9d3bf1c, []int{25} } func (m *WalletInfoResponse) XXX_Unmarshal(b []byte) error { @@ -963,7 +1025,7 @@ func (m *ValidateAddressRequest) Reset() { *m = ValidateAddressRequest{} func (m *ValidateAddressRequest) String() string { return proto.CompactTextString(m) } func (*ValidateAddressRequest) ProtoMessage() {} func (*ValidateAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{24} + return fileDescriptor_00212fb1f9d3bf1c, []int{26} } func (m *ValidateAddressRequest) XXX_Unmarshal(b []byte) error { @@ -1003,7 +1065,7 @@ func (m *ValidateAddressResponse) Reset() { *m = ValidateAddressResponse func (m *ValidateAddressResponse) String() string { return proto.CompactTextString(m) } func (*ValidateAddressResponse) ProtoMessage() {} func (*ValidateAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{25} + return fileDescriptor_00212fb1f9d3bf1c, []int{27} } func (m *ValidateAddressResponse) XXX_Unmarshal(b []byte) error { @@ -1049,7 +1111,7 @@ func (m *CreateMultisigRequest) Reset() { *m = CreateMultisigRequest{} } func (m *CreateMultisigRequest) String() string { return proto.CompactTextString(m) } func (*CreateMultisigRequest) ProtoMessage() {} func (*CreateMultisigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{26} + return fileDescriptor_00212fb1f9d3bf1c, []int{28} } func (m *CreateMultisigRequest) XXX_Unmarshal(b []byte) error { @@ -1089,7 +1151,7 @@ func (m *CreateMultisigResponse) Reset() { *m = CreateMultisigResponse{} func (m *CreateMultisigResponse) String() string { return proto.CompactTextString(m) } func (*CreateMultisigResponse) ProtoMessage() {} func (*CreateMultisigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{27} + return fileDescriptor_00212fb1f9d3bf1c, []int{29} } func (m *CreateMultisigResponse) XXX_Unmarshal(b []byte) error { @@ -1139,7 +1201,7 @@ func (m *StakePoolUserTicket) Reset() { *m = StakePoolUserTicket{} } func (m *StakePoolUserTicket) String() string { return proto.CompactTextString(m) } func (*StakePoolUserTicket) ProtoMessage() {} func (*StakePoolUserTicket) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{28} + return fileDescriptor_00212fb1f9d3bf1c, []int{30} } func (m *StakePoolUserTicket) XXX_Unmarshal(b []byte) error { @@ -1207,7 +1269,7 @@ func (m *Ticket) Reset() { *m = Ticket{} } func (m *Ticket) String() string { return proto.CompactTextString(m) } func (*Ticket) ProtoMessage() {} func (*Ticket) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{29} + return fileDescriptor_00212fb1f9d3bf1c, []int{31} } func (m *Ticket) XXX_Unmarshal(b []byte) error { @@ -1256,7 +1318,7 @@ func (m *UserVotingConfigEntry) Reset() { *m = UserVotingConfigEntry{} } func (m *UserVotingConfigEntry) String() string { return proto.CompactTextString(m) } func (*UserVotingConfigEntry) ProtoMessage() {} func (*UserVotingConfigEntry) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{30} + return fileDescriptor_00212fb1f9d3bf1c, []int{32} } func (m *UserVotingConfigEntry) XXX_Unmarshal(b []byte) error { @@ -1315,7 +1377,7 @@ func (m *VersionRequest) Reset() { *m = VersionRequest{} } func (m *VersionRequest) String() string { return proto.CompactTextString(m) } func (*VersionRequest) ProtoMessage() {} func (*VersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{31} + return fileDescriptor_00212fb1f9d3bf1c, []int{33} } func (m *VersionRequest) XXX_Unmarshal(b []byte) error { @@ -1352,7 +1414,7 @@ func (m *VersionResponse) Reset() { *m = VersionResponse{} } func (m *VersionResponse) String() string { return proto.CompactTextString(m) } func (*VersionResponse) ProtoMessage() {} func (*VersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{32} + return fileDescriptor_00212fb1f9d3bf1c, []int{34} } func (m *VersionResponse) XXX_Unmarshal(b []byte) error { @@ -1425,7 +1487,7 @@ func (m *GetStakeInfoRequest) Reset() { *m = GetStakeInfoRequest{} } func (m *GetStakeInfoRequest) String() string { return proto.CompactTextString(m) } func (*GetStakeInfoRequest) ProtoMessage() {} func (*GetStakeInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{33} + return fileDescriptor_00212fb1f9d3bf1c, []int{35} } func (m *GetStakeInfoRequest) XXX_Unmarshal(b []byte) error { @@ -1472,7 +1534,7 @@ func (m *GetStakeInfoResponse) Reset() { *m = GetStakeInfoResponse{} } func (m *GetStakeInfoResponse) String() string { return proto.CompactTextString(m) } func (*GetStakeInfoResponse) ProtoMessage() {} func (*GetStakeInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_00212fb1f9d3bf1c, []int{34} + return fileDescriptor_00212fb1f9d3bf1c, []int{36} } func (m *GetStakeInfoResponse) XXX_Unmarshal(b []byte) error { @@ -1624,8 +1686,10 @@ func init() { proto.RegisterType((*ListScriptsResponse)(nil), "stakepoolrpc.ListScriptsResponse") proto.RegisterType((*AccountSyncAddressIndexRequest)(nil), "stakepoolrpc.AccountSyncAddressIndexRequest") proto.RegisterType((*AccountSyncAddressIndexResponse)(nil), "stakepoolrpc.AccountSyncAddressIndexResponse") - proto.RegisterType((*ImportScriptRequest)(nil), "stakepoolrpc.ImportScriptRequest") - proto.RegisterType((*ImportScriptResponse)(nil), "stakepoolrpc.ImportScriptResponse") + proto.RegisterType((*ImportMissingScriptsRequest)(nil), "stakepoolrpc.ImportMissingScriptsRequest") + proto.RegisterType((*ImportMissingScriptsResponse)(nil), "stakepoolrpc.ImportMissingScriptsResponse") + proto.RegisterType((*ImportNewScriptRequest)(nil), "stakepoolrpc.ImportNewScriptRequest") + proto.RegisterType((*ImportNewScriptResponse)(nil), "stakepoolrpc.ImportNewScriptResponse") proto.RegisterType((*StakePoolUserInfoRequest)(nil), "stakepoolrpc.StakePoolUserInfoRequest") proto.RegisterType((*StakePoolUserInfoResponse)(nil), "stakepoolrpc.StakePoolUserInfoResponse") proto.RegisterType((*WalletInfoRequest)(nil), "stakepoolrpc.WalletInfoRequest") @@ -1646,97 +1710,99 @@ func init() { func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 1435 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0xdd, 0x4e, 0xdc, 0x46, - 0x14, 0xd6, 0x02, 0x01, 0xf6, 0xc0, 0x02, 0x19, 0xfe, 0x1c, 0x8b, 0xc0, 0xc6, 0xf9, 0x5b, 0xa5, - 0x0d, 0x55, 0xa9, 0xd4, 0x9b, 0xaa, 0x95, 0x20, 0x3f, 0x64, 0xd5, 0xd0, 0x10, 0x3b, 0xd0, 0x4a, - 0x95, 0x8a, 0x8c, 0x3d, 0x2c, 0xd3, 0x78, 0xc7, 0xae, 0x3d,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0x37, 0x94, 0x04, 0x6b, 0xba, 0x59, 0x6b, 0x4d, 0xbb, 0x9a, 0x70, - 0xee, 0xc0, 0xce, 0xd8, 0x93, 0xd0, 0x85, 0x0c, 0x56, 0xdb, 0xdd, 0x24, 0x4e, 0x51, 0xff, 0x5c, - 0x83, 0x0d, 0x98, 0xd5, 0x00, 0xc6, 0x02, 0x29, 0x89, 0xbb, 0x34, 0x0b, 0x7c, 0xae, 0xce, 0x9f, - 0x77, 0x91, 0x22, 0x0e, 0x2c, 0xea, 0xaf, 0x17, 0x94, 0x75, 0x2e, 0x05, 0xaa, 0x51, 0xc2, 0x9c, - 0xef, 0x60, 0xad, 0x7c, 0x14, 0x7a, 0xea, 0x01, 0x2c, 0x69, 0x0e, 0xbd, 0x4a, 0x43, 0x75, 0xe6, - 0xb4, 0x6b, 0xa0, 0xce, 0x53, 0xb0, 0x3c, 0x99, 0x70, 0xc7, 0x71, 0x1c, 0xc9, 0x64, 0x6b, 0xf3, - 0x8b, 0xb8, 0x10, 0xf4, 0xa3, 0x5e, 0x24, 0x98, 0xc7, 0x3a, 0x68, 0x26, 0x7a, 0xce, 0x84, 0x9d, - 0x3f, 0x6a, 0x70, 0xab, 0x42, 0x0c, 0xea, 0xf2, 0x4d, 0x39, 0xf8, 0x0b, 0x7b, 0x77, 0xca, 0x49, - 0x5e, 0xda, 0x99, 0x17, 0x22, 0xee, 0x90, 0x86, 0xb4, 0x79, 0xdf, 0x8f, 0x58, 0x98, 0xcb, 0x98, - 0x6a, 0x4e, 0xb7, 0xea, 0xae, 0x81, 0x3a, 0xab, 0x70, 0xf3, 0x47, 0x3f, 0x8a, 0xa8, 0x28, 0x58, - 0xe0, 0xfc, 0x55, 0x03, 0x52, 0x44, 0x51, 0xa1, 0x26, 0x2c, 0x9c, 0xc6, 0x82, 0x9e, 0xd2, 0x34, - 0x63, 0x31, 0x57, 0x46, 0x35, 0xdc, 0x22, 0x24, 0x4d, 0x7f, 0xea, 0xd3, 0x6e, 0xcc, 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0xe9, 0x4e, 0x15, 0x9a, 0xee, 0xdf, 0x35, 0x58, 0xaf, 0xec, 0xe7, 0xd2, - 0x1a, 0x55, 0x34, 0x79, 0x91, 0x22, 0x55, 0x55, 0x80, 0x53, 0x95, 0x05, 0x28, 0xb3, 0x50, 0xa6, - 0xef, 0x01, 0x13, 0x19, 0xb6, 0x89, 0x01, 0x2d, 0xa5, 0xe4, 0xdf, 0x79, 0xc6, 0xcf, 0x28, 0x16, - 0x13, 0x76, 0x56, 0x60, 0x09, 0x3f, 0xf3, 0x02, 0xfa, 0xb7, 0x06, 0xcb, 0x03, 0x08, 0x23, 0x7d, - 0x1f, 0x96, 0xfa, 0x1a, 0x3a, 0xcb, 0x44, 0x2a, 0xb3, 0x5b, 0x1b, 0xdf, 0x40, 0xd4, 0x53, 0xa0, - 0xec, 0x9e, 0x5d, 0xff, 0xd7, 0x38, 0xc5, 0xa6, 0xaa, 0x09, 0x85, 0x32, 0x1e, 0xa7, 0x18, 0x19, - 0x4d, 0x48, 0x34, 0xf1, 0x45, 0x70, 0xa9, 0x14, 0x6b, 0xb8, 0x9a, 0x90, 0xf9, 0x9b, 0xa4, 0x34, - 0xa5, 0x11, 0xf5, 0x33, 0xaa, 0x62, 0x51, 0x77, 0x0b, 0x88, 0x54, 0xe4, 0xbc, 0xc7, 0xa2, 0xf0, - 0xac, 0x4b, 0x85, 0x1f, 0xfa, 0xc2, 0xb7, 0x66, 0xb5, 0x22, 0x0a, 0x3d, 0x42, 0xd0, 0x59, 0x87, - 0xd5, 0x43, 0x2a, 0x54, 0x76, 0x15, 0x7b, 0xc3, 0x9f, 0x33, 0xb0, 0x56, 0xc6, 0x87, 0xdd, 0xe1, - 0x40, 0x16, 0x30, 0xe6, 0x80, 0x0e, 0x49, 0x11, 0x92, 0x8a, 0x3d, 0x65, 0x17, 0x17, 0x2c, 0xe8, - 0x45, 0xe2, 0x4a, 0xd9, 0x57, 0x73, 0x0b, 0x88, 0xca, 0xc2, 0x58, 0xf8, 0x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8c, 0x3e, 0x7e, 0xec, 0x3b, 0x13, 0x38, - 0x86, 0x5d, 0x62, 0xcc, 0x23, 0xc4, 0xec, 0x12, 0x93, 0x5f, 0x45, 0x66, 0x97, 0xb8, 0xe6, 0x65, - 0x23, 0xbb, 0x44, 0x79, 0xfe, 0x33, 0xbb, 0x44, 0xe5, 0x40, 0x69, 0x76, 0x89, 0x31, 0x23, 0xe4, - 0x09, 0x2c, 0x16, 0x2f, 0x64, 0xb3, 0x94, 0x2a, 0x2e, 0x71, 0xb3, 0x94, 0xaa, 0xee, 0xf3, 0xbd, - 0x9f, 0x06, 0x53, 0x4d, 0xde, 0xd5, 0x9f, 0xc3, 0x5c, 0x3e, 0xe8, 0x6f, 0x19, 0x79, 0x57, 0x1a, - 0x7f, 0xec, 0xdb, 0x63, 0x56, 0xb5, 0xe4, 0xf3, 0x59, 0xf5, 0x4b, 0xe7, 0xab, 0xff, 0x03, 0x00, - 0x00, 0xff, 0xff, 0xcb, 0x80, 0xac, 0x80, 0xdf, 0x11, 0x00, 0x00, + // 1468 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x5f, 0x53, 0xdb, 0x46, + 0x10, 0x1f, 0x63, 0x02, 0x78, 0xc1, 0x40, 0x0e, 0x30, 0x8a, 0x4a, 0xc0, 0x28, 0xff, 0xdc, 0xb4, + 0xa1, 0x2d, 0x9d, 0xe9, 0x4b, 0xa7, 0x0f, 0x90, 0x3f, 0xc4, 0xd3, 0x90, 0x10, 0x29, 0xd0, 0xce, + 0x64, 0xa6, 0x8c, 0x90, 0x0e, 0x73, 0x8d, 0x2c, 0xb9, 0xd2, 0xd9, 0x09, 0x7d, 0xea, 0x07, 0xe8, + 0x63, 0xdf, 0xfb, 0xdc, 0x8f, 0xd1, 0x4f, 0xd0, 0xaf, 0xd4, 0xb9, 0xbb, 0x95, 0x2d, 0x9d, 0x64, + 0x43, 0xf2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0x2a, 0x33, 0xbb, 0xff, 0xae, 0xc0, 0x5a, 0xe9, 0x67, 0x41, + 0x78, 0x23, 0x9b, 0x26, 0x6d, 0x52, 0xa4, 0xca, 0x1a, 0x70, 0xaa, 0xb4, 0x01, 0x45, 0x15, 0x8a, + 0xf2, 0xdd, 0x67, 0x3c, 0xc1, 0xa1, 0x37, 0xa4, 0x85, 0x94, 0xf4, 0x77, 0x5a, 0xf1, 0xd3, 0x92, + 0x45, 0x87, 0xad, 0x65, 0x58, 0xc4, 0x9f, 0x69, 0x03, 0xfd, 0x5b, 0x81, 0xa5, 0x21, 0x84, 0x99, + 0xbe, 0x07, 0x8b, 0x03, 0x05, 0x9d, 0x26, 0x3c, 0x16, 0xd5, 0xad, 0x9c, 0xaf, 0x23, 0xea, 0x48, + 0x50, 0x0c, 0xe1, 0xae, 0xfb, 0x6b, 0x14, 0xe3, 0x6c, 0x56, 0x84, 0x44, 0x59, 0x18, 0xc5, 0x98, + 0x19, 0x45, 0x08, 0xb4, 0xe7, 0x72, 0xef, 0x42, 0x1a, 0x56, 0xb7, 0x15, 0x21, 0xea, 0xb7, 0x17, + 0xd3, 0x98, 0x06, 0xd4, 0x4d, 0xa8, 0xcc, 0x45, 0xcd, 0xce, 0x20, 0xc2, 0x90, 0xb3, 0x3e, 0x0b, + 0xfc, 0xd3, 0x2e, 0xe5, 0xae, 0xef, 0x72, 0xd7, 0x98, 0x51, 0x86, 0x48, 0xf4, 0x10, 0x41, 0x6b, + 0x0d, 0x56, 0x0e, 0x28, 0x97, 0xd5, 0x95, 0x9d, 0x0d, 0x7f, 0x4e, 0xc3, 0x6a, 0x1e, 0x1f, 0x4d, + 0x87, 0x7d, 0xd1, 0xc0, 0x58, 0x03, 0x2a, 0x25, 0x59, 0x48, 0x18, 0xf6, 0x84, 0x9d, 0x9f, 0x33, + 0xaf, 0x1f, 0xf0, 0x4b, 0xe9, 0x5f, 0xc5, 0xce, 0x20, 0xb2, 0x0a, 0x23, 0xee, 0x06, 0x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x52, 0x78, 0xd8, 0xe9, 0x31, 0x29, 0x79, + 0xba, 0xd9, 0x30, 0x9f, 0x79, 0x8a, 0x11, 0xed, 0x42, 0xf1, 0xed, 0x66, 0x6e, 0x4f, 0xe0, 0x18, + 0x4d, 0xa7, 0x31, 0x6f, 0x28, 0x7d, 0x3a, 0x4d, 0x7e, 0xd4, 0xe9, 0xd3, 0xe9, 0x8a, 0x87, 0x99, + 0x98, 0x4e, 0xf9, 0xbd, 0x53, 0x9f, 0x4e, 0xa5, 0x8b, 0xac, 0x3e, 0x9d, 0xc6, 0xac, 0xae, 0xc7, + 0xb0, 0x90, 0x5d, 0x04, 0xc8, 0x76, 0x21, 0xb4, 0xfa, 0xf2, 0x60, 0x5a, 0x93, 0x58, 0x94, 0xd8, + 0xdd, 0x9f, 0x87, 0xdb, 0x54, 0xfa, 0x35, 0x79, 0x06, 0xb3, 0xe9, 0x03, 0x63, 0x43, 0xab, 0xbb, + 0xdc, 0xda, 0x65, 0xde, 0x1e, 0x73, 0xaa, 0x24, 0x9f, 0xcd, 0xc8, 0x7f, 0xa4, 0xbe, 0xfd, 0x3f, + 0x00, 0x00, 0xff, 0xff, 0xcc, 0x50, 0x6c, 0x10, 0x9e, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1756,7 +1822,8 @@ type StakepooldServiceClient interface { GetLiveTickets(ctx context.Context, in *GetLiveTicketsRequest, opts ...grpc.CallOption) (*GetLiveTicketsResponse, error) SetAddedLowFeeTickets(ctx context.Context, in *SetAddedLowFeeTicketsRequest, opts ...grpc.CallOption) (*SetAddedLowFeeTicketsResponse, error) SetUserVotingPrefs(ctx context.Context, in *SetUserVotingPrefsRequest, opts ...grpc.CallOption) (*SetUserVotingPrefsResponse, error) - ImportScript(ctx context.Context, in *ImportScriptRequest, opts ...grpc.CallOption) (*ImportScriptResponse, error) + ImportNewScript(ctx context.Context, in *ImportNewScriptRequest, opts ...grpc.CallOption) (*ImportNewScriptResponse, error) + ImportMissingScripts(ctx context.Context, in *ImportMissingScriptsRequest, opts ...grpc.CallOption) (*ImportMissingScriptsResponse, error) StakePoolUserInfo(ctx context.Context, in *StakePoolUserInfoRequest, opts ...grpc.CallOption) (*StakePoolUserInfoResponse, error) WalletInfo(ctx context.Context, in *WalletInfoRequest, opts ...grpc.CallOption) (*WalletInfoResponse, error) ValidateAddress(ctx context.Context, in *ValidateAddressRequest, opts ...grpc.CallOption) (*ValidateAddressResponse, error) @@ -1821,9 +1888,18 @@ func (c *stakepooldServiceClient) SetUserVotingPrefs(ctx context.Context, in *Se return out, nil } -func (c *stakepooldServiceClient) ImportScript(ctx context.Context, in *ImportScriptRequest, opts ...grpc.CallOption) (*ImportScriptResponse, error) { - out := new(ImportScriptResponse) - err := c.cc.Invoke(ctx, "/stakepoolrpc.StakepooldService/ImportScript", in, out, opts...) +func (c *stakepooldServiceClient) ImportNewScript(ctx context.Context, in *ImportNewScriptRequest, opts ...grpc.CallOption) (*ImportNewScriptResponse, error) { + out := new(ImportNewScriptResponse) + err := c.cc.Invoke(ctx, "/stakepoolrpc.StakepooldService/ImportNewScript", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *stakepooldServiceClient) ImportMissingScripts(ctx context.Context, in *ImportMissingScriptsRequest, opts ...grpc.CallOption) (*ImportMissingScriptsResponse, error) { + out := new(ImportMissingScriptsResponse) + err := c.cc.Invoke(ctx, "/stakepoolrpc.StakepooldService/ImportMissingScripts", in, out, opts...) if err != nil { return nil, err } @@ -1918,7 +1994,8 @@ type StakepooldServiceServer interface { GetLiveTickets(context.Context, *GetLiveTicketsRequest) (*GetLiveTicketsResponse, error) SetAddedLowFeeTickets(context.Context, *SetAddedLowFeeTicketsRequest) (*SetAddedLowFeeTicketsResponse, error) SetUserVotingPrefs(context.Context, *SetUserVotingPrefsRequest) (*SetUserVotingPrefsResponse, error) - ImportScript(context.Context, *ImportScriptRequest) (*ImportScriptResponse, error) + ImportNewScript(context.Context, *ImportNewScriptRequest) (*ImportNewScriptResponse, error) + ImportMissingScripts(context.Context, *ImportMissingScriptsRequest) (*ImportMissingScriptsResponse, error) StakePoolUserInfo(context.Context, *StakePoolUserInfoRequest) (*StakePoolUserInfoResponse, error) WalletInfo(context.Context, *WalletInfoRequest) (*WalletInfoResponse, error) ValidateAddress(context.Context, *ValidateAddressRequest) (*ValidateAddressResponse, error) @@ -1949,8 +2026,11 @@ func (*UnimplementedStakepooldServiceServer) SetAddedLowFeeTickets(ctx context.C func (*UnimplementedStakepooldServiceServer) SetUserVotingPrefs(ctx context.Context, req *SetUserVotingPrefsRequest) (*SetUserVotingPrefsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetUserVotingPrefs not implemented") } -func (*UnimplementedStakepooldServiceServer) ImportScript(ctx context.Context, req *ImportScriptRequest) (*ImportScriptResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ImportScript not implemented") +func (*UnimplementedStakepooldServiceServer) ImportNewScript(ctx context.Context, req *ImportNewScriptRequest) (*ImportNewScriptResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportNewScript not implemented") +} +func (*UnimplementedStakepooldServiceServer) ImportMissingScripts(ctx context.Context, req *ImportMissingScriptsRequest) (*ImportMissingScriptsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ImportMissingScripts not implemented") } func (*UnimplementedStakepooldServiceServer) StakePoolUserInfo(ctx context.Context, req *StakePoolUserInfoRequest) (*StakePoolUserInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StakePoolUserInfo not implemented") @@ -2074,20 +2154,38 @@ func _StakepooldService_SetUserVotingPrefs_Handler(srv interface{}, ctx context. return interceptor(ctx, in, info, handler) } -func _StakepooldService_ImportScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ImportScriptRequest) +func _StakepooldService_ImportNewScript_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportNewScriptRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(StakepooldServiceServer).ImportScript(ctx, in) + return srv.(StakepooldServiceServer).ImportNewScript(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/stakepoolrpc.StakepooldService/ImportScript", + FullMethod: "/stakepoolrpc.StakepooldService/ImportNewScript", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(StakepooldServiceServer).ImportScript(ctx, req.(*ImportScriptRequest)) + return srv.(StakepooldServiceServer).ImportNewScript(ctx, req.(*ImportNewScriptRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _StakepooldService_ImportMissingScripts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ImportMissingScriptsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(StakepooldServiceServer).ImportMissingScripts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/stakepoolrpc.StakepooldService/ImportMissingScripts", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(StakepooldServiceServer).ImportMissingScripts(ctx, req.(*ImportMissingScriptsRequest)) } return interceptor(ctx, in, info, handler) } @@ -2279,8 +2377,12 @@ var _StakepooldService_serviceDesc = grpc.ServiceDesc{ Handler: _StakepooldService_SetUserVotingPrefs_Handler, }, { - MethodName: "ImportScript", - Handler: _StakepooldService_ImportScript_Handler, + MethodName: "ImportNewScript", + Handler: _StakepooldService_ImportNewScript_Handler, + }, + { + MethodName: "ImportMissingScripts", + Handler: _StakepooldService_ImportMissingScripts_Handler, }, { MethodName: "StakePoolUserInfo", diff --git a/controllers/main.go b/controllers/main.go index 853284c8..e7131a6e 100644 --- a/controllers/main.go +++ b/controllers/main.go @@ -335,7 +335,7 @@ func (controller *MainController) APIAddress(c web.C, r *http.Request) ([]string // Import the redeem script var importedHeight int64 - importedHeight, err = controller.Cfg.StakepooldServers.ImportScript(serializedScript) + importedHeight, err = controller.Cfg.StakepooldServers.ImportNewScript(serializedScript) if err != nil { return nil, codes.Unavailable, "system error", errors.New("unable to process wallet commands") } @@ -809,7 +809,7 @@ func (controller *MainController) AddressPost(c web.C, r *http.Request) (string, // Import the redeem script var importedHeight int64 - importedHeight, err = controller.Cfg.StakepooldServers.ImportScript(serializedScript) + importedHeight, err = controller.Cfg.StakepooldServers.ImportNewScript(serializedScript) if err != nil { return "/error", http.StatusSeeOther } diff --git a/stakepooldclient/stakepooldclient.go b/stakepooldclient/stakepooldclient.go index fb4d5bf1..f0296448 100644 --- a/stakepooldclient/stakepooldclient.go +++ b/stakepooldclient/stakepooldclient.go @@ -20,7 +20,7 @@ import ( ) var ( - requiredStakepooldAPI = semver{major: 7, minor: 0, patch: 0} + requiredStakepooldAPI = semver{major: 8, minor: 0, patch: 0} // cacheTimerStakeInfo is the duration of time after which to // access the wallet and update the stake information instead @@ -341,22 +341,24 @@ func (s *StakepooldManager) syncScripts(multiSigScripts []models.User) error { log.Info("syncScripts: Attempting to synchronise redeem scripts across voting wallets") - // Fetch the redeem scripts from each server. - redeemScriptsPerServer := make([]map[chainhash.Hash]*ScriptHeight, - len(s.grpcConnections)) + // Get all scripts from db allRedeemScripts := make(map[chainhash.Hash]*ScriptHeight) - // add all scripts from db for _, v := range multiSigScripts { byteScript, err := hex.DecodeString(v.MultiSigScript) if err != nil { - log.Errorf("syncScripts: Skipping script %s due to err %v", v.MultiSigScript, err) + log.Errorf("syncScripts: Failed to decode script %s due to err: %v", v.MultiSigScript, err) return err } allRedeemScripts[chainhash.HashH(byteScript)] = &ScriptHeight{byteScript, int(v.HeightRegistered)} } - // Go through each server and see who is synced to the most redeem scripts. + log.Infof("syncScripts: %d scripts found in the db", len(allRedeemScripts)) + + // Fetch the scripts from each server. + redeemScriptsPerServer := make([]map[chainhash.Hash]*ScriptHeight, + len(s.grpcConnections)) + for i, conn := range s.grpcConnections { client := pb.NewStakepooldServiceClient(conn) @@ -377,24 +379,37 @@ func (s *StakepooldManager) syncScripts(multiSigScripts []models.User) error { log.Infof("syncScripts: stakepoold %s reports %d scripts", conn.Target(), len(redeemScriptsPerServer[i])) } + // Check each server has every script for i, conn := range s.grpcConnections { + // Because we are adding historic scripts, we need to perform a rescan. + // Need to find the earliest imported script height so we know where scan from. + missingScripts := make([][]byte, 0) + earliestHeight := -1 for k, v := range allRedeemScripts { _, ok := redeemScriptsPerServer[i][k] if !ok { - log.Infof("syncScripts: Redeem script from DB not found on stakepoold %s. ImportScript for %x at height %v", conn.Target(), v.Script, v.Height) - client := pb.NewStakepooldServiceClient(conn) - - request := &pb.ImportScriptRequest{ - Script: v.Script, - Rescan: true, - RescanHeight: int64(v.Height), + // Script is missing from server + missingScripts = append(missingScripts, v.Script) + if earliestHeight == -1 || earliestHeight > v.Height { + earliestHeight = v.Height } + } + } - _, err := client.ImportScript(context.Background(), request) - if err != nil { - return err - } + // Add missing scripts to the server if there are any + if len(missingScripts) > 0 { + log.Infof("syncScripts: stakepoold %s was missing %d redeem scripts. Importing now...", conn.Target(), len(missingScripts)) + client := pb.NewStakepooldServiceClient(conn) + + request := &pb.ImportMissingScriptsRequest{ + Scripts: missingScripts, + RescanHeight: int64(earliestHeight), + } + + _, err := client.ImportMissingScripts(context.Background(), request) + if err != nil { + return err } } } @@ -580,30 +595,31 @@ func (s *StakepooldManager) ValidateAddress(addr dcrutil.Address) (*pb.ValidateA return lastResponse, nil } -// ImportScript calls ImportScript RPC on all stakepoold instances. It stops -// executing and returns an error if any RPC call fails -func (s *StakepooldManager) ImportScript(script []byte) (heightImported int64, err error) { +// ImportNewScript calls ImportNewScript RPC on all stakepoold instances. It stops +// executing and returns an error if any RPC call fails. +// Because this is a new script, no rescan is necessary. +func (s *StakepooldManager) ImportNewScript(script []byte) (heightImported int64, err error) { if err := s.connected(); err != nil { - log.Errorf("ImportScript: stakepoold failed connectivity check: %v", err) + log.Errorf("ImportNewScript: stakepoold failed connectivity check: %v", err) return -1, err } - req := &pb.ImportScriptRequest{ + req := &pb.ImportNewScriptRequest{ Script: script, } for _, conn := range s.grpcConnections { client := pb.NewStakepooldServiceClient(conn) - resp, err := client.ImportScript(context.Background(), req) + resp, err := client.ImportNewScript(context.Background(), req) if err != nil { - log.Errorf("ImportScript RPC failed on stakepoold instance %s: %v", conn.Target(), err) + log.Errorf("ImportNewScript RPC failed on stakepoold instance %s: %v", conn.Target(), err) return -1, err } heightImported = resp.HeightImported } - log.Info("ImportScript successful on all stakepoold instances") + log.Info("ImportNewScript successful on all stakepoold instances") return heightImported, err }