test: add darkside support for GetSubtreeRoots gRPC

One new darksidewallet gRPC added, SetSubtreeRoots()
This commit is contained in:
Larry Ruane 2024-01-01 11:49:57 -07:00
parent cdcbfeb5cc
commit bfd4e0a53f
7 changed files with 437 additions and 120 deletions

View File

@ -164,11 +164,46 @@ type (
}
// reply to z_getsubtreesbyindex
//
// Each shielded transaction output of a particular shielded pool
// type (Saping or Orchard) can be considered to have an index,
// beginning with zero at the start of the chain (genesis block,
// although there were no Sapling or Orchard transactions until
// later). Each group of 2^16 (65536) of these is called a subtree.
//
// This data structure indicates the merkle root hash, and the
// block height that the last output of this group falls on.
// For example, Sapling output number 65535, which is the last
// output in the first subtree, occurred somewhere within block
// 558822. This height is returned by z_getsubtreesbyindex 0 1
// (a request to return the subtree of the first group, and only
// return one entry rather than all entries to the tip of the chain).
//
// Here is that example, except return (up to) 2 entries:
//
// $ zcash-cli z_getsubtreesbyindex sapling 0 2
// {
// "pool": "sapling",
// "start_index": 0,
// "subtrees": [
// {
// "root": "754bb593ea42d231a7ddf367640f09bbf59dc00f2c1d2003cc340e0c016b5b13",
// "end_height": 558822
// },
// {
// "root": "03654c3eacbb9b93e122cf6d77b606eae29610f4f38a477985368197fd68e02d",
// "end_height": 670209
// }
// ]
// }
//
Subtree struct {
Root string
End_height int
}
ZcashdRpcReplyGetsubtreebyindex struct {
Subtrees []struct {
Root string
End_height int
}
Subtrees []Subtree
}
)

View File

@ -61,6 +61,10 @@ type darksideState struct {
// This is a one-entry cache performance cheat.
cacheBlockHash string
cacheBlockIndex int
// Cache of artificial z_getsubtreebyindex subtree entries,
// indexed by protocol (currently, sapling (0) or orchard (1)).
subtrees map[walletrpc.ShieldedProtocol]darksideProtocolSubtreeRoots
}
var state darksideState
@ -92,6 +96,16 @@ type DarksideTreeState struct {
OrchardTree string
}
type darksideSubtree struct {
root []byte
endHash []byte
endHeight int
}
type darksideProtocolSubtreeRoots struct {
startIndex uint32
subtrees []darksideSubtree
}
// DarksideEnabled is true if --darkside-very-insecure was given on
// the command line.
var DarksideEnabled bool
@ -146,6 +160,7 @@ func DarksideReset(sa int, bi, cn string, sst, sot uint32) error {
stagedTransactions: make([]stagedTx, 0),
stagedTreeStates: make(map[uint64]*DarksideTreeState),
stagedTreeStatesByHash: make(map[string]*DarksideTreeState),
subtrees: make(map[walletrpc.ShieldedProtocol]darksideProtocolSubtreeRoots),
}
state.cache.Reset(sa)
return nil
@ -698,11 +713,44 @@ func darksideRawRequest(method string, params []json.RawMessage) (json.RawMessag
return json.Marshal(zcashdTreeState)
case "z_getsubtreesbyindex":
// This is implemented by DarksideGetSubtreeRoots().
return nil, errors.New("z_getsubtreesbyindex should never be called")
default:
return nil, errors.New("there was an attempt to call an unsupported RPC: " + method)
}
}
// Normally we would implement this functionality in the darksideRawRequest(), but this
// gRPC handler requires calling GetBlock, and we don't have a good way to fake that.
func DarksideGetSubtreeRoots(arg *walletrpc.GetSubtreeRootsArg, resp walletrpc.CompactTxStreamer_GetSubtreeRootsServer) error {
mutex.Lock()
defer mutex.Unlock()
subtrees := state.subtrees[arg.ShieldedProtocol]
if arg.StartIndex < subtrees.startIndex {
return errors.New("startIndex too low")
}
sliceIndex := arg.StartIndex - subtrees.startIndex
var limit int = len(subtrees.subtrees) - int(sliceIndex)
if limit > int(arg.MaxEntries) {
limit = int(arg.MaxEntries)
}
for i := 0; i < limit; i++ {
s := subtrees.subtrees[int(sliceIndex)+i]
r := walletrpc.SubtreeRoot{
RootHash: s.root,
CompletingBlockHash: s.endHash,
CompletingBlockHeight: uint64(s.endHeight),
}
err := resp.Send(&r)
if err != nil {
return err
}
}
return nil
}
func darksideGetRawTransaction(params []json.RawMessage) (json.RawMessage, error) {
if !state.resetted {
return nil, errors.New("please call Reset first")
@ -904,3 +952,23 @@ func DarksideRemoveTreeState(arg *walletrpc.BlockID) error {
}
return nil
}
func DarksideSetSubtreeRoots(arg_subtrees *walletrpc.DarksideSubtreeRoots) error {
mutex.Lock()
defer mutex.Unlock()
if !state.resetted {
return errors.New("please call Reset first")
}
state.subtrees[arg_subtrees.ShieldedProtocol] = darksideProtocolSubtreeRoots{
startIndex: arg_subtrees.StartIndex,
subtrees: make([]darksideSubtree, len(arg_subtrees.SubtreeRoots)),
}
for i := 0; i < len(arg_subtrees.SubtreeRoots); i++ {
s := &state.subtrees[arg_subtrees.ShieldedProtocol].subtrees[i]
arg := arg_subtrees.SubtreeRoots[i]
s.root = arg.RootHash
s.endHeight = int(arg.CompletingBlockHeight)
s.endHash = arg.CompletingBlockHash
}
return nil
}

View File

@ -233,6 +233,10 @@
<a href="#cash.z.wallet.sdk.rpc.DarksideMetaState"><span class="badge">M</span>DarksideMetaState</a>
</li>
<li>
<a href="#cash.z.wallet.sdk.rpc.DarksideSubtreeRoots"><span class="badge">M</span>DarksideSubtreeRoots</a>
</li>
<li>
<a href="#cash.z.wallet.sdk.rpc.DarksideTransactionsURL"><span class="badge">M</span>DarksideTransactionsURL</a>
</li>
@ -816,6 +820,44 @@ If there are no transparent inputs, the fee will be calculable as:
<h3 id="cash.z.wallet.sdk.rpc.DarksideSubtreeRoots">DarksideSubtreeRoots</h3>
<p></p>
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>
<tr>
<td>shieldedProtocol</td>
<td><a href="#cash.z.wallet.sdk.rpc.ShieldedProtocol">ShieldedProtocol</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
<td>startIndex</td>
<td><a href="#uint32">uint32</a></td>
<td></td>
<td><p> </p></td>
</tr>
<tr>
<td>subtreeRoots</td>
<td><a href="#cash.z.wallet.sdk.rpc.SubtreeRoot">SubtreeRoot</a></td>
<td>repeated</td>
<td><p> </p></td>
</tr>
</tbody>
</table>
<h3 id="cash.z.wallet.sdk.rpc.DarksideTransactionsURL">DarksideTransactionsURL</h3>
<p>DarksideTransactionsURL refers to an HTTP source that contains a list</p><p>of hex-encoded transactions, one per line, that are to be associated</p><p>with the given height (fake-mined into the block at that height)</p>
@ -1000,6 +1042,14 @@ There is no staging or applying for these, very simple.</p></td>
<td><p>Clear the list of GetTreeStates entries (can&#39;t fail)</p></td>
</tr>
<tr>
<td>SetSubtreeRoots</td>
<td><a href="#cash.z.wallet.sdk.rpc.DarksideSubtreeRoots">DarksideSubtreeRoots</a></td>
<td><a href="#cash.z.wallet.sdk.rpc.Empty">Empty</a></td>
<td><p>Sets the subtree roots cache (for GetSubtreeRoots),
replacing any existing entries</p></td>
</tr>
</tbody>
</table>
@ -1831,7 +1881,8 @@ There is no staging or applying for these, very simple.</p></td>
<td>GetTaddressTxids</td>
<td><a href="#cash.z.wallet.sdk.rpc.TransparentAddressBlockFilter">TransparentAddressBlockFilter</a></td>
<td><a href="#cash.z.wallet.sdk.rpc.RawTransaction">RawTransaction</a> stream</td>
<td><p>Return the txids corresponding to the given t-address within the given block range</p></td>
<td><p>Return the transactions corresponding to the given t-address within the given block range
NB - this method is misnamed, it returns transactions, not transaction IDs.</p></td>
</tr>
<tr>

View File

@ -677,15 +677,20 @@ func (s *lwdStreamer) GetAddressUtxos(ctx context.Context, arg *walletrpc.GetAdd
}
func (s *lwdStreamer) GetSubtreeRoots(arg *walletrpc.GetSubtreeRootsArg, resp walletrpc.CompactTxStreamer_GetSubtreeRootsServer) error {
if common.DarksideEnabled {
return common.DarksideGetSubtreeRoots(arg, resp)
}
switch arg.ShieldedProtocol {
case walletrpc.ShieldedProtocol_sapling:
break
case walletrpc.ShieldedProtocol_orchard:
break
default:
return errors.New("unrecognized shielded protocol")
}
protocol, err := json.Marshal(arg.ShieldedProtocol.String())
if err != nil {
return errors.New("bad shielded protocol specifier")
}
startIndexJSON, err := json.Marshal(arg.StartIndex)
if err != nil {
return errors.New("bad startIndex")
@ -919,3 +924,9 @@ func (s *DarksideStreamer) ClearAllTreeStates(ctx context.Context, arg *walletrp
return &walletrpc.Empty{}, err
}
func (s *DarksideStreamer) SetSubtreeRoots(ctx context.Context, arg *walletrpc.DarksideSubtreeRoots) (*walletrpc.Empty, error) {
err := common.DarksideSetSubtreeRoots(arg)
return &walletrpc.Empty{}, err
}

View File

@ -368,6 +368,69 @@ func (x *DarksideEmptyBlocks) GetCount() int32 {
return 0
}
type DarksideSubtreeRoots struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ShieldedProtocol ShieldedProtocol `protobuf:"varint,1,opt,name=shieldedProtocol,proto3,enum=cash.z.wallet.sdk.rpc.ShieldedProtocol" json:"shieldedProtocol,omitempty"`
StartIndex uint32 `protobuf:"varint,2,opt,name=startIndex,proto3" json:"startIndex,omitempty"`
SubtreeRoots []*SubtreeRoot `protobuf:"bytes,3,rep,name=subtreeRoots,proto3" json:"subtreeRoots,omitempty"`
}
func (x *DarksideSubtreeRoots) Reset() {
*x = DarksideSubtreeRoots{}
if protoimpl.UnsafeEnabled {
mi := &file_darkside_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DarksideSubtreeRoots) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DarksideSubtreeRoots) ProtoMessage() {}
func (x *DarksideSubtreeRoots) ProtoReflect() protoreflect.Message {
mi := &file_darkside_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DarksideSubtreeRoots.ProtoReflect.Descriptor instead.
func (*DarksideSubtreeRoots) Descriptor() ([]byte, []int) {
return file_darkside_proto_rawDescGZIP(), []int{6}
}
func (x *DarksideSubtreeRoots) GetShieldedProtocol() ShieldedProtocol {
if x != nil {
return x.ShieldedProtocol
}
return ShieldedProtocol_sapling
}
func (x *DarksideSubtreeRoots) GetStartIndex() uint32 {
if x != nil {
return x.StartIndex
}
return 0
}
func (x *DarksideSubtreeRoots) GetSubtreeRoots() []*SubtreeRoot {
if x != nil {
return x.SubtreeRoots
}
return nil
}
var File_darkside_proto protoreflect.FileDescriptor
var file_darkside_proto_rawDesc = []byte{
@ -408,90 +471,109 @@ var file_darkside_proto_rawDesc = []byte{
0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0x84, 0x0a, 0x0a,
0x10, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x65,
0x72, 0x12, 0x51, 0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74, 0x12, 0x28, 0x2e, 0x63, 0x61, 0x73,
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x53,
0x74, 0x61, 0x74, 0x65, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61,
0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f,
0x63, 0x6b, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x24, 0x2e, 0x63, 0x61, 0x73, 0x68,
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a,
0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e,
0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x28,
0x01, 0x12, 0x57, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xd3, 0x01, 0x0a,
0x14, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x53, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65,
0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x53, 0x0a, 0x10, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x65,
0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32,
0x27, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e,
0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x68, 0x69, 0x65, 0x6c, 0x64, 0x65, 0x64,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x52, 0x10, 0x73, 0x68, 0x69, 0x65, 0x6c, 0x64,
0x65, 0x64, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74,
0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a,
0x73, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x46, 0x0a, 0x0c, 0x73, 0x75,
0x62, 0x74, 0x72, 0x65, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x22, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65,
0x52, 0x6f, 0x6f, 0x74, 0x52, 0x0c, 0x73, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65, 0x52, 0x6f, 0x6f,
0x74, 0x73, 0x32, 0xe4, 0x0a, 0x0a, 0x10, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x53,
0x74, 0x72, 0x65, 0x61, 0x6d, 0x65, 0x72, 0x12, 0x51, 0x0a, 0x05, 0x52, 0x65, 0x73, 0x65, 0x74,
0x12, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64,
0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x55, 0x52, 0x4c, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73,
0x65, 0x4d, 0x65, 0x74, 0x61, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73,
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x5f, 0x0a, 0x11, 0x53, 0x74,
0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12,
0x2a, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e,
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x5b, 0x0a, 0x11, 0x53, 0x74,
0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12,
0x24, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e,
0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x1a, 0x1c, 0x2e, 0x63, 0x61,
0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x17, 0x53,
0x74, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e,
0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52,
0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x1c, 0x2e,
0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64,
0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x28, 0x01, 0x12,
0x63, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61,
0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x72,
0x6b, 0x73, 0x69, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x55, 0x52, 0x4c, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61,
0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0b, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61,
0x67, 0x65, 0x64, 0x12, 0x25, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c,
0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b,
0x73, 0x69, 0x64, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73,
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x62, 0x0a, 0x17, 0x47, 0x65,
0x74, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77,
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77,
0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c,
0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x61, 0x77, 0x54,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x00, 0x30, 0x01, 0x12, 0x59,
0x0a, 0x19, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x54,
0x70, 0x74, 0x79, 0x22, 0x00, 0x28, 0x01, 0x12, 0x57, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x67, 0x65,
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, 0x28, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e,
0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44,
0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x55, 0x52, 0x4c,
0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00,
0x12, 0x5f, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x67, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x2a, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77,
0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61,
0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
0x73, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65,
0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
0x00, 0x12, 0x62, 0x0a, 0x17, 0x53, 0x74, 0x61, 0x67, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x2e, 0x63,
0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c,
0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x22, 0x00, 0x28, 0x01, 0x12, 0x63, 0x0a, 0x11, 0x53, 0x74, 0x61, 0x67, 0x65, 0x54, 0x72,
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x61, 0x73,
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x55, 0x52, 0x4c, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73,
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0b, 0x41, 0x70,
0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x67, 0x65, 0x64, 0x12, 0x25, 0x2e, 0x63, 0x61, 0x73, 0x68,
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74,
0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00,
0x12, 0x62, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x54,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1c, 0x2e, 0x63, 0x61,
0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x25, 0x2e, 0x63, 0x61, 0x73, 0x68,
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x22, 0x00, 0x30, 0x01, 0x12, 0x59, 0x0a, 0x19, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x63,
0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x12, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65,
0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a,
0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e,
0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12,
0x5d, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74, 0x78,
0x6f, 0x12, 0x2b, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65,
0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x64,
0x72, 0x65, 0x73, 0x73, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x1a, 0x1c,
0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73,
0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x50,
0x0a, 0x10, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74,
0x78, 0x6f, 0x12, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c,
0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00,
0x12, 0x50, 0x0a, 0x0c, 0x41, 0x64, 0x64, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65,
0x12, 0x20, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61,
0x74, 0x65, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c,
0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x22, 0x00, 0x12, 0x51, 0x0a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x72, 0x65, 0x65,
0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77,
0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c,
0x6f, 0x63, 0x6b, 0x49, 0x44, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77,
0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x12, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x41, 0x6c,
0x6c, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x2e, 0x63, 0x61,
0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68,
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0e, 0x41, 0x64, 0x64,
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74, 0x78, 0x6f, 0x12, 0x2b, 0x2e, 0x63, 0x61,
0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e,
0x72, 0x70, 0x63, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74,
0x78, 0x6f, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e,
0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x10, 0x43, 0x6c, 0x65, 0x61,
0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x55, 0x74, 0x78, 0x6f, 0x12, 0x1c, 0x2e, 0x63,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x0f, 0x53, 0x65, 0x74,
0x53, 0x75, 0x62, 0x74, 0x72, 0x65, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x12, 0x2b, 0x2e, 0x63,
0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73,
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x0c, 0x41, 0x64,
0x64, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x20, 0x2e, 0x63, 0x61, 0x73,
0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72,
0x70, 0x63, 0x2e, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x1a, 0x1c, 0x2e, 0x63,
0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x51, 0x0a, 0x0f,
0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x54, 0x72, 0x65, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12,
0x1e, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e,
0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x49, 0x44, 0x1a,
0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e,
0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12,
0x52, 0x0a, 0x12, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x41, 0x6c, 0x6c, 0x54, 0x72, 0x65, 0x65, 0x53,
0x74, 0x61, 0x74, 0x65, 0x73, 0x12, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77,
0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d,
0x70, 0x74, 0x79, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68, 0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c,
0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x22, 0x00, 0x42, 0x1b, 0x5a, 0x16, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x77, 0x61, 0x6c, 0x6c,
0x65, 0x74, 0x64, 0x2f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x72, 0x70, 0x63, 0xba, 0x02, 0x00,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2e, 0x72, 0x70, 0x63, 0x2e, 0x44, 0x61, 0x72, 0x6b, 0x73, 0x69, 0x64, 0x65, 0x53, 0x75, 0x62,
0x74, 0x72, 0x65, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x73, 0x1a, 0x1c, 0x2e, 0x63, 0x61, 0x73, 0x68,
0x2e, 0x7a, 0x2e, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x72, 0x70,
0x63, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x1b, 0x5a, 0x16, 0x6c, 0x69, 0x67,
0x68, 0x74, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x64, 0x2f, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74,
0x72, 0x70, 0x63, 0xba, 0x02, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -506,7 +588,7 @@ func file_darkside_proto_rawDescGZIP() []byte {
return file_darkside_proto_rawDescData
}
var file_darkside_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_darkside_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_darkside_proto_goTypes = []interface{}{
(*DarksideMetaState)(nil), // 0: cash.z.wallet.sdk.rpc.DarksideMetaState
(*DarksideBlock)(nil), // 1: cash.z.wallet.sdk.rpc.DarksideBlock
@ -514,46 +596,53 @@ var file_darkside_proto_goTypes = []interface{}{
(*DarksideTransactionsURL)(nil), // 3: cash.z.wallet.sdk.rpc.DarksideTransactionsURL
(*DarksideHeight)(nil), // 4: cash.z.wallet.sdk.rpc.DarksideHeight
(*DarksideEmptyBlocks)(nil), // 5: cash.z.wallet.sdk.rpc.DarksideEmptyBlocks
(*RawTransaction)(nil), // 6: cash.z.wallet.sdk.rpc.RawTransaction
(*Empty)(nil), // 7: cash.z.wallet.sdk.rpc.Empty
(*GetAddressUtxosReply)(nil), // 8: cash.z.wallet.sdk.rpc.GetAddressUtxosReply
(*TreeState)(nil), // 9: cash.z.wallet.sdk.rpc.TreeState
(*BlockID)(nil), // 10: cash.z.wallet.sdk.rpc.BlockID
(*DarksideSubtreeRoots)(nil), // 6: cash.z.wallet.sdk.rpc.DarksideSubtreeRoots
(ShieldedProtocol)(0), // 7: cash.z.wallet.sdk.rpc.ShieldedProtocol
(*SubtreeRoot)(nil), // 8: cash.z.wallet.sdk.rpc.SubtreeRoot
(*RawTransaction)(nil), // 9: cash.z.wallet.sdk.rpc.RawTransaction
(*Empty)(nil), // 10: cash.z.wallet.sdk.rpc.Empty
(*GetAddressUtxosReply)(nil), // 11: cash.z.wallet.sdk.rpc.GetAddressUtxosReply
(*TreeState)(nil), // 12: cash.z.wallet.sdk.rpc.TreeState
(*BlockID)(nil), // 13: cash.z.wallet.sdk.rpc.BlockID
}
var file_darkside_proto_depIdxs = []int32{
0, // 0: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:input_type -> cash.z.wallet.sdk.rpc.DarksideMetaState
1, // 1: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:input_type -> cash.z.wallet.sdk.rpc.DarksideBlock
2, // 2: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:input_type -> cash.z.wallet.sdk.rpc.DarksideBlocksURL
5, // 3: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:input_type -> cash.z.wallet.sdk.rpc.DarksideEmptyBlocks
6, // 4: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:input_type -> cash.z.wallet.sdk.rpc.RawTransaction
3, // 5: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:input_type -> cash.z.wallet.sdk.rpc.DarksideTransactionsURL
4, // 6: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:input_type -> cash.z.wallet.sdk.rpc.DarksideHeight
7, // 7: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
7, // 8: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
8, // 9: cash.z.wallet.sdk.rpc.DarksideStreamer.AddAddressUtxo:input_type -> cash.z.wallet.sdk.rpc.GetAddressUtxosReply
7, // 10: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAddressUtxo:input_type -> cash.z.wallet.sdk.rpc.Empty
9, // 11: cash.z.wallet.sdk.rpc.DarksideStreamer.AddTreeState:input_type -> cash.z.wallet.sdk.rpc.TreeState
10, // 12: cash.z.wallet.sdk.rpc.DarksideStreamer.RemoveTreeState:input_type -> cash.z.wallet.sdk.rpc.BlockID
7, // 13: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAllTreeStates:input_type -> cash.z.wallet.sdk.rpc.Empty
7, // 14: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 15: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 16: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 17: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 18: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 19: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 20: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:output_type -> cash.z.wallet.sdk.rpc.Empty
6, // 21: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.RawTransaction
7, // 22: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 23: cash.z.wallet.sdk.rpc.DarksideStreamer.AddAddressUtxo:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 24: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAddressUtxo:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 25: cash.z.wallet.sdk.rpc.DarksideStreamer.AddTreeState:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 26: cash.z.wallet.sdk.rpc.DarksideStreamer.RemoveTreeState:output_type -> cash.z.wallet.sdk.rpc.Empty
7, // 27: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAllTreeStates:output_type -> cash.z.wallet.sdk.rpc.Empty
14, // [14:28] is the sub-list for method output_type
0, // [0:14] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
7, // 0: cash.z.wallet.sdk.rpc.DarksideSubtreeRoots.shieldedProtocol:type_name -> cash.z.wallet.sdk.rpc.ShieldedProtocol
8, // 1: cash.z.wallet.sdk.rpc.DarksideSubtreeRoots.subtreeRoots:type_name -> cash.z.wallet.sdk.rpc.SubtreeRoot
0, // 2: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:input_type -> cash.z.wallet.sdk.rpc.DarksideMetaState
1, // 3: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:input_type -> cash.z.wallet.sdk.rpc.DarksideBlock
2, // 4: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:input_type -> cash.z.wallet.sdk.rpc.DarksideBlocksURL
5, // 5: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:input_type -> cash.z.wallet.sdk.rpc.DarksideEmptyBlocks
9, // 6: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:input_type -> cash.z.wallet.sdk.rpc.RawTransaction
3, // 7: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:input_type -> cash.z.wallet.sdk.rpc.DarksideTransactionsURL
4, // 8: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:input_type -> cash.z.wallet.sdk.rpc.DarksideHeight
10, // 9: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
10, // 10: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:input_type -> cash.z.wallet.sdk.rpc.Empty
11, // 11: cash.z.wallet.sdk.rpc.DarksideStreamer.AddAddressUtxo:input_type -> cash.z.wallet.sdk.rpc.GetAddressUtxosReply
10, // 12: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAddressUtxo:input_type -> cash.z.wallet.sdk.rpc.Empty
12, // 13: cash.z.wallet.sdk.rpc.DarksideStreamer.AddTreeState:input_type -> cash.z.wallet.sdk.rpc.TreeState
13, // 14: cash.z.wallet.sdk.rpc.DarksideStreamer.RemoveTreeState:input_type -> cash.z.wallet.sdk.rpc.BlockID
10, // 15: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAllTreeStates:input_type -> cash.z.wallet.sdk.rpc.Empty
6, // 16: cash.z.wallet.sdk.rpc.DarksideStreamer.SetSubtreeRoots:input_type -> cash.z.wallet.sdk.rpc.DarksideSubtreeRoots
10, // 17: cash.z.wallet.sdk.rpc.DarksideStreamer.Reset:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 18: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksStream:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 19: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocks:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 20: cash.z.wallet.sdk.rpc.DarksideStreamer.StageBlocksCreate:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 21: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactionsStream:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 22: cash.z.wallet.sdk.rpc.DarksideStreamer.StageTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 23: cash.z.wallet.sdk.rpc.DarksideStreamer.ApplyStaged:output_type -> cash.z.wallet.sdk.rpc.Empty
9, // 24: cash.z.wallet.sdk.rpc.DarksideStreamer.GetIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.RawTransaction
10, // 25: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearIncomingTransactions:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 26: cash.z.wallet.sdk.rpc.DarksideStreamer.AddAddressUtxo:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 27: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAddressUtxo:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 28: cash.z.wallet.sdk.rpc.DarksideStreamer.AddTreeState:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 29: cash.z.wallet.sdk.rpc.DarksideStreamer.RemoveTreeState:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 30: cash.z.wallet.sdk.rpc.DarksideStreamer.ClearAllTreeStates:output_type -> cash.z.wallet.sdk.rpc.Empty
10, // 31: cash.z.wallet.sdk.rpc.DarksideStreamer.SetSubtreeRoots:output_type -> cash.z.wallet.sdk.rpc.Empty
17, // [17:32] is the sub-list for method output_type
2, // [2:17] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_darkside_proto_init() }
@ -635,6 +724,18 @@ func file_darkside_proto_init() {
return nil
}
}
file_darkside_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DarksideSubtreeRoots); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -642,7 +743,7 @@ func file_darkside_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_darkside_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},

View File

@ -45,6 +45,12 @@ message DarksideEmptyBlocks {
int32 count = 3;
}
message DarksideSubtreeRoots {
ShieldedProtocol shieldedProtocol = 1;
uint32 startIndex = 2;
repeated SubtreeRoot subtreeRoots = 3;
}
// Darksidewalletd maintains two staging areas, blocks and transactions. The
// Stage*() gRPCs add items to the staging area; ApplyStaged() "applies" everything
// in the staging area to the working (operational) state that the mock zcashd
@ -132,4 +138,8 @@ service DarksideStreamer {
// Clear the list of GetTreeStates entries (can't fail)
rpc ClearAllTreeStates(Empty) returns (Empty) {}
// Sets the subtree roots cache (for GetSubtreeRoots),
// replacing any existing entries
rpc SetSubtreeRoots(DarksideSubtreeRoots) returns (Empty) {}
}

View File

@ -37,6 +37,7 @@ const (
DarksideStreamer_AddTreeState_FullMethodName = "/cash.z.wallet.sdk.rpc.DarksideStreamer/AddTreeState"
DarksideStreamer_RemoveTreeState_FullMethodName = "/cash.z.wallet.sdk.rpc.DarksideStreamer/RemoveTreeState"
DarksideStreamer_ClearAllTreeStates_FullMethodName = "/cash.z.wallet.sdk.rpc.DarksideStreamer/ClearAllTreeStates"
DarksideStreamer_SetSubtreeRoots_FullMethodName = "/cash.z.wallet.sdk.rpc.DarksideStreamer/SetSubtreeRoots"
)
// DarksideStreamerClient is the client API for DarksideStreamer service.
@ -112,6 +113,9 @@ type DarksideStreamerClient interface {
RemoveTreeState(ctx context.Context, in *BlockID, opts ...grpc.CallOption) (*Empty, error)
// Clear the list of GetTreeStates entries (can't fail)
ClearAllTreeStates(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
// Sets the subtree roots cache (for GetSubtreeRoots),
// replacing any existing entries
SetSubtreeRoots(ctx context.Context, in *DarksideSubtreeRoots, opts ...grpc.CallOption) (*Empty, error)
}
type darksideStreamerClient struct {
@ -321,6 +325,15 @@ func (c *darksideStreamerClient) ClearAllTreeStates(ctx context.Context, in *Emp
return out, nil
}
func (c *darksideStreamerClient) SetSubtreeRoots(ctx context.Context, in *DarksideSubtreeRoots, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, DarksideStreamer_SetSubtreeRoots_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// DarksideStreamerServer is the server API for DarksideStreamer service.
// All implementations must embed UnimplementedDarksideStreamerServer
// for forward compatibility
@ -394,6 +407,9 @@ type DarksideStreamerServer interface {
RemoveTreeState(context.Context, *BlockID) (*Empty, error)
// Clear the list of GetTreeStates entries (can't fail)
ClearAllTreeStates(context.Context, *Empty) (*Empty, error)
// Sets the subtree roots cache (for GetSubtreeRoots),
// replacing any existing entries
SetSubtreeRoots(context.Context, *DarksideSubtreeRoots) (*Empty, error)
mustEmbedUnimplementedDarksideStreamerServer()
}
@ -443,6 +459,9 @@ func (UnimplementedDarksideStreamerServer) RemoveTreeState(context.Context, *Blo
func (UnimplementedDarksideStreamerServer) ClearAllTreeStates(context.Context, *Empty) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ClearAllTreeStates not implemented")
}
func (UnimplementedDarksideStreamerServer) SetSubtreeRoots(context.Context, *DarksideSubtreeRoots) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetSubtreeRoots not implemented")
}
func (UnimplementedDarksideStreamerServer) mustEmbedUnimplementedDarksideStreamerServer() {}
// UnsafeDarksideStreamerServer may be embedded to opt out of forward compatibility for this service.
@ -727,6 +746,24 @@ func _DarksideStreamer_ClearAllTreeStates_Handler(srv interface{}, ctx context.C
return interceptor(ctx, in, info, handler)
}
func _DarksideStreamer_SetSubtreeRoots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DarksideSubtreeRoots)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(DarksideStreamerServer).SetSubtreeRoots(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: DarksideStreamer_SetSubtreeRoots_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(DarksideStreamerServer).SetSubtreeRoots(ctx, req.(*DarksideSubtreeRoots))
}
return interceptor(ctx, in, info, handler)
}
// DarksideStreamer_ServiceDesc is the grpc.ServiceDesc for DarksideStreamer service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@ -778,6 +815,10 @@ var DarksideStreamer_ServiceDesc = grpc.ServiceDesc{
MethodName: "ClearAllTreeStates",
Handler: _DarksideStreamer_ClearAllTreeStates_Handler,
},
{
MethodName: "SetSubtreeRoots",
Handler: _DarksideStreamer_SetSubtreeRoots_Handler,
},
},
Streams: []grpc.StreamDesc{
{