diff --git a/common/common.go b/common/common.go index 07cd5ea..c16976b 100644 --- a/common/common.go +++ b/common/common.go @@ -108,10 +108,10 @@ type ( // pirated rpc "z_gettreestatelegacy" (legacy format for backward compatibility) PiratedRpcReplyGettreestate struct { - Height int `json:"height"` - Hash string `json:"hash"` - Time uint32 `json:"time"` - Sprout struct { + Height int `json:"height"` + Hash string `json:"hash"` + Time uint32 `json:"time"` + Sprout struct { SkipHash string `json:"skipHash,omitempty"` Commitments struct { FinalRoot string `json:"finalRoot"` @@ -129,10 +129,10 @@ type ( // pirated rpc "z_gettreestate" (new format with bridge trees) PiratedRpcReplyGetbridgetreestate struct { - Height int `json:"height"` - Hash string `json:"hash"` - Time uint32 `json:"time"` - Sprout struct { + Height int `json:"height"` + Hash string `json:"hash"` + Time uint32 `json:"time"` + Sprout struct { Active bool `json:"active"` SkipHash string `json:"skipHash,omitempty"` Commitments struct { @@ -158,6 +158,14 @@ type ( } `json:"orchard"` } + // pirated rpc "z_getsubtreesbyindex" + PiratedRpcReplyGetsubtreesbyindex struct { + Index uint64 `json:"index"` + Root string `json:"root"` + CompletingBlockHash string `json:"completingBlockHash"` + CompletingBlockHeight uint64 `json:"completingBlockHeight"` + } + // pirated rpc "getrawtransaction txid 1" (1 means verbose), there are PiratedRpcReplyGetrawtransaction struct { Hex string diff --git a/frontend/getsubtreeroots_test.go b/frontend/getsubtreeroots_test.go new file mode 100644 index 0000000..8ddd21c --- /dev/null +++ b/frontend/getsubtreeroots_test.go @@ -0,0 +1,124 @@ +// Copyright (c) 2026 Pirate Chain developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://www.opensource.org/licenses/mit-license.php . + +package frontend + +import ( + "bytes" + "context" + "encoding/hex" + "encoding/json" + "testing" + + "github.com/PirateNetwork/lightwalletd/common" + "github.com/PirateNetwork/lightwalletd/parser" + "github.com/PirateNetwork/lightwalletd/walletrpc" + "google.golang.org/grpc/metadata" +) + +type subtreeRootsStream struct { + ctx context.Context + roots []*walletrpc.SubtreeRoot +} + +func (s *subtreeRootsStream) SetHeader(metadata.MD) error { return nil } +func (s *subtreeRootsStream) SendHeader(metadata.MD) error { return nil } +func (s *subtreeRootsStream) SetTrailer(metadata.MD) {} +func (s *subtreeRootsStream) Context() context.Context { return s.ctx } +func (s *subtreeRootsStream) SendMsg(interface{}) error { return nil } +func (s *subtreeRootsStream) RecvMsg(interface{}) error { return nil } + +func (s *subtreeRootsStream) Send(root *walletrpc.SubtreeRoot) error { + s.roots = append(s.roots, root) + return nil +} + +func z_getsubtreesbyindexStub(method string, params []json.RawMessage) (json.RawMessage, error) { + if method != "z_getsubtreesbyindex" { + testT.Fatal("unexpected method in z_getsubtreesbyindexStub:", method) + } + if len(params) != 3 { + testT.Fatalf("unexpected params len in z_getsubtreesbyindexStub: %d", len(params)) + } + + var protocol string + if err := json.Unmarshal(params[0], &protocol); err != nil { + testT.Fatal("failed to parse protocol param:", err) + } + if protocol != "sapling" { + testT.Fatal("unexpected protocol param:", protocol) + } + + var startIndex uint32 + if err := json.Unmarshal(params[1], &startIndex); err != nil { + testT.Fatal("failed to parse startIndex param:", err) + } + if startIndex != 5 { + testT.Fatal("unexpected startIndex param:", startIndex) + } + + var maxEntries uint32 + if err := json.Unmarshal(params[2], &maxEntries); err != nil { + testT.Fatal("failed to parse maxEntries param:", err) + } + if maxEntries != 2 { + testT.Fatal("unexpected maxEntries param:", maxEntries) + } + + mockResponse := `[ + { + "index": 5, + "root": "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20", + "completingBlockHash": "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff", + "completingBlockHeight": 12345 + } + ]` + + return json.RawMessage(mockResponse), nil +} + +func TestGetSubtreeRoots(t *testing.T) { + testT = t + common.RawRequest = z_getsubtreesbyindexStub + + lwdInterface, err := NewLwdStreamer(nil, "main", false) + if err != nil { + t.Fatal("NewLwdStreamer failed:", err) + } + lwd := lwdInterface.(*lwdStreamer) + + stream := &subtreeRootsStream{ctx: context.Background()} + err = lwd.GetSubtreeRoots(&walletrpc.GetSubtreeRootsArg{ + StartIndex: 5, + ShieldedProtocol: walletrpc.ShieldedProtocol_sapling, + MaxEntries: 2, + }, stream) + if err != nil { + t.Fatal("GetSubtreeRoots failed:", err) + } + + if len(stream.roots) != 1 { + t.Fatalf("unexpected subtree root count: %d", len(stream.roots)) + } + + expectedRoot, err := hex.DecodeString("0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20") + if err != nil { + t.Fatal(err) + } + if !bytes.Equal(stream.roots[0].RootHash, expectedRoot) { + t.Fatal("unexpected root hash bytes") + } + + expectedBlockHash, err := hex.DecodeString("00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff") + if err != nil { + t.Fatal(err) + } + if !bytes.Equal(stream.roots[0].CompletingBlockHash, parser.Reverse(expectedBlockHash)) { + t.Fatal("unexpected completing block hash bytes") + } + + if stream.roots[0].CompletingBlockHeight != 12345 { + t.Fatal("unexpected completing block height:", stream.roots[0].CompletingBlockHeight) + } +} diff --git a/frontend/service.go b/frontend/service.go index 77e3219..b96ea28 100644 --- a/frontend/service.go +++ b/frontend/service.go @@ -129,20 +129,19 @@ func (s *lwdStreamer) GetCurrentARRRPrice(ctx context.Context, in *walletrpc.Emp return resp, nil } - // Returns the last block in a group of predefined total size func (s *lwdStreamer) GetLiteWalletBlockGroup(ctx context.Context, id *walletrpc.BlockID) (*walletrpc.BlockID, error) { latestBlock := s.cache.GetLatestHeight() if latestBlock == -1 { - return nil, errors.New("Cache is empty. Server is probably not yet ready") + return nil, errors.New("Cache is empty. Server is probably not yet ready") } - if int(id.Height) < 1 { - return nil, errors.New("Invalid block, must use height greater than 0") + if int(id.Height) < 1 { + return nil, errors.New("Invalid block, must use height greater than 0") } - blockId := s.cache.GetLiteWalletBlockGroup(int(id.Height)) + blockId := s.cache.GetLiteWalletBlockGroup(int(id.Height)) return blockId, nil } @@ -368,7 +367,7 @@ func (s *lwdStreamer) GetTreeState(ctx context.Context, id *walletrpc.BlockID) ( } params[0] = hashJSON } - + // Prefer the legacy z_gettreestatelegacy RPC result, rpcErr := common.RawRequest("z_gettreestatelegacy", params) if rpcErr == nil { @@ -387,7 +386,7 @@ func (s *lwdStreamer) GetTreeState(ctx context.Context, id *walletrpc.BlockID) ( SaplingTree: saplingTree, OrchardTree: "", // Legacy format does not support Orchard }, nil - } + } } // Fallback to newer z_gettreestate RPC @@ -451,7 +450,7 @@ func (s *lwdStreamer) GetBridgeTreeState(ctx context.Context, id *walletrpc.Bloc // z_gettreestatelegacy doesn't exist - return error for consistency return nil, rpcErr } - + // Node supports bridge trees - get tree state from z_gettreestate result, rpcErr := common.RawRequest("z_gettreestate", params) if rpcErr != nil { @@ -463,19 +462,19 @@ func (s *lwdStreamer) GetBridgeTreeState(ctx context.Context, id *walletrpc.Bloc if err != nil { return nil, err } - + // Use Sapling finalState if available, otherwise use finalRoot saplingTree := gettreestateReply.Sapling.Commitments.FinalState if saplingTree == "" { saplingTree = gettreestateReply.Sapling.Commitments.FinalRoot } - - // Use Orchard finalState if available, otherwise use finalRoot + + // Use Orchard finalState if available, otherwise use finalRoot orchardTree := gettreestateReply.Orchard.Commitments.FinalState if orchardTree == "" { orchardTree = gettreestateReply.Orchard.Commitments.FinalRoot } - + return &walletrpc.TreeState{ Network: s.chainName, Height: uint64(gettreestateReply.Height), @@ -486,6 +485,77 @@ func (s *lwdStreamer) GetBridgeTreeState(ctx context.Context, id *walletrpc.Bloc }, nil } +func (s *lwdStreamer) GetSubtreeRoots( + arg *walletrpc.GetSubtreeRootsArg, + resp walletrpc.CompactTxStreamer_GetSubtreeRootsServer, +) error { + if arg == nil { + return errors.New("request for subtree roots is missing") + } + + var protocol string + switch arg.ShieldedProtocol { + case walletrpc.ShieldedProtocol_sapling: + protocol = "sapling" + case walletrpc.ShieldedProtocol_orchard: + protocol = "orchard" + default: + return errors.New("unsupported shielded protocol") + } + + params := make([]json.RawMessage, 3) + + protocolJSON, err := json.Marshal(protocol) + if err != nil { + return err + } + params[0] = protocolJSON + + startIndexJSON, err := json.Marshal(arg.StartIndex) + if err != nil { + return err + } + params[1] = startIndexJSON + + maxEntriesJSON, err := json.Marshal(arg.MaxEntries) + if err != nil { + return err + } + params[2] = maxEntriesJSON + + result, rpcErr := common.RawRequest("z_getsubtreesbyindex", params) + if rpcErr != nil { + return rpcErr + } + + var subtreeRoots []common.PiratedRpcReplyGetsubtreesbyindex + if err := json.Unmarshal(result, &subtreeRoots); err != nil { + return err + } + + for _, subtree := range subtreeRoots { + rootHash, err := hex.DecodeString(subtree.Root) + if err != nil { + return err + } + + completingBlockHash, err := hex.DecodeString(subtree.CompletingBlockHash) + if err != nil { + return err + } + + if err := resp.Send(&walletrpc.SubtreeRoot{ + RootHash: rootHash, + CompletingBlockHash: parser.Reverse(completingBlockHash), + CompletingBlockHeight: subtree.CompletingBlockHeight, + }); err != nil { + return err + } + } + + return nil +} + // GetTransaction returns the raw transaction bytes that are returned // by the pirated 'getrawtransaction' RPC. func (s *lwdStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilter) (*walletrpc.RawTransaction, error) { diff --git a/walletrpc/service.pb.go b/walletrpc/service.pb.go index 3ece553..2b22814 100644 --- a/walletrpc/service.pb.go +++ b/walletrpc/service.pb.go @@ -2,7 +2,7 @@ // Copyright (c) 2019-2025 Pirate Chain developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php . - +// // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 @@ -28,6 +28,31 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +type ShieldedProtocol int32 + +const ( + ShieldedProtocol_sapling ShieldedProtocol = 0 + ShieldedProtocol_orchard ShieldedProtocol = 1 +) + +var ShieldedProtocol_name = map[int32]string{ + 0: "sapling", + 1: "orchard", +} + +var ShieldedProtocol_value = map[string]int32{ + "sapling": 0, + "orchard": 1, +} + +func (x ShieldedProtocol) String() string { + return proto.EnumName(ShieldedProtocol_name, int32(x)) +} + +func (ShieldedProtocol) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a0b84a42fa06f626, []int{0} +} + // A BlockID message contains identifiers to select a block: a height or a // hash. Specification by hash is not implemented, but may be in the future. type BlockID struct { @@ -42,7 +67,7 @@ func (m *BlockID) Reset() { *m = BlockID{} } func (m *BlockID) String() string { return proto.CompactTextString(m) } func (*BlockID) ProtoMessage() {} func (*BlockID) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{0} + return fileDescriptor_a0b84a42fa06f626, []int{0} } func (m *BlockID) XXX_Unmarshal(b []byte) error { @@ -91,7 +116,7 @@ func (m *BlockRange) Reset() { *m = BlockRange{} } func (m *BlockRange) String() string { return proto.CompactTextString(m) } func (*BlockRange) ProtoMessage() {} func (*BlockRange) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{1} + return fileDescriptor_a0b84a42fa06f626, []int{1} } func (m *BlockRange) XXX_Unmarshal(b []byte) error { @@ -142,7 +167,7 @@ func (m *TxFilter) Reset() { *m = TxFilter{} } func (m *TxFilter) String() string { return proto.CompactTextString(m) } func (*TxFilter) ProtoMessage() {} func (*TxFilter) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{2} + return fileDescriptor_a0b84a42fa06f626, []int{2} } func (m *TxFilter) XXX_Unmarshal(b []byte) error { @@ -199,7 +224,7 @@ func (m *RawTransaction) Reset() { *m = RawTransaction{} } func (m *RawTransaction) String() string { return proto.CompactTextString(m) } func (*RawTransaction) ProtoMessage() {} func (*RawTransaction) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{3} + return fileDescriptor_a0b84a42fa06f626, []int{3} } func (m *RawTransaction) XXX_Unmarshal(b []byte) error { @@ -249,7 +274,7 @@ func (m *SendResponse) Reset() { *m = SendResponse{} } func (m *SendResponse) String() string { return proto.CompactTextString(m) } func (*SendResponse) ProtoMessage() {} func (*SendResponse) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{4} + return fileDescriptor_a0b84a42fa06f626, []int{4} } func (m *SendResponse) XXX_Unmarshal(b []byte) error { @@ -295,7 +320,7 @@ func (m *ChainSpec) Reset() { *m = ChainSpec{} } func (m *ChainSpec) String() string { return proto.CompactTextString(m) } func (*ChainSpec) ProtoMessage() {} func (*ChainSpec) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{5} + return fileDescriptor_a0b84a42fa06f626, []int{5} } func (m *ChainSpec) XXX_Unmarshal(b []byte) error { @@ -327,7 +352,7 @@ func (m *Empty) Reset() { *m = Empty{} } func (m *Empty) String() string { return proto.CompactTextString(m) } func (*Empty) ProtoMessage() {} func (*Empty) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{6} + return fileDescriptor_a0b84a42fa06f626, []int{6} } func (m *Empty) XXX_Unmarshal(b []byte) error { @@ -374,7 +399,7 @@ func (m *LightdInfo) Reset() { *m = LightdInfo{} } func (m *LightdInfo) String() string { return proto.CompactTextString(m) } func (*LightdInfo) ProtoMessage() {} func (*LightdInfo) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{7} + return fileDescriptor_a0b84a42fa06f626, []int{7} } func (m *LightdInfo) XXX_Unmarshal(b []byte) error { @@ -507,7 +532,7 @@ func (m *TransparentAddressBlockFilter) Reset() { *m = TransparentAddres func (m *TransparentAddressBlockFilter) String() string { return proto.CompactTextString(m) } func (*TransparentAddressBlockFilter) ProtoMessage() {} func (*TransparentAddressBlockFilter) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{8} + return fileDescriptor_a0b84a42fa06f626, []int{8} } func (m *TransparentAddressBlockFilter) XXX_Unmarshal(b []byte) error { @@ -556,7 +581,7 @@ func (m *Duration) Reset() { *m = Duration{} } func (m *Duration) String() string { return proto.CompactTextString(m) } func (*Duration) ProtoMessage() {} func (*Duration) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{9} + return fileDescriptor_a0b84a42fa06f626, []int{9} } func (m *Duration) XXX_Unmarshal(b []byte) error { @@ -599,7 +624,7 @@ func (m *PingResponse) Reset() { *m = PingResponse{} } func (m *PingResponse) String() string { return proto.CompactTextString(m) } func (*PingResponse) ProtoMessage() {} func (*PingResponse) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{10} + return fileDescriptor_a0b84a42fa06f626, []int{10} } func (m *PingResponse) XXX_Unmarshal(b []byte) error { @@ -645,7 +670,7 @@ func (m *Address) Reset() { *m = Address{} } func (m *Address) String() string { return proto.CompactTextString(m) } func (*Address) ProtoMessage() {} func (*Address) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{11} + return fileDescriptor_a0b84a42fa06f626, []int{11} } func (m *Address) XXX_Unmarshal(b []byte) error { @@ -684,7 +709,7 @@ func (m *AddressList) Reset() { *m = AddressList{} } func (m *AddressList) String() string { return proto.CompactTextString(m) } func (*AddressList) ProtoMessage() {} func (*AddressList) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{12} + return fileDescriptor_a0b84a42fa06f626, []int{12} } func (m *AddressList) XXX_Unmarshal(b []byte) error { @@ -723,7 +748,7 @@ func (m *Balance) Reset() { *m = Balance{} } func (m *Balance) String() string { return proto.CompactTextString(m) } func (*Balance) ProtoMessage() {} func (*Balance) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{13} + return fileDescriptor_a0b84a42fa06f626, []int{13} } func (m *Balance) XXX_Unmarshal(b []byte) error { @@ -762,7 +787,7 @@ func (m *Exclude) Reset() { *m = Exclude{} } func (m *Exclude) String() string { return proto.CompactTextString(m) } func (*Exclude) ProtoMessage() {} func (*Exclude) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{14} + return fileDescriptor_a0b84a42fa06f626, []int{14} } func (m *Exclude) XXX_Unmarshal(b []byte) error { @@ -808,7 +833,7 @@ func (m *TreeState) Reset() { *m = TreeState{} } func (m *TreeState) String() string { return proto.CompactTextString(m) } func (*TreeState) ProtoMessage() {} func (*TreeState) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{15} + return fileDescriptor_a0b84a42fa06f626, []int{15} } func (m *TreeState) XXX_Unmarshal(b []byte) error { @@ -878,6 +903,116 @@ func (m *TreeState) GetOrchardTree() string { return "" } +type GetSubtreeRootsArg struct { + StartIndex uint32 `protobuf:"varint,1,opt,name=startIndex,proto3" json:"startIndex,omitempty"` + ShieldedProtocol ShieldedProtocol `protobuf:"varint,2,opt,name=shieldedProtocol,proto3,enum=pirate.wallet.sdk.rpc.ShieldedProtocol" json:"shieldedProtocol,omitempty"` + MaxEntries uint32 `protobuf:"varint,3,opt,name=maxEntries,proto3" json:"maxEntries,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetSubtreeRootsArg) Reset() { *m = GetSubtreeRootsArg{} } +func (m *GetSubtreeRootsArg) String() string { return proto.CompactTextString(m) } +func (*GetSubtreeRootsArg) ProtoMessage() {} +func (*GetSubtreeRootsArg) Descriptor() ([]byte, []int) { + return fileDescriptor_a0b84a42fa06f626, []int{16} +} + +func (m *GetSubtreeRootsArg) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetSubtreeRootsArg.Unmarshal(m, b) +} +func (m *GetSubtreeRootsArg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetSubtreeRootsArg.Marshal(b, m, deterministic) +} +func (m *GetSubtreeRootsArg) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetSubtreeRootsArg.Merge(m, src) +} +func (m *GetSubtreeRootsArg) XXX_Size() int { + return xxx_messageInfo_GetSubtreeRootsArg.Size(m) +} +func (m *GetSubtreeRootsArg) XXX_DiscardUnknown() { + xxx_messageInfo_GetSubtreeRootsArg.DiscardUnknown(m) +} + +var xxx_messageInfo_GetSubtreeRootsArg proto.InternalMessageInfo + +func (m *GetSubtreeRootsArg) GetStartIndex() uint32 { + if m != nil { + return m.StartIndex + } + return 0 +} + +func (m *GetSubtreeRootsArg) GetShieldedProtocol() ShieldedProtocol { + if m != nil { + return m.ShieldedProtocol + } + return ShieldedProtocol_sapling +} + +func (m *GetSubtreeRootsArg) GetMaxEntries() uint32 { + if m != nil { + return m.MaxEntries + } + return 0 +} + +type SubtreeRoot struct { + RootHash []byte `protobuf:"bytes,2,opt,name=rootHash,proto3" json:"rootHash,omitempty"` + CompletingBlockHash []byte `protobuf:"bytes,3,opt,name=completingBlockHash,proto3" json:"completingBlockHash,omitempty"` + CompletingBlockHeight uint64 `protobuf:"varint,4,opt,name=completingBlockHeight,proto3" json:"completingBlockHeight,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SubtreeRoot) Reset() { *m = SubtreeRoot{} } +func (m *SubtreeRoot) String() string { return proto.CompactTextString(m) } +func (*SubtreeRoot) ProtoMessage() {} +func (*SubtreeRoot) Descriptor() ([]byte, []int) { + return fileDescriptor_a0b84a42fa06f626, []int{17} +} + +func (m *SubtreeRoot) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SubtreeRoot.Unmarshal(m, b) +} +func (m *SubtreeRoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SubtreeRoot.Marshal(b, m, deterministic) +} +func (m *SubtreeRoot) XXX_Merge(src proto.Message) { + xxx_messageInfo_SubtreeRoot.Merge(m, src) +} +func (m *SubtreeRoot) XXX_Size() int { + return xxx_messageInfo_SubtreeRoot.Size(m) +} +func (m *SubtreeRoot) XXX_DiscardUnknown() { + xxx_messageInfo_SubtreeRoot.DiscardUnknown(m) +} + +var xxx_messageInfo_SubtreeRoot proto.InternalMessageInfo + +func (m *SubtreeRoot) GetRootHash() []byte { + if m != nil { + return m.RootHash + } + return nil +} + +func (m *SubtreeRoot) GetCompletingBlockHash() []byte { + if m != nil { + return m.CompletingBlockHash + } + return nil +} + +func (m *SubtreeRoot) GetCompletingBlockHeight() uint64 { + if m != nil { + return m.CompletingBlockHeight + } + return 0 +} + // Results are sorted by height, which makes it easy to issue another // request that picks up from where the previous left off. type GetAddressUtxosArg struct { @@ -893,7 +1028,7 @@ func (m *GetAddressUtxosArg) Reset() { *m = GetAddressUtxosArg{} } func (m *GetAddressUtxosArg) String() string { return proto.CompactTextString(m) } func (*GetAddressUtxosArg) ProtoMessage() {} func (*GetAddressUtxosArg) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{16} + return fileDescriptor_a0b84a42fa06f626, []int{18} } func (m *GetAddressUtxosArg) XXX_Unmarshal(b []byte) error { @@ -951,7 +1086,7 @@ func (m *GetAddressUtxosReply) Reset() { *m = GetAddressUtxosReply{} } func (m *GetAddressUtxosReply) String() string { return proto.CompactTextString(m) } func (*GetAddressUtxosReply) ProtoMessage() {} func (*GetAddressUtxosReply) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{17} + return fileDescriptor_a0b84a42fa06f626, []int{19} } func (m *GetAddressUtxosReply) XXX_Unmarshal(b []byte) error { @@ -1025,7 +1160,7 @@ func (m *GetAddressUtxosReplyList) Reset() { *m = GetAddressUtxosReplyLi func (m *GetAddressUtxosReplyList) String() string { return proto.CompactTextString(m) } func (*GetAddressUtxosReplyList) ProtoMessage() {} func (*GetAddressUtxosReplyList) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{18} + return fileDescriptor_a0b84a42fa06f626, []int{20} } func (m *GetAddressUtxosReplyList) XXX_Unmarshal(b []byte) error { @@ -1067,7 +1202,7 @@ func (m *PriceRequest) Reset() { *m = PriceRequest{} } func (m *PriceRequest) String() string { return proto.CompactTextString(m) } func (*PriceRequest) ProtoMessage() {} func (*PriceRequest) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{19} + return fileDescriptor_a0b84a42fa06f626, []int{21} } func (m *PriceRequest) XXX_Unmarshal(b []byte) error { @@ -1119,7 +1254,7 @@ func (m *PriceResponse) Reset() { *m = PriceResponse{} } func (m *PriceResponse) String() string { return proto.CompactTextString(m) } func (*PriceResponse) ProtoMessage() {} func (*PriceResponse) Descriptor() ([]byte, []int) { - return file_service_proto_rawDesc, []int{20} + return fileDescriptor_a0b84a42fa06f626, []int{22} } func (m *PriceResponse) XXX_Unmarshal(b []byte) error { @@ -1162,6 +1297,7 @@ func (m *PriceResponse) GetPrice() float64 { } func init() { + proto.RegisterEnum("pirate.wallet.sdk.rpc.ShieldedProtocol", ShieldedProtocol_name, ShieldedProtocol_value) proto.RegisterType((*BlockID)(nil), "pirate.wallet.sdk.rpc.BlockID") proto.RegisterType((*BlockRange)(nil), "pirate.wallet.sdk.rpc.BlockRange") proto.RegisterType((*TxFilter)(nil), "pirate.wallet.sdk.rpc.TxFilter") @@ -1178,6 +1314,8 @@ func init() { proto.RegisterType((*Balance)(nil), "pirate.wallet.sdk.rpc.Balance") proto.RegisterType((*Exclude)(nil), "pirate.wallet.sdk.rpc.Exclude") proto.RegisterType((*TreeState)(nil), "pirate.wallet.sdk.rpc.TreeState") + proto.RegisterType((*GetSubtreeRootsArg)(nil), "pirate.wallet.sdk.rpc.GetSubtreeRootsArg") + proto.RegisterType((*SubtreeRoot)(nil), "pirate.wallet.sdk.rpc.SubtreeRoot") proto.RegisterType((*GetAddressUtxosArg)(nil), "pirate.wallet.sdk.rpc.GetAddressUtxosArg") proto.RegisterType((*GetAddressUtxosReply)(nil), "pirate.wallet.sdk.rpc.GetAddressUtxosReply") proto.RegisterType((*GetAddressUtxosReplyList)(nil), "pirate.wallet.sdk.rpc.GetAddressUtxosReplyList") @@ -1186,92 +1324,101 @@ func init() { } func init() { - proto.RegisterFile("service.proto", file_service_proto_rawDesc) -} - -var file_service_proto_rawDesc = []byte{ - // 1314 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xef, 0x6e, 0x13, 0x47, - 0x10, 0xb7, 0x71, 0x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 0x15, 0x4c, 0x62, 0x82, 0x5d, 0xac, 0xe3, 0x44, - 0xf9, 0xef, 0xb0, 0xd6, 0x19, 0x3d, 0x55, 0x7d, 0x8b, 0xda, 0xd9, 0x3c, 0x72, 0x67, 0xcb, 0xda, - 0x24, 0x61, 0x76, 0x05, 0xaa, 0x2a, 0x89, 0x71, 0x44, 0x56, 0x57, 0x84, 0x27, 0x26, 0x37, 0xac, - 0xe4, 0x6e, 0xf8, 0x23, 0x6c, 0x08, 0xf9, 0xa1, 0xa3, 0x65, 0x62, 0x64, 0x64, 0x55, 0x9a, 0x38, - 0xa9, 0x58, 0x5a, 0x49, 0x06, 0x1b, 0x82, 0xbe, 0x73, 0x31, 0xbb, 0x90, 0x8f, 0x19, 0x7f, 0x0d, - 0x8d, 0x03, 0x4c, 0x62, 0x81, 0x26, 0x4b, 0x13, 0x83, 0xec, 0x06, 0xd4, 0x51, 0xeb, 0x54, 0xef, - 0xa5, 0x31, 0x12, 0x40, 0x55, 0x4c, 0x19, 0x8c, 0x43, 0x83, 0x88, 0x97, 0x68, 0x8c, 0xec, 0x22, - 0x61, 0xd5, 0xc5, 0x0c, 0x8f, 0xaf, 0x43, 0x7d, 0xaf, 0x27, 0x55, 0x72, 0x90, 0x61, 0xc4, 0x6b, - 0x50, 0x7d, 0x32, 0xc8, 0xec, 0x29, 0xff, 0xb7, 0x02, 0xf0, 0xc2, 0x59, 0x8c, 0x9f, 0x27, 0xef, - 0x53, 0xd6, 0x82, 0xda, 0x09, 0x6a, 0xa3, 0xd2, 0x84, 0x8c, 0xd4, 0xc5, 0x98, 0x74, 0x8e, 0x9e, - 0x60, 0x12, 0xa7, 0x3a, 0x80, 0x07, 0xca, 0x99, 0xb6, 0x32, 0x8e, 0xf5, 0xc1, 0x30, 0xcb, 0x52, - 0x6d, 0x29, 0x04, 0x6b, 0x62, 0x86, 0xe7, 0x9c, 0x8f, 0x9c, 0xe9, 0x57, 0x72, 0x80, 0xad, 0x15, - 0x52, 0x9f, 0x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d1, 0xfe, 0xee, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd7, 0xd7, 0xe6, 0xc6, 0xa7, 0x0f, - 0x00, 0x00, + proto.RegisterFile("service.proto", fileDescriptor_a0b84a42fa06f626) +} + +var fileDescriptor_a0b84a42fa06f626 = []byte{ + // 1460 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xe1, 0x6e, 0x13, 0x47, + 0x10, 0xb6, 0x49, 0x1c, 0xc7, 0x63, 0x27, 0x84, 0x85, 0x80, 0xe5, 0x02, 0x4d, 0x97, 0xa2, 0xa6, + 0x80, 0x42, 0x94, 0x52, 0x95, 0x1f, 0xfd, 0x43, 0x02, 0x24, 0x91, 0x80, 0xa6, 0x67, 0xa3, 0x56, + 0x41, 0x2a, 0xda, 0xdc, 0x0d, 0xf6, 0x36, 0xe7, 0xbb, 0xeb, 0xde, 0x3a, 0x38, 0x8f, 0xd1, 0x97, + 0xa8, 0xd4, 0x57, 0xe8, 0x6b, 0xf4, 0x41, 0xfa, 0xb7, 0x3f, 0xab, 0x9d, 0x5d, 0xdb, 0x67, 0x93, + 0xb3, 0x1d, 0xa9, 0xbf, 0x72, 0x33, 0x3b, 0xfb, 0xcd, 0xec, 0xcc, 0x37, 0xbb, 0xe3, 0xc0, 0x4a, + 0x8a, 0xea, 0x4c, 0xfa, 0xb8, 0x95, 0xa8, 0x58, 0xc7, 0x6c, 0x3d, 0x91, 0x4a, 0x68, 0xdc, 0xfa, + 0x28, 0xc2, 0x10, 0xf5, 0x56, 0x1a, 0x9c, 0x6e, 0xa9, 0xc4, 0x6f, 0xac, 0xfb, 0x71, 0x37, 0x11, + 0xbe, 0x7e, 0xff, 0x21, 0x56, 0x5d, 0xa1, 0x53, 0x6b, 0xcd, 0xbf, 0x85, 0xf2, 0x6e, 0x18, 0xfb, + 0xa7, 0x87, 0xcf, 0xd9, 0x4d, 0x58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1, 0xc1, 0xb7, 0x56, 0xc1, 0x63, 0xfb, 0x57, 0x25, 0xfe, 0x5f, 0x57, 0x0a, + 0x27, 0x4b, 0xf4, 0xcf, 0x93, 0x6f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x9f, 0x56, 0x34, 0xb1, + 0x7b, 0x11, 0x00, 0x00, } diff --git a/walletrpc/service.proto b/walletrpc/service.proto index 248ff56..0fc6731 100644 --- a/walletrpc/service.proto +++ b/walletrpc/service.proto @@ -120,6 +120,23 @@ message TreeState { string orchardTree = 7; // orchard commitment tree state } +enum ShieldedProtocol { + sapling = 0; + orchard = 1; +} + +message GetSubtreeRootsArg { + uint32 startIndex = 1; // Index identifying where to start returning subtree roots + ShieldedProtocol shieldedProtocol = 2; // Shielded protocol to return subtree roots for + uint32 maxEntries = 3; // Maximum number of entries to return, or 0 for all entries. +} + +message SubtreeRoot { + bytes rootHash = 2; // The 32-byte Merkle root of the subtree. + bytes completingBlockHash = 3; // The hash of the block that completed this subtree. + uint64 completingBlockHeight = 4; // The height of the block that completed this subtree in the main chain. +} + // Results are sorted by height, which makes it easy to issue another // request that picks up from where the previous left off. message GetAddressUtxosArg { @@ -209,6 +226,9 @@ service CompactTxStreamer { // The block can be specified by either height or hash. rpc GetBridgeTreeState(BlockID) returns (TreeState) {} + // Returns a stream of information about roots of completed shielded subtrees. + rpc GetSubtreeRoots(GetSubtreeRootsArg) returns (stream SubtreeRoot) {} + rpc GetAddressUtxos(GetAddressUtxosArg) returns (GetAddressUtxosReplyList) {} rpc GetAddressUtxosStream(GetAddressUtxosArg) returns (stream GetAddressUtxosReply) {} diff --git a/walletrpc/service_grpc.pb.go b/walletrpc/service_grpc.pb.go index 815bd46..cce76f2 100644 --- a/walletrpc/service_grpc.pb.go +++ b/walletrpc/service_grpc.pb.go @@ -2,7 +2,7 @@ // Copyright (c) 2019-2025 Pirate Chain developers // Distributed under the MIT software license, see the accompanying // file COPYING or https://www.opensource.org/licenses/mit-license.php . - +// // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.2.0 @@ -68,6 +68,8 @@ type CompactTxStreamerClient interface { // This uses the updated z_gettreestate RPC which includes the new bridge trees format. // The block can be specified by either height or hash. GetBridgeTreeState(ctx context.Context, in *BlockID, opts ...grpc.CallOption) (*TreeState, error) + // Returns a stream of information about roots of completed shielded subtrees. + GetSubtreeRoots(ctx context.Context, in *GetSubtreeRootsArg, opts ...grpc.CallOption) (CompactTxStreamer_GetSubtreeRootsClient, error) GetAddressUtxos(ctx context.Context, in *GetAddressUtxosArg, opts ...grpc.CallOption) (*GetAddressUtxosReplyList, error) GetAddressUtxosStream(ctx context.Context, in *GetAddressUtxosArg, opts ...grpc.CallOption) (CompactTxStreamer_GetAddressUtxosStreamClient, error) // Return information about this lightwalletd instance and the blockchain @@ -336,6 +338,38 @@ func (c *compactTxStreamerClient) GetBridgeTreeState(ctx context.Context, in *Bl return out, nil } +func (c *compactTxStreamerClient) GetSubtreeRoots(ctx context.Context, in *GetSubtreeRootsArg, opts ...grpc.CallOption) (CompactTxStreamer_GetSubtreeRootsClient, error) { + stream, err := c.cc.NewStream(ctx, &CompactTxStreamer_ServiceDesc.Streams[5], "/pirate.wallet.sdk.rpc.CompactTxStreamer/GetSubtreeRoots", opts...) + if err != nil { + return nil, err + } + x := &compactTxStreamerGetSubtreeRootsClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type CompactTxStreamer_GetSubtreeRootsClient interface { + Recv() (*SubtreeRoot, error) + grpc.ClientStream +} + +type compactTxStreamerGetSubtreeRootsClient struct { + grpc.ClientStream +} + +func (x *compactTxStreamerGetSubtreeRootsClient) Recv() (*SubtreeRoot, error) { + m := new(SubtreeRoot) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + func (c *compactTxStreamerClient) GetAddressUtxos(ctx context.Context, in *GetAddressUtxosArg, opts ...grpc.CallOption) (*GetAddressUtxosReplyList, error) { out := new(GetAddressUtxosReplyList) err := c.cc.Invoke(ctx, "/pirate.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos", in, out, opts...) @@ -346,7 +380,7 @@ func (c *compactTxStreamerClient) GetAddressUtxos(ctx context.Context, in *GetAd } func (c *compactTxStreamerClient) GetAddressUtxosStream(ctx context.Context, in *GetAddressUtxosArg, opts ...grpc.CallOption) (CompactTxStreamer_GetAddressUtxosStreamClient, error) { - stream, err := c.cc.NewStream(ctx, &CompactTxStreamer_ServiceDesc.Streams[5], "/pirate.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxosStream", opts...) + stream, err := c.cc.NewStream(ctx, &CompactTxStreamer_ServiceDesc.Streams[6], "/pirate.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxosStream", opts...) if err != nil { return nil, err } @@ -440,6 +474,8 @@ type CompactTxStreamerServer interface { // This uses the updated z_gettreestate RPC which includes the new bridge trees format. // The block can be specified by either height or hash. GetBridgeTreeState(context.Context, *BlockID) (*TreeState, error) + // Returns a stream of information about roots of completed shielded subtrees. + GetSubtreeRoots(*GetSubtreeRootsArg, CompactTxStreamer_GetSubtreeRootsServer) error GetAddressUtxos(context.Context, *GetAddressUtxosArg) (*GetAddressUtxosReplyList, error) GetAddressUtxosStream(*GetAddressUtxosArg, CompactTxStreamer_GetAddressUtxosStreamServer) error // Return information about this lightwalletd instance and the blockchain @@ -498,6 +534,9 @@ func (UnimplementedCompactTxStreamerServer) GetTreeState(context.Context, *Block func (UnimplementedCompactTxStreamerServer) GetBridgeTreeState(context.Context, *BlockID) (*TreeState, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBridgeTreeState not implemented") } +func (UnimplementedCompactTxStreamerServer) GetSubtreeRoots(*GetSubtreeRootsArg, CompactTxStreamer_GetSubtreeRootsServer) error { + return status.Errorf(codes.Unimplemented, "method GetSubtreeRoots not implemented") +} func (UnimplementedCompactTxStreamerServer) GetAddressUtxos(context.Context, *GetAddressUtxosArg) (*GetAddressUtxosReplyList, error) { return nil, status.Errorf(codes.Unimplemented, "method GetAddressUtxos not implemented") } @@ -813,6 +852,27 @@ func _CompactTxStreamer_GetBridgeTreeState_Handler(srv interface{}, ctx context. return interceptor(ctx, in, info, handler) } +func _CompactTxStreamer_GetSubtreeRoots_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetSubtreeRootsArg) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(CompactTxStreamerServer).GetSubtreeRoots(m, &compactTxStreamerGetSubtreeRootsServer{stream}) +} + +type CompactTxStreamer_GetSubtreeRootsServer interface { + Send(*SubtreeRoot) error + grpc.ServerStream +} + +type compactTxStreamerGetSubtreeRootsServer struct { + grpc.ServerStream +} + +func (x *compactTxStreamerGetSubtreeRootsServer) Send(m *SubtreeRoot) error { + return x.ServerStream.SendMsg(m) +} + func _CompactTxStreamer_GetAddressUtxos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetAddressUtxosArg) if err := dec(in); err != nil { @@ -974,6 +1034,11 @@ var CompactTxStreamer_ServiceDesc = grpc.ServiceDesc{ Handler: _CompactTxStreamer_GetMempoolStream_Handler, ServerStreams: true, }, + { + StreamName: "GetSubtreeRoots", + Handler: _CompactTxStreamer_GetSubtreeRoots_Handler, + ServerStreams: true, + }, { StreamName: "GetAddressUtxosStream", Handler: _CompactTxStreamer_GetAddressUtxosStream_Handler,