From 097b273a6d0b65b47a3ce13424df3cff217f594a Mon Sep 17 00:00:00 2001 From: Eduard Voiculescu Date: Tue, 9 Jul 2024 11:18:15 -0400 Subject: [PATCH] - fetching spec version and previous spec version - updating the metadata in the block header if it has been updated --- main.go | 13 +- pb/sf/gear/type/v1/block.pb.go | 391 ++++++++++++++++-------------- proto/sf/gear/type/v1/block.proto | 2 + rpc/fetcher.go | 54 ++++- 4 files changed, 268 insertions(+), 192 deletions(-) diff --git a/main.go b/main.go index 938a0e1..75794fe 100644 --- a/main.go +++ b/main.go @@ -117,5 +117,16 @@ func main() { log.Fatalf("Failed to marshal extrinsic: %v", err) } - fmt.Println(string(m)) + _ = m + + block0, err := types.NewHashFromHexString("0x1555a60f789e322c607f8b8df062cf0441484897b547028c378509d5e56eec48") + if err != nil { + log.Fatalf("Failed to create block hash: %v", err) + } + specVerion, err := api.RPC.State.GetRuntimeVersion(block0) + if err != nil { + log.Fatalf("Failed to get runtime version: %v", err) + } + + fmt.Println("Spec Version: ", specVerion.SpecVersion) } diff --git a/pb/sf/gear/type/v1/block.pb.go b/pb/sf/gear/type/v1/block.pb.go index cc1b3b2..612439f 100644 --- a/pb/sf/gear/type/v1/block.pb.go +++ b/pb/sf/gear/type/v1/block.pb.go @@ -125,7 +125,9 @@ type Header struct { // [32]byte StateRoot string `protobuf:"bytes,2,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty"` // [32]byte - ExtrinsicsRoot string `protobuf:"bytes,3,opt,name=extrinsics_root,json=extrinsicsRoot,proto3" json:"extrinsics_root,omitempty"` + ExtrinsicsRoot string `protobuf:"bytes,3,opt,name=extrinsics_root,json=extrinsicsRoot,proto3" json:"extrinsics_root,omitempty"` + SpecVersion uint32 `protobuf:"varint,4,opt,name=spec_version,json=specVersion,proto3" json:"spec_version,omitempty"` + UpdatedMetadata []byte `protobuf:"bytes,5,opt,name=updated_metadata,json=updatedMetadata,proto3" json:"updated_metadata,omitempty"` } func (x *Header) Reset() { @@ -181,6 +183,20 @@ func (x *Header) GetExtrinsicsRoot() string { return "" } +func (x *Header) GetSpecVersion() uint32 { + if x != nil { + return x.SpecVersion + } + return 0 +} + +func (x *Header) GetUpdatedMetadata() []byte { + if x != nil { + return x.UpdatedMetadata + } + return nil +} + type DigestItem struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1583,194 +1599,199 @@ var file_sf_gear_type_v1_block_proto_rawDesc = []byte{ 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0b, 0x64, 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6a, 0x75, 0x73, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x71, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, 0x68, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, - 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x73, 0x5f, - 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x72, - 0x69, 0x6e, 0x73, 0x69, 0x63, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0xf7, 0x02, 0x0a, 0x0a, 0x44, - 0x69, 0x67, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x31, 0x0a, 0x14, 0x61, 0x73, 0x5f, - 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x5f, 0x74, 0x72, 0x69, 0x65, 0x5f, 0x72, 0x6f, 0x6f, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x11, 0x61, 0x73, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x54, 0x72, 0x69, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x0e, - 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x73, 0x50, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, - 0x65, 0x12, 0x3f, 0x0a, 0x0c, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, - 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, - 0x73, 0x75, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x73, 0x65, 0x61, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, - 0x53, 0x65, 0x61, 0x6c, 0x12, 0x59, 0x0a, 0x16, 0x61, 0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x73, 0x5f, 0x74, 0x72, 0x69, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x54, 0x72, - 0x69, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x13, 0x61, 0x73, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x54, 0x72, 0x69, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, - 0x1b, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0c, 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x42, 0x06, 0x0a, 0x04, - 0x49, 0x74, 0x65, 0x6d, 0x22, 0x52, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, - 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xbf, 0x01, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, + 0x6f, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x73, + 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x65, 0x78, 0x74, + 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, + 0x70, 0x65, 0x63, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x63, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x29, + 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xf7, 0x02, 0x0a, 0x0a, 0x44, 0x69, + 0x67, 0x65, 0x73, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x31, 0x0a, 0x14, 0x61, 0x73, 0x5f, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x5f, 0x74, 0x72, 0x69, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x11, 0x61, 0x73, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x54, 0x72, 0x69, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x43, 0x0a, 0x0e, 0x61, + 0x73, 0x5f, 0x70, 0x72, 0x65, 0x5f, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x48, 0x00, 0x52, 0x0c, 0x61, 0x73, 0x50, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, + 0x12, 0x3f, 0x0a, 0x0c, 0x61, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, + 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, + 0x75, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x73, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x12, 0x30, 0x0a, 0x07, 0x61, 0x73, 0x5f, 0x73, 0x65, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x61, 0x73, 0x53, + 0x65, 0x61, 0x6c, 0x12, 0x59, 0x0a, 0x16, 0x61, 0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x73, 0x5f, 0x74, 0x72, 0x69, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x54, 0x72, 0x69, + 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x48, 0x00, 0x52, 0x13, 0x61, 0x73, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x73, 0x54, 0x72, 0x69, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x1b, + 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, + 0x48, 0x00, 0x52, 0x07, 0x61, 0x73, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x42, 0x06, 0x0a, 0x04, 0x49, + 0x74, 0x65, 0x6d, 0x22, 0x52, 0x0a, 0x0a, 0x50, 0x72, 0x65, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, + 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x65, + 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, + 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x49, + 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x73, 0x65, + 0x6e, 0x73, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, + 0x73, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x45, 0x6e, 0x67, 0x69, + 0x6e, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x4c, 0x0a, 0x04, 0x53, 0x65, + 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x73, - 0x65, 0x6e, 0x73, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, - 0x75, 0x73, 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x45, 0x6e, 0x67, - 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x4c, 0x0a, 0x04, 0x53, - 0x65, 0x61, 0x6c, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, - 0x5f, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x11, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x45, 0x6e, 0x67, 0x69, 0x6e, - 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x77, 0x0a, 0x11, 0x43, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x73, 0x54, 0x72, 0x69, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x30, - 0x0a, 0x14, 0x69, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x73, - 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x30, 0x0a, 0x14, 0x61, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, - 0x61, 0x73, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x0c, 0x52, 0x05, 0x62, 0x79, 0x74, 0x65, 0x73, 0x22, 0x77, 0x0a, 0x11, 0x43, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x54, 0x72, 0x69, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x12, 0x30, 0x0a, + 0x14, 0x69, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x69, 0x73, 0x4e, + 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x30, 0x0a, 0x14, 0x61, 0x73, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x61, + 0x73, 0x4e, 0x65, 0x77, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x22, 0x8e, 0x01, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, + 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x22, 0xda, 0x01, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x12, 0x35, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1d, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x66, 0x2e, + 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x6c, + 0x74, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2f, 0x0a, 0x03, 0x65, 0x72, 0x61, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x45, + 0x72, 0x61, 0x52, 0x03, 0x65, 0x72, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x10, 0x0a, + 0x03, 0x74, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, + 0xac, 0x02, 0x0a, 0x0c, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x13, 0x0a, 0x05, 0x69, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x69, 0x73, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x61, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, + 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, + 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, + 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x05, 0x69, 0x73, 0x52, 0x61, 0x77, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x73, 0x5f, 0x72, 0x61, + 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x52, 0x61, 0x77, 0x12, 0x22, + 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x33, 0x32, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x33, 0x32, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x5f, 0x33, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x33, 0x32, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x5f, 0x32, 0x30, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, + 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x32, 0x30, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x73, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x32, 0x30, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x61, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x32, 0x30, 0x22, 0xc6, + 0x01, 0x0a, 0x0e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x65, 0x64, 0x5f, 0x32, 0x35, 0x35, 0x31, 0x39, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x64, 0x32, 0x35, 0x35, 0x31, + 0x39, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x73, 0x5f, 0x65, 0x64, 0x5f, 0x32, 0x35, 0x35, 0x31, 0x39, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x45, 0x64, 0x32, 0x35, 0x35, 0x31, + 0x39, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x73, 0x72, 0x5f, 0x32, 0x35, 0x35, 0x31, 0x39, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x72, 0x32, 0x35, 0x35, 0x31, + 0x39, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x73, 0x5f, 0x73, 0x72, 0x5f, 0x32, 0x35, 0x35, 0x31, 0x39, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x53, 0x72, 0x32, 0x35, 0x35, 0x31, + 0x39, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x12, 0x19, 0x0a, 0x08, + 0x61, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x61, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x22, 0x9a, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x74, 0x72, + 0x69, 0x6e, 0x73, 0x69, 0x63, 0x45, 0x72, 0x61, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x73, 0x5f, 0x69, + 0x6d, 0x6d, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0d, 0x69, 0x73, 0x49, 0x6d, 0x6d, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x61, + 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x72, + 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x4d, 0x6f, 0x72, 0x74, 0x61, + 0x6c, 0x45, 0x72, 0x61, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x74, 0x61, + 0x6c, 0x5f, 0x65, 0x72, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x66, + 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, + 0x72, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x61, 0x52, 0x0b, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x74, 0x61, + 0x6c, 0x45, 0x72, 0x61, 0x22, 0x55, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x39, 0x0a, 0x0a, + 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x09, 0x63, 0x61, + 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x9b, 0x01, 0x0a, 0x05, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x6f, 0x6f, + 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0b, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, 0x0a, + 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x31, 0x0a, + 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x52, 0x06, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x22, 0xda, 0x01, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x12, 0x35, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x73, 0x66, - 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x75, - 0x6c, 0x74, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x73, 0x69, - 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x2f, 0x0a, 0x03, 0x65, 0x72, 0x61, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, - 0x45, 0x72, 0x61, 0x52, 0x03, 0x65, 0x72, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x6e, 0x6f, 0x6e, 0x63, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x10, - 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x69, 0x70, - 0x22, 0xac, 0x02, 0x0a, 0x0c, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x13, 0x0a, 0x05, 0x69, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x04, 0x69, 0x73, 0x49, 0x64, 0x12, 0x13, 0x0a, 0x05, 0x61, 0x73, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x61, 0x73, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x69, - 0x73, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, - 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x69, 0x6e, 0x64, - 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x61, 0x73, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x15, 0x0a, 0x06, 0x69, 0x73, 0x5f, 0x72, 0x61, 0x77, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x05, 0x69, 0x73, 0x52, 0x61, 0x77, 0x12, 0x15, 0x0a, 0x06, 0x61, 0x73, 0x5f, 0x72, - 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x52, 0x61, 0x77, 0x12, - 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x33, 0x32, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x33, 0x32, 0x12, 0x22, 0x0a, 0x0d, 0x61, 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x5f, 0x33, 0x32, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x33, 0x32, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x32, 0x30, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x69, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x32, 0x30, 0x12, 0x22, 0x0a, 0x0d, 0x61, - 0x73, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x5f, 0x32, 0x30, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x32, 0x30, 0x22, - 0xc6, 0x01, 0x0a, 0x0e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, - 0x72, 0x65, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x65, 0x64, 0x5f, 0x32, 0x35, 0x35, 0x31, - 0x39, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x64, 0x32, 0x35, 0x35, - 0x31, 0x39, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x73, 0x5f, 0x65, 0x64, 0x5f, 0x32, 0x35, 0x35, 0x31, - 0x39, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x45, 0x64, 0x32, 0x35, 0x35, - 0x31, 0x39, 0x12, 0x1e, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x73, 0x72, 0x5f, 0x32, 0x35, 0x35, 0x31, - 0x39, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x72, 0x32, 0x35, 0x35, - 0x31, 0x39, 0x12, 0x1e, 0x0a, 0x0b, 0x61, 0x73, 0x5f, 0x73, 0x72, 0x5f, 0x32, 0x35, 0x35, 0x31, - 0x39, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x53, 0x72, 0x32, 0x35, 0x35, - 0x31, 0x39, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x12, 0x19, 0x0a, - 0x08, 0x61, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x22, 0x9a, 0x01, 0x0a, 0x0c, 0x45, 0x78, 0x74, - 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x45, 0x72, 0x61, 0x12, 0x26, 0x0a, 0x0f, 0x69, 0x73, 0x5f, - 0x69, 0x6d, 0x6d, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x61, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0d, 0x69, 0x73, 0x49, 0x6d, 0x6d, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x45, 0x72, - 0x61, 0x12, 0x22, 0x0a, 0x0d, 0x69, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x5f, 0x65, - 0x72, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x4d, 0x6f, 0x72, 0x74, - 0x61, 0x6c, 0x45, 0x72, 0x61, 0x12, 0x3e, 0x0a, 0x0d, 0x61, 0x73, 0x5f, 0x6d, 0x6f, 0x72, 0x74, - 0x61, 0x6c, 0x5f, 0x65, 0x72, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, - 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x61, 0x52, 0x0b, 0x61, 0x73, 0x4d, 0x6f, 0x72, 0x74, - 0x61, 0x6c, 0x45, 0x72, 0x61, 0x22, 0x55, 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x39, 0x0a, - 0x0a, 0x63, 0x61, 0x6c, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x09, 0x63, - 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x9b, 0x01, 0x0a, - 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x6f, - 0x6f, 0x6b, 0x75, 0x70, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0b, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1f, 0x0a, - 0x0a, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x31, - 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, - 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, - 0x73, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x06, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, - 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x22, 0x53, 0x0a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, - 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xa1, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, - 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x61, 0x73, 0x65, 0x52, 0x05, 0x70, 0x68, - 0x61, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x05, - 0x50, 0x68, 0x61, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x6c, - 0x79, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x10, 0x69, 0x73, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, - 0x73, 0x69, 0x63, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, - 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x10, 0x61, 0x73, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, - 0x63, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x46, 0x69, - 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x73, - 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc0, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x65, - 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, - 0x45, 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x5f, 0x65, 0x64, - 0x32, 0x35, 0x35, 0x31, 0x39, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x45, - 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x72, 0x32, - 0x35, 0x35, 0x31, 0x39, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x72, - 0x32, 0x35, 0x35, 0x31, 0x39, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x5f, 0x73, 0x72, 0x32, 0x35, - 0x35, 0x31, 0x39, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x53, 0x72, 0x32, - 0x35, 0x35, 0x31, 0x39, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x12, - 0x19, 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x61, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x22, 0x39, 0x0a, 0x09, 0x4d, 0x6f, - 0x72, 0x74, 0x61, 0x6c, 0x45, 0x72, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, 0x16, 0x0a, - 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x21, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x74, 0x69, 0x70, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, - 0x66, 0x61, 0x73, 0x74, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x68, 0x6f, 0x73, 0x65, 0x2d, 0x67, 0x65, - 0x61, 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x73, 0x66, 0x2f, 0x67, 0x65, 0x61, 0x72, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x62, 0x67, 0x65, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x48, 0x00, 0x52, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x36, 0x0a, 0x06, 0x46, 0x69, 0x65, + 0x6c, 0x64, 0x73, 0x12, 0x2c, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, 0x70, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x53, 0x0a, 0x09, 0x43, 0x61, 0x6c, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x23, + 0x0a, 0x0d, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, + 0x64, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x5f, 0x69, 0x6e, + 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0xa1, 0x01, 0x0a, 0x05, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x66, 0x2e, 0x67, 0x65, 0x61, 0x72, 0x2e, 0x74, 0x79, + 0x70, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x68, 0x61, 0x73, 0x65, 0x52, 0x05, 0x70, 0x68, 0x61, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x18, 0x05, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x06, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x73, 0x22, 0xb9, 0x01, 0x0a, 0x05, 0x50, + 0x68, 0x61, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x69, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x6c, 0x79, + 0x5f, 0x65, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x10, 0x69, 0x73, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, + 0x69, 0x63, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x73, 0x5f, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x5f, 0x65, + 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, + 0x61, 0x73, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x45, 0x78, 0x74, 0x72, 0x69, 0x6e, 0x73, 0x69, 0x63, + 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x73, 0x5f, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x73, 0x46, 0x69, 0x6e, + 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x73, 0x5f, + 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x69, 0x73, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, + 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xc0, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x44, 0x65, 0x66, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x65, 0x64, + 0x32, 0x35, 0x35, 0x31, 0x39, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, + 0x64, 0x32, 0x35, 0x35, 0x31, 0x39, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x5f, 0x65, 0x64, 0x32, + 0x35, 0x35, 0x31, 0x39, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x45, 0x64, + 0x32, 0x35, 0x35, 0x31, 0x39, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x72, 0x32, 0x35, + 0x35, 0x31, 0x39, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x72, 0x32, + 0x35, 0x35, 0x31, 0x39, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x5f, 0x73, 0x72, 0x32, 0x35, 0x35, + 0x31, 0x39, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x53, 0x72, 0x32, 0x35, + 0x35, 0x31, 0x39, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x12, 0x19, + 0x0a, 0x08, 0x61, 0x73, 0x5f, 0x65, 0x63, 0x64, 0x73, 0x61, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x73, 0x45, 0x63, 0x64, 0x73, 0x61, 0x22, 0x39, 0x0a, 0x09, 0x4d, 0x6f, 0x72, + 0x74, 0x61, 0x6c, 0x45, 0x72, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x65, + 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x21, 0x0a, 0x0d, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x74, 0x69, 0x70, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x66, + 0x61, 0x73, 0x74, 0x2f, 0x66, 0x69, 0x72, 0x65, 0x68, 0x6f, 0x73, 0x65, 0x2d, 0x67, 0x65, 0x61, + 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x73, 0x66, 0x2f, 0x67, 0x65, 0x61, 0x72, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x62, 0x67, 0x65, 0x61, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/proto/sf/gear/type/v1/block.proto b/proto/sf/gear/type/v1/block.proto index ce495a4..883afb9 100644 --- a/proto/sf/gear/type/v1/block.proto +++ b/proto/sf/gear/type/v1/block.proto @@ -21,6 +21,8 @@ message Header { string state_root = 2; // [32]byte string extrinsics_root = 3; + uint32 spec_version = 4; + bytes updated_metadata = 5; } message DigestItem { diff --git a/rpc/fetcher.go b/rpc/fetcher.go index 9cbc3ff..49b95b8 100644 --- a/rpc/fetcher.go +++ b/rpc/fetcher.go @@ -7,6 +7,7 @@ import ( "math/big" "time" + cclient "github.com/centrifuge/go-substrate-rpc-client/v4/client" "github.com/centrifuge/go-substrate-rpc-client/v4/registry/parser" "github.com/centrifuge/go-substrate-rpc-client/v4/rpc/chain/generic" "github.com/centrifuge/go-substrate-rpc-client/v4/scale" @@ -19,11 +20,17 @@ import ( "google.golang.org/protobuf/types/known/timestamppb" ) +var specVersion uint32 +var metadata string + type FetchedBlockData struct { latestFinalizedHead uint64 blockHash types.Hash block *types.SignedBlock + previousSpecVerion uint32 + specVersion uint32 events []*parser.Event + metadata []byte } type Fetcher struct { @@ -121,6 +128,32 @@ func (f *Fetcher) fetchBlockData(_ context.Context, requestedBlockNum uint64) (* return nil, fmt.Errorf("failed to get events: %w", err) } fetchedBlockData.events = events + + previousBlockhash := block.Block.Header.ParentHash + previousRuntimeVersion, err := client.state.GetRuntimeVersion(previousBlockhash) + if err != nil { + return nil, fmt.Errorf("failed to get runtime version at previous block hash %s: %w", previousBlockhash.Hex(), err) + } + + previousSpecVersion := uint32(previousRuntimeVersion.SpecVersion) + + // if the previous spec version is different from the current specVersion, we fetch the metadata and then we store the metadata + if specVersion != previousSpecVersion { + runtimeVersion, err := client.state.GetRuntimeVersion(blockHash) + if err != nil { + return nil, fmt.Errorf("failed to get runtime version at block hash %s: %w", blockHash.Hex(), err) + } + + specVersion = uint32(runtimeVersion.SpecVersion) + err = cclient.CallWithBlockHash(client.client.Client, &metadata, "state_getMetadata", &blockHash) + if err != nil { + return nil, err + } + } + + fetchedBlockData.previousSpecVerion = previousSpecVersion + fetchedBlockData.specVersion = specVersion + fetchedBlockData.metadata = []byte(metadata) } return fetchedBlockData, nil @@ -150,7 +183,7 @@ func convertBlock(data *FetchedBlockData) (*pbbstream.Block, error) { block := &pbgear.Block{ Number: uint64(b.Block.Header.Number), Hash: blockHash.Hex(), - Header: convertHeader(b), + Header: convertHeader(data), Extrinsics: convertExtrinsics(b.Block.Extrinsics), Events: convertedEvents, DigestItems: convertLogs(b.Block.Header.Digest), @@ -195,12 +228,21 @@ func convertBlock(data *FetchedBlockData) (*pbbstream.Block, error) { return bstreamBlock, nil } -func convertHeader(b *types.SignedBlock) *pbgear.Header { - return &pbgear.Header{ - ParentHash: b.Block.Header.ParentHash.Hex(), - StateRoot: b.Block.Header.StateRoot.Hex(), - ExtrinsicsRoot: b.Block.Header.ExtrinsicsRoot.Hex(), +func convertHeader(fetchedBlockData *FetchedBlockData) *pbgear.Header { + h := &pbgear.Header{ + ParentHash: fetchedBlockData.block.Block.Header.ParentHash.Hex(), + StateRoot: fetchedBlockData.block.Block.Header.StateRoot.Hex(), + ExtrinsicsRoot: fetchedBlockData.block.Block.Header.ExtrinsicsRoot.Hex(), + SpecVersion: specVersion, } + + // set the metadata if the previous spec version is different from the current spec version + // this means that the metadata has been updated + if fetchedBlockData.previousSpecVerion != fetchedBlockData.specVersion { + h.UpdatedMetadata = []byte(fetchedBlockData.metadata) + } + + return h } func convertLogs(digestItems []types.DigestItem) []*pbgear.DigestItem {