From 9853f67cf6a7265e61ba36186a943cbbc031df6a Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 31 May 2024 13:29:28 +0200 Subject: [PATCH 01/12] chore: self-review improvements --- x/shared/keeper/msg_server_update_param_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/shared/keeper/msg_server_update_param_test.go b/x/shared/keeper/msg_server_update_param_test.go index df1646ade..a21efd427 100644 --- a/x/shared/keeper/msg_server_update_param_test.go +++ b/x/shared/keeper/msg_server_update_param_test.go @@ -110,7 +110,7 @@ func TestMsgUpdateParam_UpdateProofWindowOpenOffsetBlocks(t *testing.T) { // Ensure the default values are different from the new values we want to set require.NotEqual(t, uint64(expectedProofWindowOpenOffestBlocks), defaultParams.ProofWindowOpenOffsetBlocks) - // Update the claim window close offset blocks param + // Update the proof window open offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamProofWindowOpenOffsetBlocks, From 565c50472154de0051ac12392d0569ef558ca144 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Fri, 31 May 2024 14:48:52 +0200 Subject: [PATCH 02/12] Empty commit From 8d439413d1d1944cfeec05ff696b4e47a2f0ee49 Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 3 Jun 2024 10:51:35 +0200 Subject: [PATCH 03/12] [Claim/proof] feat: add `claim_window_open_offset_blocks` shared module param (#561) Co-authored-by: Daniel Olshansky --- Makefile | 4 + api/poktroll/shared/params.pulsar.go | 108 ++++++++++++++---- config.yml | 1 + e2e/tests/parse_params_test.go | 2 + e2e/tests/update_params.feature | 6 +- e2e/tests/update_params_test.go | 18 ++- proto/poktroll/shared/params.proto | 4 + tools/scripts/params/shared_all.json | 3 +- ...hared_claim_window_open_offset_blocks.json | 12 ++ x/shared/keeper/msg_server_update_param.go | 12 ++ .../keeper/msg_server_update_param_test.go | 34 +++++- x/shared/types/message_update_param.go | 5 +- x/shared/types/params.go | 34 +++++- x/shared/types/params.pb.go | 67 ++++++++--- x/shared/types/params_test.go | 30 +++++ 15 files changed, 287 insertions(+), 53 deletions(-) create mode 100644 tools/scripts/params/shared_claim_window_open_offset_blocks.json diff --git a/Makefile b/Makefile index 0dd79ed99..5736ff63b 100644 --- a/Makefile +++ b/Makefile @@ -846,6 +846,10 @@ params_update_shared_all: ## Update the session module params params_update_shared_num_blocks_per_session: ## Update the shared module params poktrolld tx authz exec ./tools/scripts/params/shared_num_blocks_per_session.json $(PARAM_FLAGS) +.PHONY: params_update_shared_claim_window_open_offset_blocks +params_update_shared_claim_window_open_offset_blocks: ## Update the shared module params + poktrolld tx authz exec ./tools/scripts/params/shared_claim_window_open_offset_blocks.json $(PARAM_FLAGS) + .PHONY: params_query_all params_query_all: check_jq ## Query the params from all available modules @for module in $(MODULES); do \ diff --git a/api/poktroll/shared/params.pulsar.go b/api/poktroll/shared/params.pulsar.go index bf24f26b3..d7db9139c 100644 --- a/api/poktroll/shared/params.pulsar.go +++ b/api/poktroll/shared/params.pulsar.go @@ -15,14 +15,16 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor - fd_Params_num_blocks_per_session protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_num_blocks_per_session protoreflect.FieldDescriptor + fd_Params_claim_window_open_offset_blocks protoreflect.FieldDescriptor ) func init() { file_poktroll_shared_params_proto_init() md_Params = File_poktroll_shared_params_proto.Messages().ByName("Params") fd_Params_num_blocks_per_session = md_Params.Fields().ByName("num_blocks_per_session") + fd_Params_claim_window_open_offset_blocks = md_Params.Fields().ByName("claim_window_open_offset_blocks") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -96,6 +98,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ClaimWindowOpenOffsetBlocks != uint64(0) { + value := protoreflect.ValueOfUint64(x.ClaimWindowOpenOffsetBlocks) + if !f(fd_Params_claim_window_open_offset_blocks, value) { + return + } + } } // Has reports whether a field is populated. @@ -113,6 +121,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "poktroll.shared.Params.num_blocks_per_session": return x.NumBlocksPerSession != uint64(0) + case "poktroll.shared.Params.claim_window_open_offset_blocks": + return x.ClaimWindowOpenOffsetBlocks != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -131,6 +141,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "poktroll.shared.Params.num_blocks_per_session": x.NumBlocksPerSession = uint64(0) + case "poktroll.shared.Params.claim_window_open_offset_blocks": + x.ClaimWindowOpenOffsetBlocks = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -150,6 +162,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "poktroll.shared.Params.num_blocks_per_session": value := x.NumBlocksPerSession return protoreflect.ValueOfUint64(value) + case "poktroll.shared.Params.claim_window_open_offset_blocks": + value := x.ClaimWindowOpenOffsetBlocks + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -172,6 +187,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { case "poktroll.shared.Params.num_blocks_per_session": x.NumBlocksPerSession = value.Uint() + case "poktroll.shared.Params.claim_window_open_offset_blocks": + x.ClaimWindowOpenOffsetBlocks = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -194,6 +211,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { case "poktroll.shared.Params.num_blocks_per_session": panic(fmt.Errorf("field num_blocks_per_session of message poktroll.shared.Params is not mutable")) + case "poktroll.shared.Params.claim_window_open_offset_blocks": + panic(fmt.Errorf("field claim_window_open_offset_blocks of message poktroll.shared.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -209,6 +228,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { case "poktroll.shared.Params.num_blocks_per_session": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.shared.Params.claim_window_open_offset_blocks": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -281,6 +302,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.NumBlocksPerSession != 0 { n += 1 + runtime.Sov(uint64(x.NumBlocksPerSession)) } + if x.ClaimWindowOpenOffsetBlocks != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimWindowOpenOffsetBlocks)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -310,6 +334,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ClaimWindowOpenOffsetBlocks != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimWindowOpenOffsetBlocks)) + i-- + dAtA[i] = 0x10 + } if x.NumBlocksPerSession != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.NumBlocksPerSession)) i-- @@ -383,6 +412,25 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowOpenOffsetBlocks", wireType) + } + x.ClaimWindowOpenOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ClaimWindowOpenOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -437,7 +485,8 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session,omitempty"` + NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session,omitempty"` + ClaimWindowOpenOffsetBlocks uint64 `protobuf:"varint,2,opt,name=claim_window_open_offset_blocks,json=claimWindowOpenOffsetBlocks,proto3" json:"claim_window_open_offset_blocks,omitempty"` } func (x *Params) Reset() { @@ -467,6 +516,13 @@ func (x *Params) GetNumBlocksPerSession() uint64 { return 0 } +func (x *Params) GetClaimWindowOpenOffsetBlocks() uint64 { + if x != nil { + return x.ClaimWindowOpenOffsetBlocks + } + return 0 +} + var File_poktroll_shared_params_proto protoreflect.FileDescriptor var file_poktroll_shared_params_proto_rawDesc = []byte{ @@ -475,26 +531,32 @@ var file_poktroll_shared_params_proto_rawDesc = []byte{ 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x7c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, - 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x1a, 0xea, 0xde, 0x1f, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x6e, 0x75, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x3a, 0x21, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0xa1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, - 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0b, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, - 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x04, 0x42, 0x1a, 0xea, 0xde, 0x1f, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x13, 0x6e, 0x75, 0x6d, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x50, 0x65, 0x72, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x69, 0x0a, 0x1f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x77, 0x69, + 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x23, 0xea, + 0xde, 0x1f, 0x1f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, + 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x73, 0x52, 0x1b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4f, + 0x70, 0x65, 0x6e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x3a, + 0x21, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0xa1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, + 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, + 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/config.yml b/config.yml index a967662a4..367897b9b 100644 --- a/config.yml +++ b/config.yml @@ -186,3 +186,4 @@ genesis: shared: params: num_blocks_per_session: 4 + claim_window_open_offset_blocks: 0 diff --git a/e2e/tests/parse_params_test.go b/e2e/tests/parse_params_test.go index e4c497931..ea74b4d26 100644 --- a/e2e/tests/parse_params_test.go +++ b/e2e/tests/parse_params_test.go @@ -142,6 +142,8 @@ func (s *suite) newSharedMsgUpdateParams(params paramsMap) cosmostypes.Msg { switch paramName { case sharedtypes.ParamNumBlocksPerSession: msgUpdateParams.Params.NumBlocksPerSession = uint64(paramValue.value.(int64)) + case sharedtypes.ParamClaimWindowOpenOffsetBlocks: + msgUpdateParams.Params.ClaimWindowOpenOffsetBlocks = uint64(paramValue.value.(int64)) default: s.Fatalf("unexpected %q type param name %q", paramValue.typeStr, paramName) } diff --git a/e2e/tests/update_params.feature b/e2e/tests/update_params.feature index 2d66d03eb..4230e7e1d 100644 --- a/e2e/tests/update_params.feature +++ b/e2e/tests/update_params.feature @@ -41,8 +41,9 @@ Feature: Params Namespace And all "shared" module params are set to their default values And an authz grant from the "gov" "module" account to the "pnf" "user" account for the "/poktroll.shared.MsgUpdateParams" message exists When the "pnf" account sends an authz exec message to update all "shared" module params - | name | value | type | - | num_blocks_per_session | 10 | int64 | + | name | value | type | + | num_blocks_per_session | 8 | int64 | + | claim_window_open_offset_blocks | 8 | int64 | Then all "shared" module params should be updated # NB: If you are reading this and any module has parameters that @@ -61,6 +62,7 @@ Feature: Params Namespace | tokenomics | /poktroll.tokenomics.MsgUpdateParam | compute_units_to_tokens_multiplier | 68 | int64 | | proof | /poktroll.proof.MsgUpdateParam | min_relay_difficulty_bits | 12 | int64 | | shared | /poktroll.shared.MsgUpdateParam | num_blocks_per_session | 8 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | claim_window_open_offset_blocks | 8 | int64 | Scenario: An unauthorized user cannot update individual module params Given the user has the pocketd binary installed diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index 8bde266a6..be4fb657f 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -321,13 +321,23 @@ func (s *suite) assertExpectedModuleParamsUpdated(moduleName string) { }, ) case sharedtypes.ModuleName: - numBlocksPerSession := uint64(s.expectedModuleParams[moduleName][sharedtypes.ParamNumBlocksPerSession].value.(int64)) + params := sharedtypes.DefaultParams() + paramsMap := s.expectedModuleParams[moduleName] + + numBlocksPerSessionParam, ok := paramsMap[sharedtypes.ParamNumBlocksPerSession] + if ok { + params.NumBlocksPerSession = uint64(numBlocksPerSessionParam.value.(int64)) + } + + claimWindowOpenOffsetBlocksParam, ok := paramsMap[sharedtypes.ParamClaimWindowOpenOffsetBlocks] + if ok { + params.ClaimWindowOpenOffsetBlocks = uint64(claimWindowOpenOffsetBlocksParam.value.(int64)) + } + assertUpdatedParams(s, []byte(res.Stdout), &sharedtypes.QueryParamsResponse{ - Params: sharedtypes.Params{ - NumBlocksPerSession: numBlocksPerSession, - }, + Params: params, }, ) case apptypes.ModuleName: diff --git a/proto/poktroll/shared/params.proto b/proto/poktroll/shared/params.proto index adeb68749..f47b1d33c 100644 --- a/proto/poktroll/shared/params.proto +++ b/proto/poktroll/shared/params.proto @@ -11,5 +11,9 @@ message Params { option (amino.name) = "poktroll/x/shared/Params"; option (gogoproto.equal) = true; + // num_blocks_per_session is the number of blocks between the session start & end heights. uint64 num_blocks_per_session = 1 [(gogoproto.jsontag) = "num_blocks_per_session"]; + // claim_window_open_offset_blocks is the number of blocks after the session grace + // period height, at which the claim window opens. + uint64 claim_window_open_offset_blocks = 2 [(gogoproto.jsontag) = "claim_window_open_offset_blocks"]; } \ No newline at end of file diff --git a/tools/scripts/params/shared_all.json b/tools/scripts/params/shared_all.json index 72502f45d..d2bb0f41f 100644 --- a/tools/scripts/params/shared_all.json +++ b/tools/scripts/params/shared_all.json @@ -5,7 +5,8 @@ "@type": "/poktroll.shared.MsgUpdateParams", "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", "params": { - "num_blocks_per_session": "4" + "num_blocks_per_session": "4", + "claim_window_open_offset_blocks": "0", } } ] diff --git a/tools/scripts/params/shared_claim_window_open_offset_blocks.json b/tools/scripts/params/shared_claim_window_open_offset_blocks.json new file mode 100644 index 000000000..7852a222d --- /dev/null +++ b/tools/scripts/params/shared_claim_window_open_offset_blocks.json @@ -0,0 +1,12 @@ +{ + "body": { + "messages": [ + { + "@type": "/poktroll.shared.MsgUpdateParam", + "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", + "name": "claim_window_open_offset_blocks", + "as_int64": "0" + } + ] + } +} diff --git a/x/shared/keeper/msg_server_update_param.go b/x/shared/keeper/msg_server_update_param.go index 4768527cc..34a971c76 100644 --- a/x/shared/keeper/msg_server_update_param.go +++ b/x/shared/keeper/msg_server_update_param.go @@ -30,6 +30,18 @@ func (k msgServer) UpdateParam(ctx context.Context, msg *types.MsgUpdateParam) ( } params.NumBlocksPerSession = numBlocksPerSession + case types.ParamClaimWindowOpenOffsetBlocks: + value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) + if !ok { + return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) + } + claimWindowOpenOffsetBlocks := uint64(value.AsInt64) + + if err := types.ValidateClaimWindowOpenOffsetBlocks(claimWindowOpenOffsetBlocks); err != nil { + return nil, err + } + + params.ClaimWindowOpenOffsetBlocks = claimWindowOpenOffsetBlocks default: return nil, types.ErrSharedParamInvalid.Wrapf("unsupported param %q", msg.Name) } diff --git a/x/shared/keeper/msg_server_update_param_test.go b/x/shared/keeper/msg_server_update_param_test.go index 65702fd45..8b32866f7 100644 --- a/x/shared/keeper/msg_server_update_param_test.go +++ b/x/shared/keeper/msg_server_update_param_test.go @@ -26,7 +26,7 @@ func TestMsgUpdateParam_UpdateNumBlocksPerSession(t *testing.T) { // Ensure the default values are different from the new values we want to set require.NotEqual(t, uint64(expectedNumBlocksPerSession), defaultParams.NumBlocksPerSession) - // Update the min relay difficulty bits + // Update the number of blocks per session updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamNumBlocksPerSession, @@ -37,6 +37,34 @@ func TestMsgUpdateParam_UpdateNumBlocksPerSession(t *testing.T) { require.Equal(t, uint64(expectedNumBlocksPerSession), res.Params.NumBlocksPerSession) - // TODO_BLOCKER: once we have more than one param per module, add assertions - // here which ensure that other params were not changed! + // Ensure the other parameters are unchanged + require.Equal(t, defaultParams.ClaimWindowOpenOffsetBlocks, res.Params.ClaimWindowOpenOffsetBlocks) +} + +func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { + var expectedClaimWindowOpenOffestBlocks int64 = 4 + + k, ctx := keepertest.SharedKeeper(t) + msgSrv := keeper.NewMsgServerImpl(k) + + // Set the parameters to their default values + defaultParams := sharedtypes.DefaultParams() + require.NoError(t, k.SetParams(ctx, defaultParams)) + + // Ensure the default values are different from the new values we want to set + require.NotEqual(t, uint64(expectedClaimWindowOpenOffestBlocks), defaultParams.ClaimWindowOpenOffsetBlocks) + + // Update the claim window open offset blocks + updateParamMsg := &sharedtypes.MsgUpdateParam{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + Name: sharedtypes.ParamClaimWindowOpenOffsetBlocks, + AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedClaimWindowOpenOffestBlocks}, + } + res, err := msgSrv.UpdateParam(ctx, updateParamMsg) + require.NoError(t, err) + + require.Equal(t, uint64(expectedClaimWindowOpenOffestBlocks), res.Params.ClaimWindowOpenOffsetBlocks) + + // Ensure the other parameters are unchanged + require.Equal(t, defaultParams.NumBlocksPerSession, res.Params.NumBlocksPerSession) } diff --git a/x/shared/types/message_update_param.go b/x/shared/types/message_update_param.go index 3cb9b8f2e..4a94ac9b9 100644 --- a/x/shared/types/message_update_param.go +++ b/x/shared/types/message_update_param.go @@ -47,10 +47,11 @@ func (msg *MsgUpdateParam) ValidateBasic() error { // Parameter name must be supported by this module. switch msg.Name { - case ParamNumBlocksPerSession: + case ParamNumBlocksPerSession, + ParamClaimWindowOpenOffsetBlocks: return msg.paramTypeIsInt64() default: - return ErrSharedParamNameInvalid.Wrapf("unsupported name param %q", msg.Name) + return ErrSharedParamNameInvalid.Wrapf("unsupported param %q", msg.Name) } } diff --git a/x/shared/types/params.go b/x/shared/types/params.go index 9cfcf5bd5..ce668d9e6 100644 --- a/x/shared/types/params.go +++ b/x/shared/types/params.go @@ -5,13 +5,16 @@ import ( ) const ( - DefaultNumBlocksPerSession = 4 - ParamNumBlocksPerSession = "num_blocks_per_session" + DefaultNumBlocksPerSession = 4 + ParamNumBlocksPerSession = "num_blocks_per_session" + DefaultClaimWindowOpenOffsetBlocks = 0 + ParamClaimWindowOpenOffsetBlocks = "claim_window_open_offset_blocks" ) var ( - _ paramtypes.ParamSet = (*Params)(nil) - KeyNumBlocksPerSession = []byte("NumBlocksPerSession") + _ paramtypes.ParamSet = (*Params)(nil) + KeyNumBlocksPerSession = []byte("NumBlocksPerSession") + KeyClaimWindowOpenOffsetBlocks = []byte("ClaimWindowOpenOffsetBlocks") ) // ParamKeyTable the param key table for launch module @@ -22,7 +25,8 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams() Params { return Params{ - NumBlocksPerSession: DefaultNumBlocksPerSession, + NumBlocksPerSession: DefaultNumBlocksPerSession, + ClaimWindowOpenOffsetBlocks: DefaultClaimWindowOpenOffsetBlocks, } } @@ -39,6 +43,11 @@ func (params *Params) ParamSetPairs() paramtypes.ParamSetPairs { ¶ms.NumBlocksPerSession, ValidateNumBlocksPerSession, ), + paramtypes.NewParamSetPair( + KeyClaimWindowOpenOffsetBlocks, + ¶ms.ClaimWindowOpenOffsetBlocks, + ValidateClaimWindowOpenOffsetBlocks, + ), } } @@ -48,6 +57,10 @@ func (params *Params) ValidateBasic() error { return err } + if err := ValidateClaimWindowOpenOffsetBlocks(params.ClaimWindowOpenOffsetBlocks); err != nil { + return err + } + return nil } @@ -65,3 +78,14 @@ func ValidateNumBlocksPerSession(v interface{}) error { return nil } + +// ValidateClaimWindowOpenOffsetBlocks validates the ClaimWindowOpenOffsetBlocks param +// NB: The argument is an interface type to satisfy the ParamSetPair function signature. +func ValidateClaimWindowOpenOffsetBlocks(v interface{}) error { + _, ok := v.(uint64) + if !ok { + return ErrSharedParamInvalid.Wrapf("invalid parameter type: %T", v) + } + + return nil +} diff --git a/x/shared/types/params.pb.go b/x/shared/types/params.pb.go index 0929cac08..60d117f1c 100644 --- a/x/shared/types/params.pb.go +++ b/x/shared/types/params.pb.go @@ -26,7 +26,8 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session"` + NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session"` + ClaimWindowOpenOffsetBlocks uint64 `protobuf:"varint,2,opt,name=claim_window_open_offset_blocks,json=claimWindowOpenOffsetBlocks,proto3" json:"claim_window_open_offset_blocks"` } func (m *Params) Reset() { *m = Params{} } @@ -69,6 +70,13 @@ func (m *Params) GetNumBlocksPerSession() uint64 { return 0 } +func (m *Params) GetClaimWindowOpenOffsetBlocks() uint64 { + if m != nil { + return m.ClaimWindowOpenOffsetBlocks + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "poktroll.shared.Params") } @@ -76,22 +84,25 @@ func init() { func init() { proto.RegisterFile("poktroll/shared/params.proto", fileDescriptor_ee6189c7aa51bbf5) } var fileDescriptor_ee6189c7aa51bbf5 = []byte{ - // 228 bytes of a gzipped FileDescriptorProto + // 287 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0xd1, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0xc9, 0xea, 0x41, 0x64, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, - 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x6a, 0xb8, 0xd8, 0x02, 0xc0, 0x26, 0x09, 0xf9, - 0x73, 0x89, 0xe5, 0x95, 0xe6, 0xc6, 0x27, 0xe5, 0xe4, 0x27, 0x67, 0x17, 0xc7, 0x17, 0xa4, 0x16, - 0xc5, 0x17, 0xa7, 0x16, 0x17, 0x67, 0xe6, 0xe7, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x38, 0x49, - 0xbd, 0xba, 0x27, 0x8f, 0x43, 0x45, 0x90, 0x70, 0x5e, 0x69, 0xae, 0x13, 0x58, 0x38, 0x20, 0xb5, - 0x28, 0x18, 0x22, 0x68, 0xa5, 0xf8, 0x62, 0x81, 0x3c, 0x63, 0xd7, 0xf3, 0x0d, 0x5a, 0x12, 0x70, - 0xb7, 0x57, 0xc0, 0x5c, 0x0f, 0xb1, 0xd3, 0xc9, 0xf3, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, - 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, - 0xe5, 0x18, 0xa2, 0xf4, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, - 0xda, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0xf5, 0x31, 0xcd, 0x2a, 0xa9, 0x2c, 0x48, - 0x2d, 0x4e, 0x62, 0x03, 0xfb, 0xc7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x43, 0x33, 0xe9, 0x1c, - 0x29, 0x01, 0x00, 0x00, + 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x9e, 0x33, 0x72, 0xb1, 0x05, 0x80, 0x8d, 0x12, + 0xf2, 0xe7, 0x12, 0xcb, 0x2b, 0xcd, 0x8d, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x2e, 0x8e, 0x2f, 0x48, + 0x2d, 0x8a, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0x93, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x71, + 0x92, 0x7a, 0x75, 0x4f, 0x1e, 0x87, 0x8a, 0x20, 0xe1, 0xbc, 0xd2, 0x5c, 0x27, 0xb0, 0x70, 0x40, + 0x6a, 0x51, 0x30, 0x44, 0x50, 0x28, 0x93, 0x4b, 0x3e, 0x39, 0x27, 0x31, 0x33, 0x37, 0xbe, 0x3c, + 0x33, 0x2f, 0x25, 0xbf, 0x3c, 0x3e, 0xbf, 0x20, 0x35, 0x2f, 0x3e, 0x3f, 0x2d, 0xad, 0x38, 0xb5, + 0x04, 0x6a, 0x86, 0x04, 0x13, 0xd8, 0x64, 0xe5, 0x57, 0xf7, 0xe4, 0x09, 0x29, 0x0d, 0x92, 0x06, + 0x2b, 0x08, 0x07, 0xcb, 0xfb, 0x17, 0xa4, 0xe6, 0xf9, 0x83, 0x65, 0x21, 0x96, 0x5a, 0x29, 0xbe, + 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x04, 0x3c, 0x9c, 0x2a, 0x60, 0x21, 0x05, 0xf1, + 0x9e, 0x93, 0xe7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, + 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa7, 0x67, + 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0xb4, 0xeb, 0xe6, 0xa5, 0x96, 0x94, + 0xe7, 0x17, 0x65, 0xeb, 0x63, 0x9a, 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x3b, + 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x51, 0x62, 0xe7, 0x95, 0x01, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -116,6 +127,9 @@ func (this *Params) Equal(that interface{}) bool { if this.NumBlocksPerSession != that1.NumBlocksPerSession { return false } + if this.ClaimWindowOpenOffsetBlocks != that1.ClaimWindowOpenOffsetBlocks { + return false + } return true } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -138,6 +152,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ClaimWindowOpenOffsetBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ClaimWindowOpenOffsetBlocks)) + i-- + dAtA[i] = 0x10 + } if m.NumBlocksPerSession != 0 { i = encodeVarintParams(dAtA, i, uint64(m.NumBlocksPerSession)) i-- @@ -166,6 +185,9 @@ func (m *Params) Size() (n int) { if m.NumBlocksPerSession != 0 { n += 1 + sovParams(uint64(m.NumBlocksPerSession)) } + if m.ClaimWindowOpenOffsetBlocks != 0 { + n += 1 + sovParams(uint64(m.ClaimWindowOpenOffsetBlocks)) + } return n } @@ -223,6 +245,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowOpenOffsetBlocks", wireType) + } + m.ClaimWindowOpenOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimWindowOpenOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/shared/types/params_test.go b/x/shared/types/params_test.go index a2611b04a..f64cc33af 100644 --- a/x/shared/types/params_test.go +++ b/x/shared/types/params_test.go @@ -40,3 +40,33 @@ func TestParams_ValidateNumBlocksPerSession(t *testing.T) { }) } } + +func TestParams_ValidateClaimWindowOpenOffsetBlocks(t *testing.T) { + tests := []struct { + desc string + claimWindowOpenOffsetBlocks any + err error + }{ + { + desc: "invalid type", + claimWindowOpenOffsetBlocks: "invalid", + err: ErrSharedParamInvalid.Wrapf("invalid parameter type: %T", "invalid"), + }, + { + desc: "valid ClaimWindowOpenOffsetBlocks", + claimWindowOpenOffsetBlocks: uint64(4), + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + err := ValidateClaimWindowOpenOffsetBlocks(tt.claimWindowOpenOffsetBlocks) + if tt.err != nil { + require.Error(t, err) + require.Contains(t, err.Error(), tt.err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} From 45314cdd99715bc6e5b8e4a853d6afe8ed5bed5b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 3 Jun 2024 11:31:08 +0200 Subject: [PATCH 04/12] [Relayminer] refactor: relayminer to use `claim_window_open_offset_blocks` shared param (#565) Co-authored-by: Daniel Olshansky --- Makefile | 4 + api/poktroll/shared/params.pulsar.go | 106 ++++++++++++++---- config.yml | 1 + e2e/tests/parse_params_test.go | 2 + e2e/tests/update_params.feature | 2 + e2e/tests/update_params_test.go | 5 + pkg/client/interface.go | 3 + pkg/client/query/sharedquerier.go | 17 +++ pkg/relayer/protocol/block_heights.go | 2 +- pkg/relayer/session/claim.go | 35 +++--- pkg/relayer/session/session_test.go | 13 ++- proto/poktroll/shared/params.proto | 3 + .../testqueryclients/sharedquerier.go | 18 ++- tools/scripts/params/shared_all.json | 1 + ...ared_claim_window_close_offset_blocks.json | 12 ++ x/proof/types/message_update_param.go | 2 +- x/proof/types/shared_query_client.go | 17 +++ x/shared/keeper/msg_server_update_param.go | 12 ++ .../keeper/msg_server_update_param_test.go | 30 ++++- x/shared/session.go | 12 ++ x/shared/types/message_update_param.go | 3 +- x/shared/types/params.go | 42 +++++-- x/shared/types/params.pb.go | 65 +++++++++-- x/shared/types/params_test.go | 30 +++++ x/tokenomics/types/message_update_param.go | 2 +- 25 files changed, 373 insertions(+), 66 deletions(-) create mode 100644 tools/scripts/params/shared_claim_window_close_offset_blocks.json diff --git a/Makefile b/Makefile index 5736ff63b..7118e17b8 100644 --- a/Makefile +++ b/Makefile @@ -850,6 +850,10 @@ params_update_shared_num_blocks_per_session: ## Update the shared module params params_update_shared_claim_window_open_offset_blocks: ## Update the shared module params poktrolld tx authz exec ./tools/scripts/params/shared_claim_window_open_offset_blocks.json $(PARAM_FLAGS) +.PHONY: params_update_shared_claim_window_close_offset_blocks +params_update_shared_claim_window_close_offset_blocks: ## Update the shared module params + poktrolld tx authz exec ./tools/scripts/params/shared_claim_window_close_offset_blocks.json $(PARAM_FLAGS) + .PHONY: params_query_all params_query_all: check_jq ## Query the params from all available modules @for module in $(MODULES); do \ diff --git a/api/poktroll/shared/params.pulsar.go b/api/poktroll/shared/params.pulsar.go index d7db9139c..41346dd31 100644 --- a/api/poktroll/shared/params.pulsar.go +++ b/api/poktroll/shared/params.pulsar.go @@ -15,9 +15,10 @@ import ( ) var ( - md_Params protoreflect.MessageDescriptor - fd_Params_num_blocks_per_session protoreflect.FieldDescriptor - fd_Params_claim_window_open_offset_blocks protoreflect.FieldDescriptor + md_Params protoreflect.MessageDescriptor + fd_Params_num_blocks_per_session protoreflect.FieldDescriptor + fd_Params_claim_window_open_offset_blocks protoreflect.FieldDescriptor + fd_Params_claim_window_close_offset_blocks protoreflect.FieldDescriptor ) func init() { @@ -25,6 +26,7 @@ func init() { md_Params = File_poktroll_shared_params_proto.Messages().ByName("Params") fd_Params_num_blocks_per_session = md_Params.Fields().ByName("num_blocks_per_session") fd_Params_claim_window_open_offset_blocks = md_Params.Fields().ByName("claim_window_open_offset_blocks") + fd_Params_claim_window_close_offset_blocks = md_Params.Fields().ByName("claim_window_close_offset_blocks") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -104,6 +106,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ClaimWindowCloseOffsetBlocks != uint64(0) { + value := protoreflect.ValueOfUint64(x.ClaimWindowCloseOffsetBlocks) + if !f(fd_Params_claim_window_close_offset_blocks, value) { + return + } + } } // Has reports whether a field is populated. @@ -123,6 +131,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.NumBlocksPerSession != uint64(0) case "poktroll.shared.Params.claim_window_open_offset_blocks": return x.ClaimWindowOpenOffsetBlocks != uint64(0) + case "poktroll.shared.Params.claim_window_close_offset_blocks": + return x.ClaimWindowCloseOffsetBlocks != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -143,6 +153,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.NumBlocksPerSession = uint64(0) case "poktroll.shared.Params.claim_window_open_offset_blocks": x.ClaimWindowOpenOffsetBlocks = uint64(0) + case "poktroll.shared.Params.claim_window_close_offset_blocks": + x.ClaimWindowCloseOffsetBlocks = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -165,6 +177,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "poktroll.shared.Params.claim_window_open_offset_blocks": value := x.ClaimWindowOpenOffsetBlocks return protoreflect.ValueOfUint64(value) + case "poktroll.shared.Params.claim_window_close_offset_blocks": + value := x.ClaimWindowCloseOffsetBlocks + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -189,6 +204,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.NumBlocksPerSession = value.Uint() case "poktroll.shared.Params.claim_window_open_offset_blocks": x.ClaimWindowOpenOffsetBlocks = value.Uint() + case "poktroll.shared.Params.claim_window_close_offset_blocks": + x.ClaimWindowCloseOffsetBlocks = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -213,6 +230,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field num_blocks_per_session of message poktroll.shared.Params is not mutable")) case "poktroll.shared.Params.claim_window_open_offset_blocks": panic(fmt.Errorf("field claim_window_open_offset_blocks of message poktroll.shared.Params is not mutable")) + case "poktroll.shared.Params.claim_window_close_offset_blocks": + panic(fmt.Errorf("field claim_window_close_offset_blocks of message poktroll.shared.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -230,6 +249,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.shared.Params.claim_window_open_offset_blocks": return protoreflect.ValueOfUint64(uint64(0)) + case "poktroll.shared.Params.claim_window_close_offset_blocks": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.shared.Params")) @@ -305,6 +326,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.ClaimWindowOpenOffsetBlocks != 0 { n += 1 + runtime.Sov(uint64(x.ClaimWindowOpenOffsetBlocks)) } + if x.ClaimWindowCloseOffsetBlocks != 0 { + n += 1 + runtime.Sov(uint64(x.ClaimWindowCloseOffsetBlocks)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -334,6 +358,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.ClaimWindowCloseOffsetBlocks != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimWindowCloseOffsetBlocks)) + i-- + dAtA[i] = 0x18 + } if x.ClaimWindowOpenOffsetBlocks != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ClaimWindowOpenOffsetBlocks)) i-- @@ -431,6 +460,25 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowCloseOffsetBlocks", wireType) + } + x.ClaimWindowCloseOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.ClaimWindowCloseOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -485,8 +533,14 @@ type Params struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session,omitempty"` + // num_blocks_per_session is the number of blocks between the session start & end heights. + NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session,omitempty"` + // claim_window_open_offset_blocks is the number of blocks after the session grace + // period height, at which the claim window opens. ClaimWindowOpenOffsetBlocks uint64 `protobuf:"varint,2,opt,name=claim_window_open_offset_blocks,json=claimWindowOpenOffsetBlocks,proto3" json:"claim_window_open_offset_blocks,omitempty"` + // claim_window_close_offset_blocks is the number of blocks after the claim window + // open height, at which the claim window closes. + ClaimWindowCloseOffsetBlocks uint64 `protobuf:"varint,3,opt,name=claim_window_close_offset_blocks,json=claimWindowCloseOffsetBlocks,proto3" json:"claim_window_close_offset_blocks,omitempty"` } func (x *Params) Reset() { @@ -523,6 +577,13 @@ func (x *Params) GetClaimWindowOpenOffsetBlocks() uint64 { return 0 } +func (x *Params) GetClaimWindowCloseOffsetBlocks() uint64 { + if x != nil { + return x.ClaimWindowCloseOffsetBlocks + } + return 0 +} + var File_poktroll_shared_params_proto protoreflect.FileDescriptor var file_poktroll_shared_params_proto_rawDesc = []byte{ @@ -531,7 +592,7 @@ var file_poktroll_shared_params_proto_rawDesc = []byte{ 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, - 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe7, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, + 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4f, 0x0a, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1a, 0xea, 0xde, 0x1f, 0x16, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x6c, 0x6f, @@ -543,20 +604,27 @@ var file_poktroll_shared_params_proto_rawDesc = []byte{ 0xde, 0x1f, 0x1f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, 0x1b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x4f, - 0x70, 0x65, 0x6e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x3a, - 0x21, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2f, 0x78, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x42, 0xa1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, - 0x6f, 0x6c, 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, - 0x58, 0xaa, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, - 0x72, 0x65, 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, - 0x68, 0x61, 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, - 0x5c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, - 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x65, 0x6e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x12, + 0x6c, 0x0a, 0x20, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, + 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x20, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5f, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x52, + 0x1c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x43, 0x6c, 0x6f, 0x73, + 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x3a, 0x21, 0xe8, + 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x18, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x2f, 0x78, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2f, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0xa1, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, + 0x6c, 0x2e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x42, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2f, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0xa2, 0x02, 0x03, 0x50, 0x53, 0x58, 0xaa, + 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x64, 0xca, 0x02, 0x0f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x64, 0xe2, 0x02, 0x1b, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x64, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x10, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/config.yml b/config.yml index 367897b9b..7cfe4c7ac 100644 --- a/config.yml +++ b/config.yml @@ -187,3 +187,4 @@ genesis: params: num_blocks_per_session: 4 claim_window_open_offset_blocks: 0 + claim_window_close_offset_blocks: 4 diff --git a/e2e/tests/parse_params_test.go b/e2e/tests/parse_params_test.go index ea74b4d26..da5c674bb 100644 --- a/e2e/tests/parse_params_test.go +++ b/e2e/tests/parse_params_test.go @@ -144,6 +144,8 @@ func (s *suite) newSharedMsgUpdateParams(params paramsMap) cosmostypes.Msg { msgUpdateParams.Params.NumBlocksPerSession = uint64(paramValue.value.(int64)) case sharedtypes.ParamClaimWindowOpenOffsetBlocks: msgUpdateParams.Params.ClaimWindowOpenOffsetBlocks = uint64(paramValue.value.(int64)) + case sharedtypes.ParamClaimWindowCloseOffsetBlocks: + msgUpdateParams.Params.ClaimWindowCloseOffsetBlocks = uint64(paramValue.value.(int64)) default: s.Fatalf("unexpected %q type param name %q", paramValue.typeStr, paramName) } diff --git a/e2e/tests/update_params.feature b/e2e/tests/update_params.feature index 4230e7e1d..6277d0215 100644 --- a/e2e/tests/update_params.feature +++ b/e2e/tests/update_params.feature @@ -44,6 +44,7 @@ Feature: Params Namespace | name | value | type | | num_blocks_per_session | 8 | int64 | | claim_window_open_offset_blocks | 8 | int64 | + | claim_window_close_offset_blocks | 8 | int64 | Then all "shared" module params should be updated # NB: If you are reading this and any module has parameters that @@ -63,6 +64,7 @@ Feature: Params Namespace | proof | /poktroll.proof.MsgUpdateParam | min_relay_difficulty_bits | 12 | int64 | | shared | /poktroll.shared.MsgUpdateParam | num_blocks_per_session | 8 | int64 | | shared | /poktroll.shared.MsgUpdateParam | claim_window_open_offset_blocks | 8 | int64 | + | shared | /poktroll.shared.MsgUpdateParam | claim_window_close_offset_blocks | 8 | int64 | Scenario: An unauthorized user cannot update individual module params Given the user has the pocketd binary installed diff --git a/e2e/tests/update_params_test.go b/e2e/tests/update_params_test.go index be4fb657f..c99d1f61b 100644 --- a/e2e/tests/update_params_test.go +++ b/e2e/tests/update_params_test.go @@ -334,6 +334,11 @@ func (s *suite) assertExpectedModuleParamsUpdated(moduleName string) { params.ClaimWindowOpenOffsetBlocks = uint64(claimWindowOpenOffsetBlocksParam.value.(int64)) } + claimWindowCloseOffsetBlocksParam, ok := paramsMap[sharedtypes.ParamClaimWindowCloseOffsetBlocks] + if ok { + params.ClaimWindowCloseOffsetBlocks = uint64(claimWindowCloseOffsetBlocksParam.value.(int64)) + } + assertUpdatedParams(s, []byte(res.Stdout), &sharedtypes.QueryParamsResponse{ diff --git a/pkg/client/interface.go b/pkg/client/interface.go index 0383d22e2..9376cbad7 100644 --- a/pkg/client/interface.go +++ b/pkg/client/interface.go @@ -285,4 +285,7 @@ type SessionQueryClient interface { type SharedQueryClient interface { // GetParams queries the chain for the current shared module parameters. GetParams(ctx context.Context) (*sharedtypes.Params, error) + // GetClaimWindowOpenHeight returns the block height at which the claim window of + // the session that includes queryHeight opens. + GetClaimWindowOpenHeight(ctx context.Context, queryHeight int64) (int64, error) } diff --git a/pkg/client/query/sharedquerier.go b/pkg/client/query/sharedquerier.go index 2c4ac4abb..619bf7ee1 100644 --- a/pkg/client/query/sharedquerier.go +++ b/pkg/client/query/sharedquerier.go @@ -7,6 +7,7 @@ import ( "github.com/cosmos/gogoproto/grpc" "github.com/pokt-network/poktroll/pkg/client" + "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -53,3 +54,19 @@ func (sq *sharedQuerier) GetParams(ctx context.Context) (*sharedtypes.Params, er } return &res.Params, nil } + +// GetClaimWindowOpenHeight returns the block height at which the claim window of +// the session that includes queryHeight opens. +// +// TODO_TECHDEBT(#543): We don't really want to have to query the params for every method call. +// Once `ModuleParamsClient` is implemented, use its replay observable's `#Last()` method +// to get the most recently (asynchronously) observed (and cached) value. +// TODO_BLOCKER(#543): We also don't really want to use the current value of the params. Instead, +// we should be using the value that the params had for the session which includes queryHeight. +func (sq *sharedQuerier) GetClaimWindowOpenHeight(ctx context.Context, queryHeight int64) (int64, error) { + sharedParams, err := sq.GetParams(ctx) + if err != nil { + return 0, err + } + return shared.GetClaimWindowOpenHeight(sharedParams, queryHeight), nil +} diff --git a/pkg/relayer/protocol/block_heights.go b/pkg/relayer/protocol/block_heights.go index 2785ba1f3..3dc658d35 100644 --- a/pkg/relayer/protocol/block_heights.go +++ b/pkg/relayer/protocol/block_heights.go @@ -31,7 +31,7 @@ func GetEarliestCreateClaimHeight(ctx context.Context, createClaimWindowStartBlo rngSeed, _ := binary.Varint(createClaimWindowStartBlockHash) randomNumber := rand.NewSource(rngSeed).Int63() - // TODO_BLOCKER: query the on-chain governance parameter once available. + // TODO_BLOCKER(#402): query the on-chain governance parameter once available. // randCreateClaimHeightOffset := randomNumber % (claimproofparams.GovCreateClaimIntervalBlocks - claimproofparams.GovCreateClaimWindowBlocks - 1) _ = randomNumber randCreateClaimHeightOffset := int64(0) diff --git a/pkg/relayer/session/claim.go b/pkg/relayer/session/claim.go index 1f5761a88..544d7025c 100644 --- a/pkg/relayer/session/claim.go +++ b/pkg/relayer/session/claim.go @@ -11,7 +11,6 @@ import ( "github.com/pokt-network/poktroll/pkg/observable/logging" "github.com/pokt-network/poktroll/pkg/relayer" "github.com/pokt-network/poktroll/pkg/relayer/protocol" - "github.com/pokt-network/poktroll/x/shared" ) // createClaims maps over the sessionsToClaimObs observable. For each claim batch, it: @@ -66,9 +65,14 @@ func (rs *relayerSessionsManager) mapWaitForEarliestCreateClaimsHeight( ctx context.Context, sessionTrees []relayer.SessionTree, ) (_ []relayer.SessionTree, skip bool) { - return rs.waitForEarliestCreateClaimsHeight( + sessionTreesToClaim := rs.waitForEarliestCreateClaimsHeight( ctx, sessionTrees, failedCreateClaimsSessionsPublishCh, - ), false + ) + if sessionTreesToClaim == nil { + return nil, true + } + + return sessionTreesToClaim, false } } @@ -86,25 +90,24 @@ func (rs *relayerSessionsManager) waitForEarliestCreateClaimsHeight( // first one from the group to calculate the earliest height for claim creation. sessionEndHeight := sessionTrees[0].GetSessionHeader().GetSessionEndBlockHeight() - // TODO_TECHDEBT(#516): Centralize the business logic that involves taking - // into account the heights, windows and grace periods into helper functions. - // An additional block is added to permit to relays arriving at the last block - // of the session to be included in the claim before the smt is closed. - sessionGracePeriodEndHeight := shared.GetSessionGracePeriodEndHeight(sessionEndHeight) - createClaimsWindowStartHeight := sessionGracePeriodEndHeight + 1 + createClaimsWindowOpenHeight, err := rs.sharedQueryClient.GetClaimWindowOpenHeight(ctx, sessionEndHeight) + if err != nil { + failSubmitProofsSessionsCh <- sessionTrees + return nil + } // TODO_BLOCKER: query the on-chain governance parameter once available. // + claimproofparams.GovCreateClaimWindowStartHeightOffset - // we wait for createClaimsWindowStartHeight to be received before proceeding since we need its hash + // we wait for createClaimsWindowOpenHeight to be received before proceeding since we need its hash // to know where this servicer's claim submission window starts. rs.logger.Info(). - Int64("create_claim_window_start_height", createClaimsWindowStartHeight). + Int64("create_claim_window_start_height", createClaimsWindowOpenHeight). Msg("waiting & blocking for global earliest claim submission height") // TODO_BLOCKER(@bryanchriswhite): The block that'll be used as a source of entropy for // which branch(es) to prove should be deterministic and use on-chain governance params. - createClaimsWindowStartBlock := rs.waitForBlock(ctx, createClaimsWindowStartHeight) + createClaimsWindowOpenBlock := rs.waitForBlock(ctx, createClaimsWindowOpenHeight) claimsFlushedCh := make(chan []relayer.SessionTree) defer close(claimsFlushedCh) @@ -116,18 +119,18 @@ func (rs *relayerSessionsManager) waitForEarliestCreateClaimsHeight( ) rs.logger.Info(). - Int64("create_claim_window_start_height", createClaimsWindowStartBlock.Height()). - Str("hash", fmt.Sprintf("%x", createClaimsWindowStartBlock.Hash())). + Int64("create_claim_window_open_height", createClaimsWindowOpenBlock.Height()). + Str("hash", fmt.Sprintf("%x", createClaimsWindowOpenBlock.Hash())). Msg("received global earliest claim submission height") earliestCreateClaimHeight := protocol.GetEarliestCreateClaimHeight( ctx, - createClaimsWindowStartBlock, + createClaimsWindowOpenBlock, ) rs.logger.Info(). Int64("earliest_create_claim_height", earliestCreateClaimHeight). - Str("hash", fmt.Sprintf("%x", createClaimsWindowStartBlock.Hash())). + Str("hash", fmt.Sprintf("%x", createClaimsWindowOpenBlock.Hash())). Msg("waiting & blocking for earliest claim creation height for this supplier") _ = rs.waitForBlock(ctx, earliestCreateClaimHeight) diff --git a/pkg/relayer/session/session_test.go b/pkg/relayer/session/session_test.go index 5444bee9d..09e39c26f 100644 --- a/pkg/relayer/session/session_test.go +++ b/pkg/relayer/session/session_test.go @@ -25,6 +25,7 @@ import ( "github.com/pokt-network/poktroll/testutil/testpolylog" "github.com/pokt-network/poktroll/testutil/testrelayer" "github.com/pokt-network/poktroll/x/shared" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) func TestRelayerSessionsManager_Start(t *testing.T) { @@ -104,20 +105,22 @@ func TestRelayerSessionsManager_Start(t *testing.T) { // Calculate the session grace period end block height to emit that block height // to the blockPublishCh to trigger claim creation for the session. - sessionGracePeriodEndBlockHeight := int64(sessionEndHeight + shared.SessionGracePeriodBlocks) + //sessionClaimWindowOpenHeight := int64(sessionEndHeight + shared.SessionGracePeriodBlocks) + sharedParams := sharedtypes.DefaultParams() + sessionClaimWindowOpenHeight := shared.GetClaimWindowOpenHeight(&sharedParams, sessionEndHeight) // Publish a block to the blockPublishCh to trigger claim creation for the session. - // TODO_TECHDEBT: assumes claiming at sessionGracePeriodEndBlockHeight is valid. + // TODO_TECHDEBT(#516): assumes claiming at sessionClaimWindowOpenHeight is valid. // This will likely change in future work. - triggerClaimBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, sessionGracePeriodEndBlockHeight) + triggerClaimBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, sessionClaimWindowOpenHeight) blockPublishCh <- triggerClaimBlock // TODO_IMPROVE: ensure correctness of persisted session trees here. // Publish a block to the blockPublishCh to trigger proof submission for the session. - // TODO_TECHDEBT: assumes proving at sessionGracePeriodEndBlockHeight + 1 is valid. + // TODO_TECHDEBT(#516): assumes proving at sessionClaimWindowOpenHeight + 1 is valid. // This will likely change in future work. - triggerProofBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, sessionGracePeriodEndBlockHeight+1) + triggerProofBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, sessionClaimWindowOpenHeight+1) blockPublishCh <- triggerProofBlock // Wait a tick to allow the relayer sessions manager to process asynchronously. diff --git a/proto/poktroll/shared/params.proto b/proto/poktroll/shared/params.proto index f47b1d33c..80d62e551 100644 --- a/proto/poktroll/shared/params.proto +++ b/proto/poktroll/shared/params.proto @@ -16,4 +16,7 @@ message Params { // claim_window_open_offset_blocks is the number of blocks after the session grace // period height, at which the claim window opens. uint64 claim_window_open_offset_blocks = 2 [(gogoproto.jsontag) = "claim_window_open_offset_blocks"]; + // claim_window_close_offset_blocks is the number of blocks after the claim window + // open height, at which the claim window closes. + uint64 claim_window_close_offset_blocks = 3 [(gogoproto.jsontag) = "claim_window_close_offset_blocks"]; } \ No newline at end of file diff --git a/testutil/testclient/testqueryclients/sharedquerier.go b/testutil/testclient/testqueryclients/sharedquerier.go index 82ffa88f2..fa18cf8b2 100644 --- a/testutil/testclient/testqueryclients/sharedquerier.go +++ b/testutil/testclient/testqueryclients/sharedquerier.go @@ -1,15 +1,18 @@ package testqueryclients import ( + "context" "testing" "github.com/golang/mock/gomock" "github.com/pokt-network/poktroll/testutil/mockclient" + "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) -// NewTestSharedQueryClient creates a mock of the SharedQueryClient. +// NewTestSharedQueryClient creates a mock of the SharedQueryClient which uses the +// default shared module params for its implementation. func NewTestSharedQueryClient( t *testing.T, ) *mockclient.MockSharedQueryClient { @@ -18,9 +21,20 @@ func NewTestSharedQueryClient( sharedQuerier := mockclient.NewMockSharedQueryClient(ctrl) params := sharedtypes.DefaultParams() - sharedQuerier.EXPECT().GetParams(gomock.Any()). + sharedQuerier.EXPECT(). + GetParams(gomock.Any()). Return(¶ms, nil). AnyTimes() + sharedQuerier.EXPECT(). + GetClaimWindowOpenHeight(gomock.Any(), gomock.Any()). + DoAndReturn( + func(ctx context.Context, queryHeight int64) (int64, error) { + sharedParams := sharedtypes.DefaultParams() + return shared.GetClaimWindowOpenHeight(&sharedParams, queryHeight), nil + }, + ). + AnyTimes() + return sharedQuerier } diff --git a/tools/scripts/params/shared_all.json b/tools/scripts/params/shared_all.json index d2bb0f41f..be5d3688d 100644 --- a/tools/scripts/params/shared_all.json +++ b/tools/scripts/params/shared_all.json @@ -7,6 +7,7 @@ "params": { "num_blocks_per_session": "4", "claim_window_open_offset_blocks": "0", + "claim_window_close_offset_blocks": "4" } } ] diff --git a/tools/scripts/params/shared_claim_window_close_offset_blocks.json b/tools/scripts/params/shared_claim_window_close_offset_blocks.json new file mode 100644 index 000000000..dbdbd0a5c --- /dev/null +++ b/tools/scripts/params/shared_claim_window_close_offset_blocks.json @@ -0,0 +1,12 @@ +{ + "body": { + "messages": [ + { + "@type": "/poktroll.shared.MsgUpdateParam", + "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", + "name": "claim_window_close_offset_blocks", + "as_int64": "4" + } + ] + } +} diff --git a/x/proof/types/message_update_param.go b/x/proof/types/message_update_param.go index 4b46e5e07..09812cb8a 100644 --- a/x/proof/types/message_update_param.go +++ b/x/proof/types/message_update_param.go @@ -50,7 +50,7 @@ func (msg *MsgUpdateParam) ValidateBasic() error { case ParamMinRelayDifficultyBits: return msg.paramTypeIsInt64() default: - return ErrProofParamNameInvalid.Wrapf("unsupported name param %q", msg.Name) + return ErrProofParamNameInvalid.Wrapf("unsupported param %q", msg.Name) } } diff --git a/x/proof/types/shared_query_client.go b/x/proof/types/shared_query_client.go index ea2a016a1..b8ee9f233 100644 --- a/x/proof/types/shared_query_client.go +++ b/x/proof/types/shared_query_client.go @@ -4,6 +4,7 @@ import ( "context" "github.com/pokt-network/poktroll/pkg/client" + "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -29,3 +30,19 @@ func (sharedQueryClient *SharedKeeperQueryClient) GetParams( sharedParams := sharedQueryClient.keeper.GetParams(ctx) return &sharedParams, nil } + +// GetClaimWindowOpenHeight returns the block height at which the claim window of +// the session that includes queryHeight opens. +// +// TODO_TECHDEBT(#543): We don't really want to have to query the params for every method call. +// Once `ModuleParamsClient` is implemented, use its replay observable's `#Last()` method +// to get the most recently (asynchronously) observed (and cached) value. +// TODO_BLOCKER(#543): We also don't really want to use the current value of the params. +// Instead, we should be using the value that the params had for the session given by blockHeight. +func (sharedQueryClient *SharedKeeperQueryClient) GetClaimWindowOpenHeight( + ctx context.Context, + queryHeight int64, +) (int64, error) { + sharedParams := sharedQueryClient.keeper.GetParams(ctx) + return shared.GetClaimWindowOpenHeight(&sharedParams, queryHeight), nil +} diff --git a/x/shared/keeper/msg_server_update_param.go b/x/shared/keeper/msg_server_update_param.go index 34a971c76..248f0f98f 100644 --- a/x/shared/keeper/msg_server_update_param.go +++ b/x/shared/keeper/msg_server_update_param.go @@ -42,6 +42,18 @@ func (k msgServer) UpdateParam(ctx context.Context, msg *types.MsgUpdateParam) ( } params.ClaimWindowOpenOffsetBlocks = claimWindowOpenOffsetBlocks + case types.ParamClaimWindowCloseOffsetBlocks: + value, ok := msg.AsType.(*types.MsgUpdateParam_AsInt64) + if !ok { + return nil, types.ErrSharedParamInvalid.Wrapf("unsupported value type for %s param: %T", msg.Name, msg.AsType) + } + claimWindowCloseOffsetBlocks := uint64(value.AsInt64) + + if err := types.ValidateClaimWindowCloseOffsetBlocks(claimWindowCloseOffsetBlocks); err != nil { + return nil, err + } + + params.ClaimWindowCloseOffsetBlocks = claimWindowCloseOffsetBlocks default: return nil, types.ErrSharedParamInvalid.Wrapf("unsupported param %q", msg.Name) } diff --git a/x/shared/keeper/msg_server_update_param_test.go b/x/shared/keeper/msg_server_update_param_test.go index 8b32866f7..69a891bc6 100644 --- a/x/shared/keeper/msg_server_update_param_test.go +++ b/x/shared/keeper/msg_server_update_param_test.go @@ -54,7 +54,7 @@ func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { // Ensure the default values are different from the new values we want to set require.NotEqual(t, uint64(expectedClaimWindowOpenOffestBlocks), defaultParams.ClaimWindowOpenOffsetBlocks) - // Update the claim window open offset blocks + // Update the claim window open offset blocks param updateParamMsg := &sharedtypes.MsgUpdateParam{ Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), Name: sharedtypes.ParamClaimWindowOpenOffsetBlocks, @@ -68,3 +68,31 @@ func TestMsgUpdateParam_UpdateClaimWindowOpenOffsetBlocks(t *testing.T) { // Ensure the other parameters are unchanged require.Equal(t, defaultParams.NumBlocksPerSession, res.Params.NumBlocksPerSession) } + +func TestMsgUpdateParam_UpdateClaimWindowCloseOffsetBlocks(t *testing.T) { + var expectedClaimWindowCloseOffestBlocks int64 = 8 + + k, ctx := keepertest.SharedKeeper(t) + msgSrv := keeper.NewMsgServerImpl(k) + + // Set the parameters to their default values + defaultParams := sharedtypes.DefaultParams() + require.NoError(t, k.SetParams(ctx, defaultParams)) + + // Ensure the default values are different from the new values we want to set + require.NotEqual(t, uint64(expectedClaimWindowCloseOffestBlocks), defaultParams.ClaimWindowCloseOffsetBlocks) + + // Update the claim window close offset blocks param + updateParamMsg := &sharedtypes.MsgUpdateParam{ + Authority: authtypes.NewModuleAddress(govtypes.ModuleName).String(), + Name: sharedtypes.ParamClaimWindowCloseOffsetBlocks, + AsType: &sharedtypes.MsgUpdateParam_AsInt64{AsInt64: expectedClaimWindowCloseOffestBlocks}, + } + res, err := msgSrv.UpdateParam(ctx, updateParamMsg) + require.NoError(t, err) + + require.Equal(t, uint64(expectedClaimWindowCloseOffestBlocks), res.Params.ClaimWindowCloseOffsetBlocks) + + // Ensure the other parameters are unchanged + require.Equal(t, defaultParams.NumBlocksPerSession, res.Params.NumBlocksPerSession) +} diff --git a/x/shared/session.go b/x/shared/session.go index fa5675450..fe18c79e1 100644 --- a/x/shared/session.go +++ b/x/shared/session.go @@ -68,3 +68,15 @@ func GetSessionGracePeriodEndHeight(sessionEndHeight int64) int64 { func IsGracePeriodElapsed(sessionEndHeight, currentHeight int64) bool { return currentHeight > GetSessionGracePeriodEndHeight(sessionEndHeight) } + +// GetClaimWindowOpenHeight returns the block height at which the claim window of +// the session that includes queryHeight opens, given the passed sharedParams. +func GetClaimWindowOpenHeight(sharedParams *sharedtypes.Params, queryHeight int64) int64 { + sessionEndHeight := GetSessionEndHeight(sharedParams, queryHeight) + + // An additional block is added to permit to relays arriving at the last block + // of the session to be included in the claim before the smt is closed. + sessionGracePeriodEndHeight := GetSessionGracePeriodEndHeight(sessionEndHeight) + claimWindowOpenOffsetBlocks := int64(sharedParams.GetClaimWindowOpenOffsetBlocks()) + return claimWindowOpenOffsetBlocks + sessionGracePeriodEndHeight + 1 +} diff --git a/x/shared/types/message_update_param.go b/x/shared/types/message_update_param.go index 4a94ac9b9..42b26d062 100644 --- a/x/shared/types/message_update_param.go +++ b/x/shared/types/message_update_param.go @@ -48,7 +48,8 @@ func (msg *MsgUpdateParam) ValidateBasic() error { // Parameter name must be supported by this module. switch msg.Name { case ParamNumBlocksPerSession, - ParamClaimWindowOpenOffsetBlocks: + ParamClaimWindowOpenOffsetBlocks, + ParamClaimWindowCloseOffsetBlocks: return msg.paramTypeIsInt64() default: return ErrSharedParamNameInvalid.Wrapf("unsupported param %q", msg.Name) diff --git a/x/shared/types/params.go b/x/shared/types/params.go index ce668d9e6..d96296d4e 100644 --- a/x/shared/types/params.go +++ b/x/shared/types/params.go @@ -5,16 +5,19 @@ import ( ) const ( - DefaultNumBlocksPerSession = 4 - ParamNumBlocksPerSession = "num_blocks_per_session" - DefaultClaimWindowOpenOffsetBlocks = 0 - ParamClaimWindowOpenOffsetBlocks = "claim_window_open_offset_blocks" + DefaultNumBlocksPerSession = 4 + ParamNumBlocksPerSession = "num_blocks_per_session" + DefaultClaimWindowOpenOffsetBlocks = 0 + ParamClaimWindowOpenOffsetBlocks = "claim_window_open_offset_blocks" + DefaultClaimWindowCloseOffsetBlocks = 4 + ParamClaimWindowCloseOffsetBlocks = "claim_window_close_offset_blocks" ) var ( - _ paramtypes.ParamSet = (*Params)(nil) - KeyNumBlocksPerSession = []byte("NumBlocksPerSession") - KeyClaimWindowOpenOffsetBlocks = []byte("ClaimWindowOpenOffsetBlocks") + _ paramtypes.ParamSet = (*Params)(nil) + KeyNumBlocksPerSession = []byte("NumBlocksPerSession") + KeyClaimWindowOpenOffsetBlocks = []byte("ClaimWindowOpenOffsetBlocks") + KeyClaimWindowCloseOffsetBlocks = []byte("ClaimWindowCloseOffsetBlocks") ) // ParamKeyTable the param key table for launch module @@ -25,8 +28,9 @@ func ParamKeyTable() paramtypes.KeyTable { // NewParams creates a new Params instance func NewParams() Params { return Params{ - NumBlocksPerSession: DefaultNumBlocksPerSession, - ClaimWindowOpenOffsetBlocks: DefaultClaimWindowOpenOffsetBlocks, + NumBlocksPerSession: DefaultNumBlocksPerSession, + ClaimWindowOpenOffsetBlocks: DefaultClaimWindowOpenOffsetBlocks, + ClaimWindowCloseOffsetBlocks: DefaultClaimWindowCloseOffsetBlocks, } } @@ -48,6 +52,11 @@ func (params *Params) ParamSetPairs() paramtypes.ParamSetPairs { ¶ms.ClaimWindowOpenOffsetBlocks, ValidateClaimWindowOpenOffsetBlocks, ), + paramtypes.NewParamSetPair( + KeyClaimWindowCloseOffsetBlocks, + ¶ms.ClaimWindowCloseOffsetBlocks, + ValidateClaimWindowCloseOffsetBlocks, + ), } } @@ -61,6 +70,10 @@ func (params *Params) ValidateBasic() error { return err } + if err := ValidateClaimWindowCloseOffsetBlocks(params.ClaimWindowCloseOffsetBlocks); err != nil { + return err + } + return nil } @@ -89,3 +102,14 @@ func ValidateClaimWindowOpenOffsetBlocks(v interface{}) error { return nil } + +// ValidateClaimWindowCloseOffsetBlocks validates the ClaimWindowCloseOffsetBlocks param +// NB: The argument is an interface type to satisfy the ParamSetPair function signature. +func ValidateClaimWindowCloseOffsetBlocks(v interface{}) error { + _, ok := v.(uint64) + if !ok { + return ErrSharedParamInvalid.Wrapf("invalid parameter type: %T", v) + } + + return nil +} diff --git a/x/shared/types/params.pb.go b/x/shared/types/params.pb.go index 60d117f1c..e59cd0424 100644 --- a/x/shared/types/params.pb.go +++ b/x/shared/types/params.pb.go @@ -26,8 +26,14 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the module. type Params struct { - NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session"` + // num_blocks_per_session is the number of blocks between the session start & end heights. + NumBlocksPerSession uint64 `protobuf:"varint,1,opt,name=num_blocks_per_session,json=numBlocksPerSession,proto3" json:"num_blocks_per_session"` + // claim_window_open_offset_blocks is the number of blocks after the session grace + // period height, at which the claim window opens. ClaimWindowOpenOffsetBlocks uint64 `protobuf:"varint,2,opt,name=claim_window_open_offset_blocks,json=claimWindowOpenOffsetBlocks,proto3" json:"claim_window_open_offset_blocks"` + // claim_window_close_offset_blocks is the number of blocks after the claim window + // open height, at which the claim window closes. + ClaimWindowCloseOffsetBlocks uint64 `protobuf:"varint,3,opt,name=claim_window_close_offset_blocks,json=claimWindowCloseOffsetBlocks,proto3" json:"claim_window_close_offset_blocks"` } func (m *Params) Reset() { *m = Params{} } @@ -77,6 +83,13 @@ func (m *Params) GetClaimWindowOpenOffsetBlocks() uint64 { return 0 } +func (m *Params) GetClaimWindowCloseOffsetBlocks() uint64 { + if m != nil { + return m.ClaimWindowCloseOffsetBlocks + } + return 0 +} + func init() { proto.RegisterType((*Params)(nil), "poktroll.shared.Params") } @@ -84,25 +97,27 @@ func init() { func init() { proto.RegisterFile("poktroll/shared/params.proto", fileDescriptor_ee6189c7aa51bbf5) } var fileDescriptor_ee6189c7aa51bbf5 = []byte{ - // 287 bytes of a gzipped FileDescriptorProto + // 319 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xc8, 0xcf, 0x2e, 0x29, 0xca, 0xcf, 0xc9, 0xd1, 0x2f, 0xce, 0x48, 0x2c, 0x4a, 0x4d, 0xd1, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x87, 0xc9, 0xea, 0x41, 0x64, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, 0x48, 0x7a, 0x7e, 0x7a, - 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x9e, 0x33, 0x72, 0xb1, 0x05, 0x80, 0x8d, 0x12, + 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0xae, 0x32, 0x71, 0xb1, 0x05, 0x80, 0x8d, 0x12, 0xf2, 0xe7, 0x12, 0xcb, 0x2b, 0xcd, 0x8d, 0x4f, 0xca, 0xc9, 0x4f, 0xce, 0x2e, 0x8e, 0x2f, 0x48, 0x2d, 0x8a, 0x2f, 0x4e, 0x2d, 0x2e, 0xce, 0xcc, 0xcf, 0x93, 0x60, 0x54, 0x60, 0xd4, 0x60, 0x71, 0x92, 0x7a, 0x75, 0x4f, 0x1e, 0x87, 0x8a, 0x20, 0xe1, 0xbc, 0xd2, 0x5c, 0x27, 0xb0, 0x70, 0x40, 0x6a, 0x51, 0x30, 0x44, 0x50, 0x28, 0x93, 0x4b, 0x3e, 0x39, 0x27, 0x31, 0x33, 0x37, 0xbe, 0x3c, 0x33, 0x2f, 0x25, 0xbf, 0x3c, 0x3e, 0xbf, 0x20, 0x35, 0x2f, 0x3e, 0x3f, 0x2d, 0xad, 0x38, 0xb5, 0x04, 0x6a, 0x86, 0x04, 0x13, 0xd8, 0x64, 0xe5, 0x57, 0xf7, 0xe4, 0x09, 0x29, 0x0d, 0x92, 0x06, - 0x2b, 0x08, 0x07, 0xcb, 0xfb, 0x17, 0xa4, 0xe6, 0xf9, 0x83, 0x65, 0x21, 0x96, 0x5a, 0x29, 0xbe, - 0x58, 0x20, 0xcf, 0xd8, 0xf5, 0x7c, 0x83, 0x96, 0x04, 0x3c, 0x9c, 0x2a, 0x60, 0x21, 0x05, 0xf1, - 0x9e, 0x93, 0xe7, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, - 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa7, 0x67, - 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x83, 0xb4, 0xeb, 0xe6, 0xa5, 0x96, 0x94, - 0xe7, 0x17, 0x65, 0xeb, 0x63, 0x9a, 0x55, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x3b, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0x51, 0x62, 0xe7, 0x95, 0x01, 0x00, 0x00, + 0x2b, 0x08, 0x07, 0xcb, 0xfb, 0x17, 0xa4, 0xe6, 0xf9, 0x83, 0x65, 0x21, 0x96, 0x0a, 0xe5, 0x70, + 0x29, 0xa0, 0xe8, 0x4f, 0xce, 0xc9, 0x2f, 0x4e, 0x45, 0xb3, 0x8b, 0x19, 0x6c, 0x97, 0xca, 0xab, + 0x7b, 0xf2, 0x04, 0xd5, 0x06, 0xc9, 0x20, 0x59, 0xe6, 0x0c, 0x92, 0x47, 0xb6, 0xcd, 0x4a, 0xf1, + 0xc5, 0x02, 0x79, 0xc6, 0xae, 0xe7, 0x1b, 0xb4, 0x24, 0xe0, 0xb1, 0x52, 0x01, 0x8b, 0x17, 0x48, + 0x60, 0x3a, 0x79, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, + 0x13, 0x1e, 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x7e, 0x7a, + 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x48, 0xbb, 0x6e, 0x5e, 0x6a, 0x49, + 0x79, 0x7e, 0x51, 0xb6, 0x3e, 0xa6, 0x59, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x98, + 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xde, 0x00, 0x2d, 0x2f, 0x03, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -130,6 +145,9 @@ func (this *Params) Equal(that interface{}) bool { if this.ClaimWindowOpenOffsetBlocks != that1.ClaimWindowOpenOffsetBlocks { return false } + if this.ClaimWindowCloseOffsetBlocks != that1.ClaimWindowCloseOffsetBlocks { + return false + } return true } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -152,6 +170,11 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ClaimWindowCloseOffsetBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.ClaimWindowCloseOffsetBlocks)) + i-- + dAtA[i] = 0x18 + } if m.ClaimWindowOpenOffsetBlocks != 0 { i = encodeVarintParams(dAtA, i, uint64(m.ClaimWindowOpenOffsetBlocks)) i-- @@ -188,6 +211,9 @@ func (m *Params) Size() (n int) { if m.ClaimWindowOpenOffsetBlocks != 0 { n += 1 + sovParams(uint64(m.ClaimWindowOpenOffsetBlocks)) } + if m.ClaimWindowCloseOffsetBlocks != 0 { + n += 1 + sovParams(uint64(m.ClaimWindowCloseOffsetBlocks)) + } return n } @@ -264,6 +290,25 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimWindowCloseOffsetBlocks", wireType) + } + m.ClaimWindowCloseOffsetBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClaimWindowCloseOffsetBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) diff --git a/x/shared/types/params_test.go b/x/shared/types/params_test.go index f64cc33af..bb68a41ce 100644 --- a/x/shared/types/params_test.go +++ b/x/shared/types/params_test.go @@ -70,3 +70,33 @@ func TestParams_ValidateClaimWindowOpenOffsetBlocks(t *testing.T) { }) } } + +func TestParams_ValidateClaimWindowCloseOffsetBlocks(t *testing.T) { + tests := []struct { + desc string + claimWindowCloseOffsetBlocks any + err error + }{ + { + desc: "invalid type", + claimWindowCloseOffsetBlocks: "invalid", + err: ErrSharedParamInvalid.Wrapf("invalid parameter type: %T", "invalid"), + }, + { + desc: "valid ClaimWindowCloseOffsetBlocks", + claimWindowCloseOffsetBlocks: uint64(4), + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + err := ValidateClaimWindowCloseOffsetBlocks(tt.claimWindowCloseOffsetBlocks) + if tt.err != nil { + require.Error(t, err) + require.Contains(t, err.Error(), tt.err.Error()) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/tokenomics/types/message_update_param.go b/x/tokenomics/types/message_update_param.go index 32d0fa358..b69a5b826 100644 --- a/x/tokenomics/types/message_update_param.go +++ b/x/tokenomics/types/message_update_param.go @@ -48,7 +48,7 @@ func (msg *MsgUpdateParam) ValidateBasic() error { case ParamComputeUnitsToTokensMultiplier: return msg.paramTypeIsInt64() default: - return ErrTokenomicsParamNameInvalid.Wrapf("unsupported name param %q", msg.Name) + return ErrTokenomicsParamNameInvalid.Wrapf("unsupported param %q", msg.Name) } } From 383e7209212b098ad04919db86494b978a2ba52b Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 3 Jun 2024 12:06:06 +0200 Subject: [PATCH 05/12] Empty commit From fe307553c7debaaf1e79f77b0cde8e3d2793071f Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 3 Jun 2024 12:15:20 +0200 Subject: [PATCH 06/12] chore: add param update make target --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 7118e17b8..cd286cda5 100644 --- a/Makefile +++ b/Makefile @@ -854,6 +854,10 @@ params_update_shared_claim_window_open_offset_blocks: ## Update the shared modul params_update_shared_claim_window_close_offset_blocks: ## Update the shared module params poktrolld tx authz exec ./tools/scripts/params/shared_claim_window_close_offset_blocks.json $(PARAM_FLAGS) +.PHONY: params_update_shared_proof_window_open_offset_blocks +params_update_shared_proof_window_open_offset_blocks: ## Update the shared module params + poktrolld tx authz exec ./tools/scripts/params/shared_proof_window_open_offset_blocks.json $(PARAM_FLAGS) + .PHONY: params_query_all params_query_all: check_jq ## Query the params from all available modules @for module in $(MODULES); do \ From 9f7e1690a4766441cb39f38264c55f52ce5b222d Mon Sep 17 00:00:00 2001 From: Bryan White Date: Mon, 3 Jun 2024 12:50:10 +0200 Subject: [PATCH 07/12] [On-chain] feat: add `claim_window_close_offset_blocks` shared module param (#568) Co-authored-by: Daniel Olshansky From d64670fd4d95a52874c3952e91348428ee32a4d3 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Mon, 3 Jun 2024 21:32:20 -0700 Subject: [PATCH 08/12] [Ring] Replace `noot/ring-go` with `pokt-network/ring-go` (#563) Replace the external ring package with our own fork. Co-authored-by: Dmitry K --- go.mod | 1 + go.sum | 2 ++ pkg/crypto/interface.go | 2 +- pkg/crypto/rings/cache.go | 2 +- pkg/crypto/rings/client.go | 2 +- pkg/crypto/rings/ring.go | 2 +- pkg/signer/ring_signer.go | 2 +- testutil/testproxy/relayerproxy.go | 2 +- x/proof/keeper/msg_server_submit_proof_test.go | 2 +- 9 files changed, 10 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index b028d2537..aac26b061 100644 --- a/go.mod +++ b/go.mod @@ -42,6 +42,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 github.com/hashicorp/go-metrics v0.5.2 github.com/noot/ring-go v0.0.0-20231019173746-6c4b33bcf03f + github.com/pokt-network/ring-go v0.1.0 github.com/pokt-network/smt v0.10.2 github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b github.com/prometheus/client_golang v1.18.0 diff --git a/go.sum b/go.sum index c362c8fc0..48644822b 100644 --- a/go.sum +++ b/go.sum @@ -978,6 +978,8 @@ github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDj github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pokt-network/ring-go v0.1.0 h1:hF7mDR4VVCIqqDAsrloP8azM9y1mprc99YgnTjKSSwk= +github.com/pokt-network/ring-go v0.1.0/go.mod h1:8NHPH7H3EwrPX3XHfpyRI6bz4gApkE3+fd0XZRbMWP0= github.com/pokt-network/smt v0.10.2 h1:7OCimi2qN9kPwv+UDbUqaFYLaVMed3DYO8AbY8R0rNo= github.com/pokt-network/smt v0.10.2/go.mod h1:S4Ho4OPkK2v2vUCHNtA49XDjqUC/OFYpBbynRVYmxvA= github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b h1:TjfgV3vgW0zW47Br/OgUXD4M8iyR74EYanbFfN4ed8o= diff --git a/pkg/crypto/interface.go b/pkg/crypto/interface.go index 083b950ca..6ed511da8 100644 --- a/pkg/crypto/interface.go +++ b/pkg/crypto/interface.go @@ -5,7 +5,7 @@ import ( "context" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - ring "github.com/noot/ring-go" + ring "github.com/pokt-network/ring-go" "github.com/pokt-network/poktroll/x/service/types" ) diff --git a/pkg/crypto/rings/cache.go b/pkg/crypto/rings/cache.go index cbc966f2e..585c0e88b 100644 --- a/pkg/crypto/rings/cache.go +++ b/pkg/crypto/rings/cache.go @@ -5,7 +5,7 @@ import ( "sync" "cosmossdk.io/depinject" - ring "github.com/noot/ring-go" + ring "github.com/pokt-network/ring-go" "github.com/pokt-network/poktroll/pkg/client" "github.com/pokt-network/poktroll/pkg/crypto" diff --git a/pkg/crypto/rings/client.go b/pkg/crypto/rings/client.go index a3a170ee3..a1b8ea0a8 100644 --- a/pkg/crypto/rings/client.go +++ b/pkg/crypto/rings/client.go @@ -9,7 +9,7 @@ import ( ring_secp256k1 "github.com/athanorlabs/go-dleq/secp256k1" ringtypes "github.com/athanorlabs/go-dleq/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - "github.com/noot/ring-go" + ring "github.com/pokt-network/ring-go" "github.com/pokt-network/poktroll/pkg/client" "github.com/pokt-network/poktroll/pkg/crypto" diff --git a/pkg/crypto/rings/ring.go b/pkg/crypto/rings/ring.go index 13fd4269b..59b478c98 100644 --- a/pkg/crypto/rings/ring.go +++ b/pkg/crypto/rings/ring.go @@ -5,7 +5,7 @@ import ( ringtypes "github.com/athanorlabs/go-dleq/types" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - ring "github.com/noot/ring-go" + ring "github.com/pokt-network/ring-go" ) // newRingFromPoints creates a new ring from points (i.e. public keys) on the secp256k1 curve diff --git a/pkg/signer/ring_signer.go b/pkg/signer/ring_signer.go index b2c46a5ce..2334c25fa 100644 --- a/pkg/signer/ring_signer.go +++ b/pkg/signer/ring_signer.go @@ -4,7 +4,7 @@ import ( "fmt" ringtypes "github.com/athanorlabs/go-dleq/types" - ring "github.com/noot/ring-go" + ring "github.com/pokt-network/ring-go" ) var _ Signer = (*RingSigner)(nil) diff --git a/testutil/testproxy/relayerproxy.go b/testutil/testproxy/relayerproxy.go index 76bf96a85..aaeb1d687 100644 --- a/testutil/testproxy/relayerproxy.go +++ b/testutil/testproxy/relayerproxy.go @@ -18,7 +18,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types/bech32" - "github.com/noot/ring-go" + "github.com/pokt-network/ring-go" "github.com/stretchr/testify/require" "github.com/pokt-network/poktroll/pkg/client" diff --git a/x/proof/keeper/msg_server_submit_proof_test.go b/x/proof/keeper/msg_server_submit_proof_test.go index a28673b6f..93573ba48 100644 --- a/x/proof/keeper/msg_server_submit_proof_test.go +++ b/x/proof/keeper/msg_server_submit_proof_test.go @@ -17,7 +17,7 @@ import ( cosmostypes "github.com/cosmos/cosmos-sdk/types" signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/noot/ring-go" + "github.com/pokt-network/ring-go" "github.com/pokt-network/smt" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" From 73cd49d50482c0d2373be54a86009af4e102105c Mon Sep 17 00:00:00 2001 From: ezeike Date: Tue, 4 Jun 2024 17:39:55 -0400 Subject: [PATCH 09/12] [Tooling] Updated Makefile target for Grove gateway (#575) --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7118e17b8..8082e8e39 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ CHAIN_ID = poktroll # The domain ending in ".town" is staging, ".city" is production GROVE_GATEWAY_STAGING_ETH_MAINNET = https://eth-mainnet.rpc.grove.town -# The "protocol" field here instructs the Grove gateway which network to use -JSON_RPC_DATA_ETH_BLOCK_HEIGHT = '{"protocol": "shannon-testnet","jsonrpc":"2.0","id":"0","method":"eth_blockNumber", "params": []}' +# JSON RPC data for a test relay request +JSON_RPC_DATA_ETH_BLOCK_HEIGHT = '{"jsonrpc":"2.0","id":"0","method":"eth_blockNumber", "params": []}' # On-chain module account addresses. Search for `func TestModuleAddress` in the # codebase to get an understanding of how we got these values. @@ -981,4 +981,5 @@ act_reviewdog: check_act check_gh ## Run the reviewdog workflow locally like so: grove_staging_eth_block_height: ## Sends a relay through the staging grove gateway to the eth-mainnet chain. Must have GROVE_STAGING_PORTAL_APP_ID environment variable set. curl $(GROVE_GATEWAY_STAGING_ETH_MAINNET)/v1/$(GROVE_STAGING_PORTAL_APP_ID) \ -H 'Content-Type: application/json' \ - --data $(SHANNON_JSON_RPC_DATA_ETH_BLOCK_HEIGHT) + -H 'Protocol: shannon-testnet' \ + --data $(JSON_RPC_DATA_ETH_BLOCK_HEIGHT) From 78b499c887be5dab8ddb292ee49a8f735f9ce883 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 4 Jun 2024 18:18:05 -0700 Subject: [PATCH 10/12] Updated go.sum & go.mod --- go.mod | 1 - go.sum | 2 -- 2 files changed, 3 deletions(-) diff --git a/go.mod b/go.mod index aac26b061..7c74afd6f 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,6 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 github.com/hashicorp/go-metrics v0.5.2 - github.com/noot/ring-go v0.0.0-20231019173746-6c4b33bcf03f github.com/pokt-network/ring-go v0.1.0 github.com/pokt-network/smt v0.10.2 github.com/pokt-network/smt/kvstore/badger v0.0.0-20240109205447-868237978c0b diff --git a/go.sum b/go.sum index 48644822b..211a07386 100644 --- a/go.sum +++ b/go.sum @@ -909,8 +909,6 @@ github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/noot/ring-go v0.0.0-20231019173746-6c4b33bcf03f h1:1+NP/H13eFAqBYrGpRkbJUWVWIO2Zr2eP7a/q0UtZVQ= -github.com/noot/ring-go v0.0.0-20231019173746-6c4b33bcf03f/go.mod h1:0t3gzoSfW2bkTce1E/Jis3MQpjiKGhAgqieFK+nkQsI= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= From aa612360c2058221a2b50946defaa34921fcedd4 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Tue, 4 Jun 2024 20:47:17 -0700 Subject: [PATCH 11/12] [TODO] Team's Iteration16 TODO preparation (#577) Go through ALMOST all the TODOs and and to the following: - Add an owner where applicable - Mark things as `TODO_BLOCKER` if they need to be done in iteration #16 - Mark things as `TODO_BETA` if they are needed for the beta launch - Mark things as `TODO_MAINNET` if they are needed for mainnet This enables generating a TODO list like so: ``` grep -r "TODO_BLOCKER(@Olshansk)" . | sed 's/^/- [ ] `/' | sed 's/:/`:/' ``` --- .github/workflows/main-build.yml | 2 +- .github/workflows/release-artifacts.yml | 4 +- .github/workflows/run-tests.yml | 2 +- .gitignore | 2 +- Dockerfile.dev | 2 +- Makefile | 9 +- Tiltfile | 4 +- .../application/application.pulsar.go | 2 +- api/poktroll/service/query.pulsar.go | 2 +- api/poktroll/service/tx.pulsar.go | 4 +- api/poktroll/shared/service.pulsar.go | 2 +- api/poktroll/tokenomics/params.pulsar.go | 1 - app/app.go | 3 +- config.yml | 2 +- docs/static/openapi.yml | 2039 ++++++++++++++--- .../develop/contributing/observability.md | 11 +- .../docs/develop/packages/client_events.md | 2 +- .../docs/operate/infrastructure/localnet.md | 9 - .../docs/operate/infrastructure/testnet.md | 2 +- .../docs/operate/testing/load_testing.md | 25 +- .../operate/testing/load_testing_plan_1.md | 45 +- .../primitives/claim_and_proof_lifecycle.md | 16 +- .../docs/protocol/primitives/gateways.md | 15 +- .../primitives/probabilistic_proofs.md | 2 +- .../docs/protocol/primitives/relay_mining.md | 2 +- .../docs/protocol/primitives/session.md | 2 +- e2e/tests/session.feature | 4 +- e2e/tests/stake_app.feature | 2 +- e2e/tests/stake_gateway.feature | 2 +- e2e/tests/stake_supplier.feature | 2 +- e2e/tests/update_params.feature | 3 - .../tests/relays_stress_helpers_test.go | 16 +- .../config/appgate_configs_reader.go | 2 +- pkg/appgateserver/endpoint_selector.go | 9 +- pkg/appgateserver/server.go | 2 +- pkg/client/block/client.go | 2 +- pkg/client/block/client_integration_test.go | 6 +- pkg/client/block/client_test.go | 2 +- pkg/client/delegation/client.go | 2 +- .../delegation/client_integration_test.go | 16 +- pkg/client/events/replay_client.go | 4 +- pkg/client/interface.go | 2 +- pkg/client/query/sharedquerier.go | 2 +- pkg/client/tx/client.go | 2 +- pkg/client/tx/client_test.go | 2 +- pkg/crypto/rings/client.go | 2 +- pkg/observable/channel/observable_test.go | 4 +- pkg/observable/channel/observer.go | 2 +- pkg/partials/errors.go | 2 +- pkg/partials/partial.go | 6 +- pkg/partials/partials_test.go | 12 +- pkg/partials/payloads/jsonrpc.go | 2 +- pkg/partials/payloads/rest.go | 8 +- pkg/relayer/miner/gen/gen_fixtures.go | 4 +- pkg/relayer/miner/miner.go | 8 +- pkg/relayer/miner/miner_test.go | 2 +- pkg/relayer/protocol/block_heights.go | 4 +- pkg/relayer/protocol/difficulty.go | 5 +- pkg/relayer/proxy/relay_verifier.go | 3 +- pkg/relayer/proxy/server_builder.go | 2 +- pkg/relayer/proxy/synchronous.go | 2 +- pkg/relayer/session/claim.go | 2 +- pkg/relayer/session/proof.go | 8 +- pkg/relayer/session/session.go | 4 +- pkg/relayer/session/session_test.go | 4 +- proto/poktroll/application/application.proto | 2 +- proto/poktroll/service/query.proto | 2 +- proto/poktroll/service/tx.proto | 7 +- proto/poktroll/shared/service.proto | 8 +- proto/poktroll/tokenomics/params.proto | 1 - .../tokenomics/relay_mining_difficulty.proto | 2 +- testutil/testkeyring/keyring.go | 2 +- testutil/testpolylog/event.go | 2 +- testutil/testproxy/relayerproxy.go | 2 +- testutil/testrelayer/relays.go | 4 +- .../keeper/msg_server_unstake_application.go | 2 +- x/application/keeper/prune_undelegations.go | 2 +- x/application/module/query.go | 5 +- x/application/module/tx.go | 5 +- x/application/simulation/stake_application.go | 1 - x/application/types/application.pb.go | 2 +- x/application/types/genesis.go | 2 +- .../types/message_stake_application.go | 2 +- x/application/types/params.go | 2 +- x/gateway/keeper/msg_server_stake_gateway.go | 2 - .../keeper/msg_server_unstake_gateway.go | 3 +- x/gateway/module/module.go | 6 +- x/gateway/module/query.go | 2 +- x/gateway/module/tx.go | 2 +- x/proof/keeper/keeper.go | 2 +- x/proof/keeper/msg_server_create_claim.go | 13 +- x/proof/keeper/msg_server_submit_proof.go | 25 +- .../keeper/msg_server_submit_proof_test.go | 4 +- .../keeper/msg_server_update_param_test.go | 3 - x/proof/keeper/proof.go | 2 +- x/proof/module/genesis.go | 1 - x/proof/module/genesis_test.go | 2 +- x/proof/module/helpers_test.go | 2 +- x/proof/module/module.go | 2 - x/proof/module/query.go | 2 +- x/proof/module/query_claim_test.go | 2 +- x/proof/module/query_proof_test.go | 4 +- x/proof/module/tx.go | 2 +- x/proof/module/tx_create_claim_test.go | 2 +- x/proof/module/tx_submit_proof_test.go | 2 +- x/proof/types/genesis.go | 2 +- x/proof/types/genesis_test.go | 4 +- x/proof/types/key_claim.go | 2 +- x/proof/types/message_submit_proof.go | 4 +- x/proof/types/params.go | 2 +- x/proof/types/query_validation.go | 8 +- x/proof/types/shared_query_client.go | 2 +- x/service/module/module.go | 4 +- x/service/module/tx.go | 2 +- x/service/types/message_add_service.go | 2 +- x/service/types/params.go | 6 +- x/service/types/query.pb.go | 2 +- x/service/types/relay.go | 2 +- x/service/types/tx.pb.go | 4 +- x/session/keeper/session_hydrator.go | 25 +- x/session/keeper/session_hydrator_test.go | 16 +- x/session/types/session_header.go | 2 +- x/shared/helpers/service.go | 4 +- x/shared/helpers/service_configs.go | 2 +- x/shared/session.go | 8 +- x/shared/types/service.pb.go | 2 +- x/supplier/client/cli/tx_create_claim_test.go | 2 +- x/supplier/client/cli/tx_submit_proof_test.go | 2 +- x/supplier/config/supplier_configs_reader.go | 2 +- .../keeper/msg_server_unstake_supplier.go | 2 +- x/supplier/keeper/query_supplier.go | 2 +- x/supplier/keeper/supplier.go | 2 +- x/supplier/module/query.go | 2 +- x/supplier/module/tx.go | 2 +- x/supplier/types/genesis.go | 2 +- x/supplier/types/message_stake_supplier.go | 3 +- .../types/message_stake_supplier_test.go | 2 +- x/tokenomics/keeper/keeper_test.go | 8 +- .../keeper/msg_server_update_param_test.go | 1 - x/tokenomics/keeper/query_params_test.go | 2 +- x/tokenomics/keeper/settle_pending_claims.go | 10 +- .../keeper/settle_session_accounting.go | 10 +- .../keeper/settle_session_accounting_test.go | 5 +- .../keeper/update_relay_mining_difficulty.go | 6 +- x/tokenomics/module/tx.go | 2 +- x/tokenomics/module/tx_update_params.go | 3 +- x/tokenomics/types/params.go | 2 +- x/tokenomics/types/params.pb.go | 1 - 148 files changed, 1970 insertions(+), 727 deletions(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index d98b4eab5..d6af64f6e 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -30,7 +30,7 @@ jobs: # This is commented out because proto generated code is now tracked in the # repo so this step is skipped. - # TODO_IMPROVE: Have a step that regenerates the proto files and ensures + # TODO_IMPROVE(@okdas): Have a step that regenerates the proto files and ensures # if they are up to date. See https://github.com/pokt-network/poktroll/pull/544#issuecomment-2123063491 # - name: Generate protobufs # run: make proto_regen diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 22dd3f8c5..3ccc64487 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -31,7 +31,7 @@ jobs: # This is commented out because proto generated code is now tracked in the # repo so this step is skipped. - # TODO_IMPROVE: Have a step that regenerates the proto files and ensures + # TODO_IMPROVE(@okdas): Have a step that regenerates the proto files and ensures # if they are up to date. See https://github.com/pokt-network/poktroll/pull/544#issuecomment-2123063491 # - name: Generate protobufs # run: make proto_regen @@ -79,7 +79,7 @@ jobs: cache-to: type=gha,mode=max context: . - # TODO(@okdas): use for releases (also change the "on" part at the top so it only tgirrered for tags/releases) + # TODO_TECHDEBT(@okdas): use for releases (also change the "on" part at the top so it only tgirrered for tags/releases) - name: Add release and publish binaries uses: softprops/action-gh-release@v1 with: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 60c1a8c0a..b419ab44d 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -34,7 +34,7 @@ jobs: # This is commented out because proto generated code is now tracked in the # repo so this step is skipped. - # TODO_IMPROVE: Have a step that regenerates the proto files and ensures + # TODO_IMPROVE(@okdas): Have a step that regenerates the proto files and ensures # if they are up to date. See https://github.com/pokt-network/poktroll/pull/544#issuecomment-2123063491 # - name: Generate protobufs # run: make proto_regen diff --git a/.gitignore b/.gitignore index 8ccdeeacd..7a12f34c0 100644 --- a/.gitignore +++ b/.gitignore @@ -72,7 +72,7 @@ go.work.sum **/gomock_reflect_* # SMT KVStore files -# TODO_TECHDEBT(#126, @red-0ne): Rename `smt` to `smt_stores` and make it configurable so it can be stored anywhere on this +# TODO_TECHDEBT(@red-0ne, #126): Rename `smt` to `smt_stores` and make it configurable so it can be stored anywhere on this smt smt_stores diff --git a/Dockerfile.dev b/Dockerfile.dev index 5d0ec98c3..cb4e3e1de 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -23,7 +23,7 @@ RUN mv /poktroll/bin/ignite /usr/bin/ && mv /poktroll/bin/poktrolld /usr/bin/ RUN make localnet_regenesis -# TODO_TECHDEBT(@okdas): Ports are not documented as they will soon be changed with a document to follow +# TODO_DOCUMENT(@okdas): Ports are not documented as they will soon be changed with a document to follow EXPOSE 8545 EXPOSE 8546 EXPOSE 8547 diff --git a/Makefile b/Makefile index 8082e8e39..1a6dc0923 100644 --- a/Makefile +++ b/Makefile @@ -76,8 +76,8 @@ endif ### Dependencies ### #################### -# TODO: Add other dependencies (ignite, docker, k8s, etc) here -# TODO(@okdas): bump `golangci-lint` when we upgrade golang to 1.21+ +# TODO_IMPROVE(@okdas): Add other dependencies (ignite, docker, k8s, etc) here +# TODO_BLOCKER(@okdas): bump `golangci-lint` when we upgrade golang to 1.21+ .PHONY: install_ci_deps install_ci_deps: ## Installs `mockgen` and other go tools go install "github.com/golang/mock/mockgen@v1.6.0" && mockgen --version @@ -107,9 +107,6 @@ help: ## Prints all the targets in all the Makefiles ### Checks ### ############## -# TODO_DOCUMENT: All of the `check_` helpers can be installed differently depending -# on the user's OS and enviornment. - .PHONY: check_go_version # Internal helper target - check go version check_go_version: @@ -330,7 +327,7 @@ send_relay_delegating_app: # Send a relay through the gateway as an application --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \ $(GATEWAY_URL)/anvil?applicationAddr=$$appAddr -# TODO_BLOCKER(@okdas): Figure out how to copy these over w/ a functional state. +# TODO_TECHDEBT(@okdas): Figure out how to copy these over w/ a functional state. # cp ${HOME}/.poktroll/config/app.toml $(POKTROLLD_HOME)/config/app.toml # cp ${HOME}/.poktroll/config/config.toml $(POKTROLLD_HOME)/config/config.toml # cp ${HOME}/.poktroll/config/client.toml $(POKTROLLD_HOME)/config/client.toml diff --git a/Tiltfile b/Tiltfile index 3f1bebd7e..c7a8446cc 100644 --- a/Tiltfile +++ b/Tiltfile @@ -41,7 +41,7 @@ localnet_config_defaults = { "count": 1, "delve": {"enabled": False}, }, - # TODO(#511): Add support for `REST` and enabled this. + # TODO_BLOCKER(@red-0ne, #511): Add support for `REST` and enabled this. "ollama": { "enabled": False, "model": "qwen:0.5b", @@ -143,7 +143,7 @@ secret_create_generic( configmap_create( "poktrolld-configs", from_file=listdir("localnet/poktrolld/config/"), watch=True ) -# TODO(@okdas): Import validator keys when we switch to `poktrolld` helm chart +# TODO_BLOCKER(@okdas): Import validator keys when we switch to `poktrolld` helm chart # by uncommenting the following lines: # load("ext://secret", "secret_create_generic") # secret_create_generic( diff --git a/api/poktroll/application/application.pulsar.go b/api/poktroll/application/application.pulsar.go index ef3812c23..04b8048c5 100644 --- a/api/poktroll/application/application.pulsar.go +++ b/api/poktroll/application/application.pulsar.go @@ -1592,7 +1592,7 @@ type Application struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding Stake *v1beta1.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` // The total amount of uPOKT the application has staked ServiceConfigs []*shared.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=service_configs,json=serviceConfigs,proto3" json:"service_configs,omitempty"` // The list of services this appliccation is configured to request service for - // TODO_TECHDEBT: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. + // TODO_BETA: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. // Ensure to rename all relevant configs, comments, variables, function names, etc as well. DelegateeGatewayAddresses []string `protobuf:"bytes,4,rep,name=delegatee_gateway_addresses,json=delegateeGatewayAddresses,proto3" json:"delegatee_gateway_addresses,omitempty"` // The Bech32 encoded addresses for all delegatee Gateways, in a non-nullable slice // A map from sessionEndHeights to a list of Gateways. diff --git a/api/poktroll/service/query.pulsar.go b/api/poktroll/service/query.pulsar.go index 2f313aef1..402b216b4 100644 --- a/api/poktroll/service/query.pulsar.go +++ b/api/poktroll/service/query.pulsar.go @@ -2753,7 +2753,7 @@ type QueryGetServiceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // TODO: We could support getting services by name. + // TODO_IMPROVE: We could support getting services by name. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } diff --git a/api/poktroll/service/tx.pulsar.go b/api/poktroll/service/tx.pulsar.go index b756d9c17..f6fd47f21 100644 --- a/api/poktroll/service/tx.pulsar.go +++ b/api/poktroll/service/tx.pulsar.go @@ -1818,9 +1818,7 @@ func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { // MsgAddService defines a message for adding a new message to the network. // Services can be added by any actor in the network making them truly // permissionless. -// TODO_DOCUMENT(@h5law): This is a key function in making services -// permissionless, document it's usage and design - in docusaurus covering how -// the entire process works. +// TODO_BETA: Add Champions / Sources once its fully defined. type MsgAddService struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/poktroll/shared/service.pulsar.go b/api/poktroll/shared/service.pulsar.go index a5b89fb9e..52de53638 100644 --- a/api/poktroll/shared/service.pulsar.go +++ b/api/poktroll/shared/service.pulsar.go @@ -2706,7 +2706,7 @@ type Service struct { // For example, what if we want to request a session for a certain service but with some additional configs that identify it? Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Unique identifier for the service - // TODO_TECHDEBT: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary + // TODO_BETA: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // (Optional) Semantic human readable name for the service } diff --git a/api/poktroll/tokenomics/params.pulsar.go b/api/poktroll/tokenomics/params.pulsar.go index 6336f63af..1ad251c5e 100644 --- a/api/poktroll/tokenomics/params.pulsar.go +++ b/api/poktroll/tokenomics/params.pulsar.go @@ -438,7 +438,6 @@ type Params struct { unknownFields protoimpl.UnknownFields // The amount of upokt that a compute unit should translate to when settling a session. - // TODO_DOCUMENT(@Olshansk): Make sure to document the units of this parameter (or the map) once finalized. ComputeUnitsToTokensMultiplier uint64 `protobuf:"varint,1,opt,name=compute_units_to_tokens_multiplier,json=computeUnitsToTokensMultiplier,proto3" json:"compute_units_to_tokens_multiplier,omitempty"` } diff --git a/app/app.go b/app/app.go index 880e1ba26..622e6bbb1 100644 --- a/app/app.go +++ b/app/app.go @@ -1,7 +1,6 @@ package app import ( - sharedmodulekeeper "github.com/pokt-network/poktroll/x/shared/keeper" // this line is used by starport scaffolding # stargate/app/moduleImport "io" "os" @@ -62,6 +61,7 @@ import ( proofmodulekeeper "github.com/pokt-network/poktroll/x/proof/keeper" servicemodulekeeper "github.com/pokt-network/poktroll/x/service/keeper" sessionmodulekeeper "github.com/pokt-network/poktroll/x/session/keeper" + sharedmodulekeeper "github.com/pokt-network/poktroll/x/shared/keeper" suppliermodulekeeper "github.com/pokt-network/poktroll/x/supplier/keeper" tokenomicsmodulekeeper "github.com/pokt-network/poktroll/x/tokenomics/keeper" ) @@ -192,7 +192,6 @@ func New( appBuilder *runtime.AppBuilder // merge the AppConfig and other configuration in one config - // TODO_BLOCKER(@Olshansk): Revisit the advanced configuration and understand if/where it fits in Shannon appConfig = depinject.Configs( AppConfig(), depinject.Supply( diff --git a/config.yml b/config.yml index 7cfe4c7ac..b144668da 100644 --- a/config.yml +++ b/config.yml @@ -93,7 +93,7 @@ genesis: staking: params: bond_denom: upokt - # TODO_BLOCKER(@Olshansk): Figure out what this should be on Shannon + # TODO_MAINNET(@Olshansk): Figure out what this should be on Shannon # re-genesis. We're setting it to 1 for Alpha TestNet #1 so Grove # maintains the only validator until Alpha TestNet #2. max_validators: 1 diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 11f698dd2..d5ccf8304 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -92,7 +92,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -137,7 +140,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -147,7 +150,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -177,6 +180,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -342,7 +346,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -387,7 +394,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -397,7 +404,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -427,6 +434,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -532,7 +540,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -577,7 +588,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -587,7 +598,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -617,6 +628,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -749,7 +761,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -794,7 +809,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -804,7 +819,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -834,6 +849,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -943,7 +959,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -988,7 +1007,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -998,7 +1017,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -1028,6 +1047,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -1165,7 +1185,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -1210,7 +1233,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -1220,7 +1243,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -1250,6 +1273,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -2682,7 +2706,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -2727,7 +2754,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -2737,7 +2764,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -2767,6 +2794,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -2873,7 +2901,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -2969,7 +3000,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -3014,7 +3048,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3024,7 +3058,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -3054,6 +3088,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -3168,7 +3203,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -3267,7 +3305,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -3312,7 +3353,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3322,7 +3363,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -3352,6 +3393,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -3488,7 +3530,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -3533,7 +3578,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3543,7 +3588,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -3573,6 +3618,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -3733,7 +3779,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -3778,7 +3827,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -3788,7 +3837,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -3818,6 +3867,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -3954,7 +4004,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -3999,7 +4052,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4009,7 +4062,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -4039,6 +4092,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -4195,7 +4249,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -4240,7 +4297,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4250,7 +4307,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -4280,6 +4337,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -4382,7 +4440,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -4486,7 +4547,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -4531,7 +4595,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4541,7 +4605,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -4571,6 +4635,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -4675,7 +4740,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -4720,7 +4788,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4730,7 +4798,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -4760,6 +4828,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -4934,7 +5003,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -4979,7 +5051,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -4989,7 +5061,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -5019,6 +5091,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -5285,7 +5358,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -5330,7 +5406,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5340,7 +5416,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -5370,6 +5446,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -5517,7 +5594,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -5562,7 +5642,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5572,7 +5652,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -5602,6 +5682,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -5761,7 +5842,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -5806,7 +5890,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -5816,7 +5900,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -5846,6 +5930,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -6005,7 +6090,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -6050,7 +6138,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6060,7 +6148,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -6090,6 +6178,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -6192,7 +6281,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -6306,7 +6398,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -6351,7 +6446,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6361,7 +6456,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -6391,6 +6486,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -6539,7 +6635,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -6584,7 +6683,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -6594,7 +6693,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -6624,6 +6723,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7130,7 +7230,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7175,7 +7278,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7185,7 +7288,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7215,6 +7318,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7375,7 +7479,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7420,7 +7527,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7430,7 +7537,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7460,6 +7567,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7614,7 +7722,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7659,7 +7770,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7669,7 +7780,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7699,6 +7810,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -7858,7 +7970,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -7903,7 +8018,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -7913,7 +8028,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -7943,6 +8058,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8074,7 +8190,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8119,7 +8238,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8129,7 +8248,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8159,6 +8278,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8311,7 +8431,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8356,7 +8479,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8366,7 +8489,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8396,6 +8519,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8584,7 +8708,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8629,7 +8756,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8639,7 +8766,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8669,6 +8796,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -8829,7 +8957,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -8874,7 +9005,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -8884,7 +9015,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -8914,6 +9045,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9095,7 +9227,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -9140,7 +9275,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9150,7 +9285,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -9180,6 +9315,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9391,7 +9527,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -9436,7 +9575,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9446,7 +9585,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -9476,6 +9615,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9710,7 +9850,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -9755,7 +9898,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -9765,7 +9908,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -9795,6 +9938,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -9946,7 +10090,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -9991,7 +10138,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -10001,7 +10148,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -10031,6 +10178,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -11471,7 +11619,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -11516,7 +11667,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11526,7 +11677,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -11556,6 +11707,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -11653,7 +11805,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -11698,7 +11853,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11708,7 +11863,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -11738,6 +11893,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -11829,7 +11985,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -11923,7 +12082,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -11968,7 +12130,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -11978,7 +12140,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -12008,6 +12170,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -12159,7 +12322,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no + widely used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty @@ -12246,7 +12412,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -12340,7 +12509,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -12385,7 +12557,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12395,7 +12567,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -12425,6 +12597,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -12573,8 +12746,11 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. - + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. + Schemes other than `http`, `https` (or the empty scheme) might be @@ -12618,7 +12794,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12628,7 +12804,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -12658,6 +12834,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -12765,7 +12942,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -12810,7 +12990,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -12820,7 +13000,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -12850,6 +13030,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -12973,7 +13154,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -13018,7 +13202,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13028,7 +13212,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -13058,6 +13242,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -13163,7 +13348,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -13208,7 +13396,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13218,7 +13406,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -13248,6 +13436,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -13367,7 +13556,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -13412,7 +13604,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13422,7 +13614,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -13452,6 +13644,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -13604,7 +13797,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -13649,7 +13845,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13659,7 +13855,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -13689,6 +13885,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -13789,7 +13986,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -13834,7 +14034,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -13844,7 +14044,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -13874,6 +14074,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -13965,7 +14166,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14010,7 +14214,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14020,7 +14224,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14050,6 +14254,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14179,7 +14384,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14224,7 +14432,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14234,7 +14442,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14264,6 +14472,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14383,7 +14592,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14428,7 +14640,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14438,7 +14650,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14468,6 +14680,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14682,7 +14895,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14727,7 +14943,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -14737,7 +14953,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -14767,6 +14983,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -14949,7 +15166,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -14994,7 +15214,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15004,7 +15224,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -15034,6 +15254,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -15224,7 +15445,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -15269,7 +15493,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15279,7 +15503,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -15309,6 +15533,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -15417,7 +15642,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -15462,7 +15690,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15472,7 +15700,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -15502,6 +15730,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -15771,7 +16000,10 @@ paths: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely + used type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) @@ -15816,7 +16048,7 @@ paths: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -15826,7 +16058,7 @@ paths: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -15856,6 +16088,7 @@ paths: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -16715,6 +16948,242 @@ paths: params at once. tags: - Msg + /pokt-network/poktroll/service/params: + get: + summary: Parameters queries the parameters of the module. + operationId: PoktrollServiceQuery_Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + add_service_fee: + type: string + format: uint64 + description: |- + The amount of uPOKT required to add a new service. + This will be deducted from the signer's account balance, + and transferred to the pocket network foundation. + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /pokt-network/poktroll/service/service: + get: + operationId: PoktrollServiceQuery_AllServices + responses: + '200': + description: A successful response. + schema: + type: object + properties: + service: + type: array + items: + type: object + properties: + id: + type: string + description: Unique identifier for the service + title: >- + For example, what if we want to request a session for a + certain service but with some additional configs that + identify it? + name: + type: string + description: (Optional) Semantic human readable name for the service + title: >- + TODO_TECHDEBT: Name is currently unused but acts as a + reminder that an optional onchain representation of the + service is necessary + title: >- + Service message to encapsulate unique and semantic + identifiers for a service on the network + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /pokt-network/poktroll/service/service/{id}: + get: + summary: Queries a list of Service items. + operationId: PoktrollServiceQuery_Service + responses: + '200': + description: A successful response. + schema: + type: object + properties: + service: + type: object + properties: + id: + type: string + description: Unique identifier for the service + title: >- + For example, what if we want to request a session for a + certain service but with some additional configs that + identify it? + name: + type: string + description: (Optional) Semantic human readable name for the service + title: >- + TODO_TECHDEBT: Name is currently unused but acts as a + reminder that an optional onchain representation of the + service is necessary + title: >- + Service message to encapsulate unique and semantic identifiers + for a service on the network + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: id + description: 'TODO: We could support getting services by name.' + in: path + required: true + type: string + tags: + - Query /poktroll.service.Msg/AddService: post: operationId: PoktrollServiceMsg_AddService @@ -16751,12 +17220,7 @@ paths: permissionless. - TODO_DOCUMENT(@h5law): This is a key function in making services - - permissionless, document it's usage and design - in docusaurus - covering how - - the entire process works. + TODO_IMPLEMENT: Add Champions / Sources once its fully defined. in: body required: true schema: @@ -16794,12 +17258,7 @@ paths: permissionless. - TODO_DOCUMENT(@h5law): This is a key function in making services - - permissionless, document it's usage and design - in docusaurus - covering how - - the entire process works. + TODO_IMPLEMENT: Add Champions / Sources once its fully defined. tags: - Msg /poktroll.service.Msg/UpdateParams: @@ -17332,10 +17791,9 @@ paths: additionalProperties: {} tags: - Query - /pokt-network/poktroll/shared/params: - get: - summary: Parameters queries the parameters of the module. - operationId: PoktrollSharedQuery_Params + /poktroll.shared.Msg/UpdateParam: + post: + operationId: PoktrollSharedMsg_UpdateParam responses: '200': description: A successful response. @@ -17343,46 +17801,36 @@ paths: type: object properties: params: - description: params holds all the parameters of this module. type: object properties: num_blocks_per_session: type: string format: uint64 + description: >- + num_blocks_per_session is the number of blocks between the + session start & end heights. + claim_window_open_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_open_offset_blocks is the number of blocks + after the session grace + + period height, at which the claim window opens. + claim_window_close_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_close_offset_blocks is the number of blocks + after the claim window + + open height, at which the claim window closes. + description: Params defines the parameters for the module. description: >- - QueryParamsResponse is response type for the Query/Params RPC - method. - default: - description: An unexpected error response. - schema: - type: object - properties: - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - '@type': - type: string - additionalProperties: {} - tags: - - Query - /poktroll.shared.Msg/UpdateParam: - post: - operationId: PoktrollSharedMsg_UpdateParam - responses: - '200': - description: A successful response. - schema: - type: object - properties: - params: - type: string + MsgUpdateParamResponse defines the response structure for + executing a + + MsgUpdateParam message after a single param update. default: description: An unexpected error response. schema: @@ -17403,6 +17851,9 @@ paths: additionalProperties: {} parameters: - name: body + description: >- + MsgUpdateParam is the Msg/UpdateParam request type to update a + single param. in: body required: true schema: @@ -17410,10 +17861,22 @@ paths: properties: authority: type: string + description: >- + authority is the address that controls the module (defaults to + x/gov unless overwritten). name: type: string - asType: + as_string: + type: string + as_int64: + type: string + format: int64 + as_bytes: type: string + format: byte + description: >- + MsgUpdateParam is the Msg/UpdateParam request type to update a + single param. tags: - Msg /poktroll.shared.Msg/UpdateParams: @@ -17464,15 +17927,93 @@ paths: authority is the address that controls the module (defaults to x/gov unless overwritten). params: - description: 'NOTE: All parameters must be supplied.' type: object properties: num_blocks_per_session: type: string format: uint64 + description: >- + num_blocks_per_session is the number of blocks between the + session start & end heights. + claim_window_open_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_open_offset_blocks is the number of blocks + after the session grace + + period height, at which the claim window opens. + claim_window_close_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_close_offset_blocks is the number of blocks + after the claim window + + open height, at which the claim window closes. + description: Params defines the parameters for the module. description: MsgUpdateParams is the Msg/UpdateParams request type. tags: - Msg + /pokt-network/poktroll/shared/params: + get: + summary: Parameters queries the parameters of the module. + operationId: PoktrollSharedQuery_Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + num_blocks_per_session: + type: string + format: uint64 + description: >- + num_blocks_per_session is the number of blocks between the + session start & end heights. + claim_window_open_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_open_offset_blocks is the number of blocks + after the session grace + + period height, at which the claim window opens. + claim_window_close_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_close_offset_blocks is the number of blocks + after the claim window + + open height, at which the claim window closes. + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query /poktroll.supplier.Msg/StakeSupplier: post: operationId: PoktrollSupplierMsg_StakeSupplier @@ -17736,9 +18277,6 @@ paths: description: >- The amount of upokt that a compute unit should translate to when settling a session. - - TODO_DOCUMENT(@Olshansk): Make sure to document the units - of this parameter (or the map) once finalized. description: Params defines the parameters for the tokenomics module. description: >- MsgUpdateParamResponse defines the response structure for @@ -17856,15 +18394,294 @@ paths: description: >- The amount of upokt that a compute unit should translate to when settling a session. - - TODO_DOCUMENT(@Olshansk): Make sure to document the units - of this parameter (or the map) once finalized. description: Params defines the parameters for the tokenomics module. description: >- MsgUpdateParams is the Msg/UpdateParams request type to update all params at once. tags: - Msg + /pokt-network/poktroll/tokenomics/params: + get: + summary: Parameters queries the parameters of the module. + operationId: PoktrollTokenomicsQuery_Params + responses: + '200': + description: A successful response. + schema: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + compute_units_to_tokens_multiplier: + type: string + format: uint64 + description: >- + The amount of upokt that a compute unit should translate + to when settling a session. + description: >- + QueryParamsResponse is response type for the Query/Params RPC + method. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + tags: + - Query + /pokt-network/poktroll/tokenomics/relay_mining_difficulty: + get: + operationId: PoktrollTokenomicsQuery_RelayMiningDifficultyAll + responses: + '200': + description: A successful response. + schema: + type: object + properties: + relayMiningDifficulty: + type: array + items: + type: object + properties: + service_id: + type: string + description: >- + The service ID the the relay mining difficulty is + associated with. + block_height: + type: string + format: int64 + description: >- + The block height at which this relay mining difficulty + was computed. + + This is needed to determine how much time has passed + since the last time + + the exponential moving average was computed. + num_relays_ema: + type: string + format: uint64 + description: >- + The exponential moving average of the number of relays + for this service. + target_hash: + type: string + format: byte + description: >- + The target hash determining the difficulty to mine + relays for this service. + + For example, if we use sha256 to hash the + (RelayRequest,ReqlayResponse) tuple, + + and the difficulty has 4 leading zero bits, then the + target hash would be: + + 0b0000111... (until 32 bytes are filled up). + description: >- + RelayMiningDifficulty is a message used to store the + on-chain Relay Mining + + difficulty associated with a specific service ID. + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: pagination.key + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + in: query + required: false + type: string + format: byte + - name: pagination.offset + description: >- + offset is a numeric offset that can be used when key is unavailable. + + It is less efficient than using key. Only one of offset or key + should + + be set. + in: query + required: false + type: string + format: uint64 + - name: pagination.limit + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + in: query + required: false + type: string + format: uint64 + - name: pagination.count_total + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in + UIs. + + count_total is only respected when offset is used. It is ignored + when key + + is set. + in: query + required: false + type: boolean + - name: pagination.reverse + description: >- + reverse is set to true if results are to be returned in the + descending order. + + + Since: cosmos-sdk 0.43 + in: query + required: false + type: boolean + tags: + - Query + /pokt-network/poktroll/tokenomics/relay_mining_difficulty/{serviceId}: + get: + summary: Queries a list of RelayMiningDifficulty items. + operationId: PoktrollTokenomicsQuery_RelayMiningDifficulty + responses: + '200': + description: A successful response. + schema: + type: object + properties: + relayMiningDifficulty: + type: object + properties: + service_id: + type: string + description: >- + The service ID the the relay mining difficulty is + associated with. + block_height: + type: string + format: int64 + description: >- + The block height at which this relay mining difficulty was + computed. + + This is needed to determine how much time has passed since + the last time + + the exponential moving average was computed. + num_relays_ema: + type: string + format: uint64 + description: >- + The exponential moving average of the number of relays for + this service. + target_hash: + type: string + format: byte + description: >- + The target hash determining the difficulty to mine relays + for this service. + + For example, if we use sha256 to hash the + (RelayRequest,ReqlayResponse) tuple, + + and the difficulty has 4 leading zero bits, then the + target hash would be: + + 0b0000111... (until 32 bytes are filled up). + description: >- + RelayMiningDifficulty is a message used to store the on-chain + Relay Mining + + difficulty associated with a specific service ID. + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: serviceId + in: path + required: true + type: string + tags: + - Query definitions: cosmos.auth.v1beta1.MsgUpdateParams: type: object @@ -17972,7 +18789,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -18014,7 +18834,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18024,7 +18844,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -18050,6 +18870,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -18141,7 +18962,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -18186,7 +19010,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18196,7 +19020,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -18222,6 +19046,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -18305,7 +19130,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -18348,7 +19176,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18358,7 +19186,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -18384,6 +19212,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -18485,7 +19314,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -18530,7 +19362,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18540,7 +19372,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -18566,6 +19398,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -18678,7 +19511,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -18723,7 +19559,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -18733,7 +19569,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -18760,6 +19596,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -19705,7 +20542,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -19786,7 +20626,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -19956,7 +20799,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -20031,7 +20877,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -20076,7 +20925,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -20086,7 +20935,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -20112,6 +20961,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -20650,7 +21500,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -21216,7 +22069,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -21259,7 +22115,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -21269,7 +22125,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -21295,6 +22151,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -22367,7 +23224,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -22430,7 +23290,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -22473,7 +23336,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22483,7 +23346,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -22509,6 +23372,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -22592,7 +23456,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -22713,7 +23580,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used + type server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might @@ -22796,7 +23666,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -22894,7 +23767,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -22937,7 +23813,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -22947,7 +23823,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -22973,6 +23849,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -23072,7 +23949,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -23115,7 +23995,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23125,7 +24005,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -23151,6 +24031,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -23277,7 +24158,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -23320,7 +24204,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23330,7 +24214,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -23356,6 +24240,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -23441,7 +24326,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -23484,7 +24372,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23494,7 +24382,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -23520,6 +24408,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -23702,7 +24591,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -23745,7 +24637,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -23755,7 +24647,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -23781,6 +24673,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -24092,7 +24985,10 @@ definitions: protobuf release, and it is not used for type URLs beginning with - type.googleapis.com. + type.googleapis.com. As of May 2023, there are no widely used type + server + + implementations and no plans to implement one. Schemes other than `http`, `https` (or the empty scheme) might be @@ -24135,7 +25031,7 @@ definitions: foo = any.unpack(Foo.getDefaultInstance()); } - Example 3: Pack and unpack a message in Python. + Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() @@ -24145,7 +25041,7 @@ definitions: any.Unpack(foo) ... - Example 4: Pack and unpack a message in Go + Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) @@ -24171,6 +25067,7 @@ definitions: JSON + ==== The JSON representation of an `Any` value uses the regular @@ -24854,13 +25751,202 @@ definitions: poktroll.session.SessionHeader: type: object properties: - application_address: - type: string - title: >- - The Bech32 address of the application using cosmos' ScalarDescriptor - to ensure deterministic encoding + application_address: + type: string + title: >- + The Bech32 address of the application using cosmos' ScalarDescriptor + to ensure deterministic encoding + service: + title: The service this session is for + type: object + properties: + id: + type: string + description: Unique identifier for the service + title: >- + For example, what if we want to request a session for a certain + service but with some additional configs that identify it? + name: + type: string + description: (Optional) Semantic human readable name for the service + title: >- + TODO_TECHDEBT: Name is currently unused but acts as a reminder + that an optional onchain representation of the service is + necessary + session_id: + type: string + description: A unique pseudoranom ID for this session + title: >- + NOTE: session_id can be derived from the above values using on-chain + but is included in the header for convenience + session_start_block_height: + type: string + format: int64 + title: The height at which this session started + session_end_block_height: + type: string + format: int64 + description: >- + Note that`session_end_block_height` is a derivative of (`start` + + `num_blocks_per_session`) + + as goverened by on-chain params at the time of the session start. + + It is stored as an additional field to simplofy business logic in case + + the number of blocks_per_session changes during the session. + + + The height at which this session ended, this is the last block of the + session + description: >- + SessionHeader is a lightweight header for a session that can be passed + around. + + It is the minimal amount of data required to hydrate & retrieve all data + relevant to the session. + cosmos.base.query.v1beta1.PageRequest: + type: object + properties: + key: + type: string + format: byte + description: |- + key is a value returned in PageResponse.next_key to begin + querying the next page most efficiently. Only one of offset or key + should be set. + offset: + type: string + format: uint64 + description: |- + offset is a numeric offset that can be used when key is unavailable. + It is less efficient than using key. Only one of offset or key should + be set. + limit: + type: string + format: uint64 + description: >- + limit is the total number of results to be returned in the result + page. + + If left empty it will default to a value to be set by each app. + count_total: + type: boolean + description: >- + count_total is set to true to indicate that the result set should + include + + a count of the total number of items available for pagination in UIs. + + count_total is only respected when offset is used. It is ignored when + key + + is set. + reverse: + type: boolean + description: >- + reverse is set to true if results are to be returned in the descending + order. + + + Since: cosmos-sdk 0.43 + description: |- + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } + title: |- + PageRequest is to be embedded in gRPC request messages for efficient + pagination. Ex: + cosmos.base.query.v1beta1.PageResponse: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: |- + total is total number of results available if PageRequest.count_total + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + poktroll.service.Params: + type: object + properties: + add_service_fee: + type: string + format: uint64 + description: |- + The amount of uPOKT required to add a new service. + This will be deducted from the signer's account balance, + and transferred to the pocket network foundation. + description: Params defines the parameters for the module. + poktroll.service.QueryAllServicesResponse: + type: object + properties: + service: + type: array + items: + type: object + properties: + id: + type: string + description: Unique identifier for the service + title: >- + For example, what if we want to request a session for a certain + service but with some additional configs that identify it? + name: + type: string + description: (Optional) Semantic human readable name for the service + title: >- + TODO_TECHDEBT: Name is currently unused but acts as a reminder + that an optional onchain representation of the service is + necessary + title: >- + Service message to encapsulate unique and semantic identifiers for a + service on the network + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + poktroll.service.QueryGetServiceResponse: + type: object + properties: service: - title: The service this session is for type: object properties: id: @@ -24876,38 +25962,24 @@ definitions: TODO_TECHDEBT: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary - session_id: - type: string - description: A unique pseudoranom ID for this session title: >- - NOTE: session_id can be derived from the above values using on-chain - but is included in the header for convenience - session_start_block_height: - type: string - format: int64 - title: The height at which this session started - session_end_block_height: - type: string - format: int64 - description: >- - Note that`session_end_block_height` is a derivative of (`start` + - `num_blocks_per_session`) - - as goverened by on-chain params at the time of the session start. - - It is stored as an additional field to simplofy business logic in case - - the number of blocks_per_session changes during the session. - - - The height at which this session ended, this is the last block of the - session - description: >- - SessionHeader is a lightweight header for a session that can be passed - around. - - It is the minimal amount of data required to hydrate & retrieve all data - relevant to the session. + Service message to encapsulate unique and semantic identifiers for a + service on the network + poktroll.service.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + add_service_fee: + type: string + format: uint64 + description: |- + The amount of uPOKT required to add a new service. + This will be deducted from the signer's account balance, + and transferred to the pocket network foundation. + description: QueryParamsResponse is response type for the Query/Params RPC method. poktroll.service.MsgAddService: type: object properties: @@ -24933,19 +26005,11 @@ definitions: TODO_TECHDEBT: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary - description: >- + description: |- MsgAddService defines a message for adding a new message to the network. - Services can be added by any actor in the network making them truly - permissionless. - - TODO_DOCUMENT(@h5law): This is a key function in making services - - permissionless, document it's usage and design - in docusaurus covering - how - - the entire process works. + TODO_IMPLEMENT: Add Champions / Sources once its fully defined. poktroll.service.MsgAddServiceResponse: type: object poktroll.service.MsgUpdateParams: @@ -24975,17 +26039,6 @@ definitions: description: |- MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. - poktroll.service.Params: - type: object - properties: - add_service_fee: - type: string - format: uint64 - description: |- - The amount of uPOKT required to add a new service. - This will be deducted from the signer's account balance, - and transferred to the pocket network foundation. - description: Params defines the parameters for the module. poktroll.session.MsgUpdateParams: type: object properties: @@ -26002,38 +27055,59 @@ definitions: title: >- SupplierServiceConfig holds the service configuration the supplier stakes for - poktroll.shared.Params: - type: object - properties: - num_blocks_per_session: - type: string - format: uint64 - description: Params defines the parameters for the module. - poktroll.shared.QueryParamsResponse: - type: object - properties: - params: - description: params holds all the parameters of this module. - type: object - properties: - num_blocks_per_session: - type: string - format: uint64 - description: QueryParamsResponse is response type for the Query/Params RPC method. poktroll.shared.MsgUpdateParam: type: object properties: authority: type: string + description: >- + authority is the address that controls the module (defaults to x/gov + unless overwritten). name: type: string - asType: + as_string: + type: string + as_int64: + type: string + format: int64 + as_bytes: type: string + format: byte + description: >- + MsgUpdateParam is the Msg/UpdateParam request type to update a single + param. poktroll.shared.MsgUpdateParamResponse: type: object properties: params: - type: string + type: object + properties: + num_blocks_per_session: + type: string + format: uint64 + description: >- + num_blocks_per_session is the number of blocks between the session + start & end heights. + claim_window_open_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_open_offset_blocks is the number of blocks after the + session grace + + period height, at which the claim window opens. + claim_window_close_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_close_offset_blocks is the number of blocks after the + claim window + + open height, at which the claim window closes. + description: Params defines the parameters for the module. + description: |- + MsgUpdateParamResponse defines the response structure for executing a + MsgUpdateParam message after a single param update. poktroll.shared.MsgUpdateParams: type: object properties: @@ -26043,18 +27117,93 @@ definitions: authority is the address that controls the module (defaults to x/gov unless overwritten). params: - description: 'NOTE: All parameters must be supplied.' type: object properties: num_blocks_per_session: type: string format: uint64 + description: >- + num_blocks_per_session is the number of blocks between the session + start & end heights. + claim_window_open_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_open_offset_blocks is the number of blocks after the + session grace + + period height, at which the claim window opens. + claim_window_close_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_close_offset_blocks is the number of blocks after the + claim window + + open height, at which the claim window closes. + description: Params defines the parameters for the module. description: MsgUpdateParams is the Msg/UpdateParams request type. poktroll.shared.MsgUpdateParamsResponse: type: object description: |- MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message. + poktroll.shared.Params: + type: object + properties: + num_blocks_per_session: + type: string + format: uint64 + description: >- + num_blocks_per_session is the number of blocks between the session + start & end heights. + claim_window_open_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_open_offset_blocks is the number of blocks after the + session grace + + period height, at which the claim window opens. + claim_window_close_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_close_offset_blocks is the number of blocks after the + claim window + + open height, at which the claim window closes. + description: Params defines the parameters for the module. + poktroll.shared.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + num_blocks_per_session: + type: string + format: uint64 + description: >- + num_blocks_per_session is the number of blocks between the session + start & end heights. + claim_window_open_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_open_offset_blocks is the number of blocks after the + session grace + + period height, at which the claim window opens. + claim_window_close_offset_blocks: + type: string + format: uint64 + description: >- + claim_window_close_offset_blocks is the number of blocks after the + claim window + + open height, at which the claim window closes. + description: QueryParamsResponse is response type for the Query/Params RPC method. poktroll.supplier.MsgStakeSupplier: type: object properties: @@ -26233,9 +27382,6 @@ definitions: description: >- The amount of upokt that a compute unit should translate to when settling a session. - - TODO_DOCUMENT(@Olshansk): Make sure to document the units of this - parameter (or the map) once finalized. description: Params defines the parameters for the tokenomics module. description: |- MsgUpdateParamResponse defines the response structure for executing a @@ -26257,9 +27403,6 @@ definitions: description: >- The amount of upokt that a compute unit should translate to when settling a session. - - TODO_DOCUMENT(@Olshansk): Make sure to document the units of this - parameter (or the map) once finalized. description: Params defines the parameters for the tokenomics module. description: >- MsgUpdateParams is the Msg/UpdateParams request type to update all params @@ -26278,7 +27421,177 @@ definitions: description: >- The amount of upokt that a compute unit should translate to when settling a session. - - TODO_DOCUMENT(@Olshansk): Make sure to document the units of this - parameter (or the map) once finalized. description: Params defines the parameters for the tokenomics module. + poktroll.tokenomics.QueryAllRelayMiningDifficultyResponse: + type: object + properties: + relayMiningDifficulty: + type: array + items: + type: object + properties: + service_id: + type: string + description: >- + The service ID the the relay mining difficulty is associated + with. + block_height: + type: string + format: int64 + description: >- + The block height at which this relay mining difficulty was + computed. + + This is needed to determine how much time has passed since the + last time + + the exponential moving average was computed. + num_relays_ema: + type: string + format: uint64 + description: >- + The exponential moving average of the number of relays for this + service. + target_hash: + type: string + format: byte + description: >- + The target hash determining the difficulty to mine relays for + this service. + + For example, if we use sha256 to hash the + (RelayRequest,ReqlayResponse) tuple, + + and the difficulty has 4 leading zero bits, then the target hash + would be: + + 0b0000111... (until 32 bytes are filled up). + description: >- + RelayMiningDifficulty is a message used to store the on-chain Relay + Mining + + difficulty associated with a specific service ID. + pagination: + type: object + properties: + next_key: + type: string + format: byte + description: |- + next_key is the key to be passed to PageRequest.key to + query the next page most efficiently. It will be empty if + there are no more results. + total: + type: string + format: uint64 + title: >- + total is total number of results available if + PageRequest.count_total + + was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } + poktroll.tokenomics.QueryGetRelayMiningDifficultyResponse: + type: object + properties: + relayMiningDifficulty: + type: object + properties: + service_id: + type: string + description: The service ID the the relay mining difficulty is associated with. + block_height: + type: string + format: int64 + description: >- + The block height at which this relay mining difficulty was + computed. + + This is needed to determine how much time has passed since the + last time + + the exponential moving average was computed. + num_relays_ema: + type: string + format: uint64 + description: >- + The exponential moving average of the number of relays for this + service. + target_hash: + type: string + format: byte + description: >- + The target hash determining the difficulty to mine relays for this + service. + + For example, if we use sha256 to hash the + (RelayRequest,ReqlayResponse) tuple, + + and the difficulty has 4 leading zero bits, then the target hash + would be: + + 0b0000111... (until 32 bytes are filled up). + description: >- + RelayMiningDifficulty is a message used to store the on-chain Relay + Mining + + difficulty associated with a specific service ID. + poktroll.tokenomics.QueryParamsResponse: + type: object + properties: + params: + description: params holds all the parameters of this module. + type: object + properties: + compute_units_to_tokens_multiplier: + type: string + format: uint64 + description: >- + The amount of upokt that a compute unit should translate to when + settling a session. + description: QueryParamsResponse is response type for the Query/Params RPC method. + poktroll.tokenomics.RelayMiningDifficulty: + type: object + properties: + service_id: + type: string + description: The service ID the the relay mining difficulty is associated with. + block_height: + type: string + format: int64 + description: >- + The block height at which this relay mining difficulty was computed. + + This is needed to determine how much time has passed since the last + time + + the exponential moving average was computed. + num_relays_ema: + type: string + format: uint64 + description: >- + The exponential moving average of the number of relays for this + service. + target_hash: + type: string + format: byte + description: >- + The target hash determining the difficulty to mine relays for this + service. + + For example, if we use sha256 to hash the + (RelayRequest,ReqlayResponse) tuple, + + and the difficulty has 4 leading zero bits, then the target hash would + be: + + 0b0000111... (until 32 bytes are filled up). + description: |- + RelayMiningDifficulty is a message used to store the on-chain Relay Mining + difficulty associated with a specific service ID. diff --git a/docusaurus/docs/develop/contributing/observability.md b/docusaurus/docs/develop/contributing/observability.md index 0cfa542af..ca6c36f82 100644 --- a/docusaurus/docs/develop/contributing/observability.md +++ b/docusaurus/docs/develop/contributing/observability.md @@ -6,7 +6,7 @@ title: Observability guidelines # Work in progress :::warning -We are still refining our observability guidelines. If in doubt - please reach out on `#protocol-public` channel on +We are still refining our observability guidelines. If in doubt - please reach out on `#protocol-public` channel on [Grove Discord](https://discord.gg/build-with-grove). ::: @@ -15,13 +15,12 @@ We are still refining our observability guidelines. If in doubt - please reach o - [Types of Metrics](#types-of-metrics) - [High Cardinality Considerations](#high-cardinality-considerations) - [Best Practices](#best-practices) - - [\[TODO(@okdas)\] Examples](#todookdas-examples) + - [Examples](#examples) - [Counter](#counter) - [Gauage](#gauage) - [Histogram](#histogram) - [Logs](#logs) - ## Metrics ### Overview @@ -57,10 +56,10 @@ the memory usage and reduce the performance of the Prometheus server. To mitigat - **Documentation:** Document each custom metric, including its purpose and any labels used. - **Consistency:** Follow the Prometheus Metric and Label Naming Guide for consistent naming and labeling. See more at [Prometheus Naming Guide](https://prometheus.io/docs/practices/naming/). -### [TODO(@okdas)] Examples +### Examples :::warning -This is a placeholder section so our team remembers to add it in the future. +TODO_DOCUMENT(@okdas): This is a placeholder section so our team remembers to add it in the future. ::: ### Counter @@ -77,4 +76,4 @@ TODO: Add a code example, link to usage, and screenshot of the output. ## Logs -Please refer to our own [polylog package](https://github.com/pokt-network/poktroll/blob/main/pkg/polylog/godoc.go#L1). \ No newline at end of file +Please refer to our own [polylog package](https://github.com/pokt-network/poktroll/blob/main/pkg/polylog/godoc.go#L1). diff --git a/docusaurus/docs/develop/packages/client_events.md b/docusaurus/docs/develop/packages/client_events.md index 408f60b94..a3e5ff989 100644 --- a/docusaurus/docs/develop/packages/client_events.md +++ b/docusaurus/docs/develop/packages/client_events.md @@ -147,7 +147,7 @@ flowchart ### Subscriptions -_TODO_DOCUMENTATION(@bryanchriswhite): Add Legend_ +TODO_DOCUMENT(@bryanchriswhite): Add Legend ```mermaid --- diff --git a/docusaurus/docs/operate/infrastructure/localnet.md b/docusaurus/docs/operate/infrastructure/localnet.md index 5affcd510..8c04b750f 100644 --- a/docusaurus/docs/operate/infrastructure/localnet.md +++ b/docusaurus/docs/operate/infrastructure/localnet.md @@ -5,12 +5,6 @@ title: LocalNet # LocalNet - - ## Background This document walks you through launching a LocalNet that brings up a k8s cluster @@ -103,9 +97,6 @@ If you need to modify Kubernetes resources in your local setup, follow these ste Clone the helm charts locally: -TODO_TECHDEBT(@okdas): Embed `helm-charts` in this repo so we are always using a -local version. - ```bash cd .. && git clone git@github.com:pokt-network/helm-charts.git cd - diff --git a/docusaurus/docs/operate/infrastructure/testnet.md b/docusaurus/docs/operate/infrastructure/testnet.md index 3b2a1f7a6..4812b2bce 100644 --- a/docusaurus/docs/operate/infrastructure/testnet.md +++ b/docusaurus/docs/operate/infrastructure/testnet.md @@ -25,7 +25,7 @@ This page is only relevant to you if you are part of the core protocol team at G - As a part of that ArgoCD Application we have resources such as StatefulSets and ConfigMaps that describe configuration and infrastructure to run validators and seed nodes. Examples: - [testnet-validated.yaml](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1/testnet-validated.yaml) - [testnet-validated-seed.yaml](https://github.com/pokt-network/protocol-infra/blob/main/clusters/protocol-us-central1/testnet-validated-seed.yaml) - + ## Version upgrade diff --git a/docusaurus/docs/operate/testing/load_testing.md b/docusaurus/docs/operate/testing/load_testing.md index b5d5a85da..c30604278 100644 --- a/docusaurus/docs/operate/testing/load_testing.md +++ b/docusaurus/docs/operate/testing/load_testing.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: Load Testing --- -# Load Testing +# Load Testing Poktroll load-testing suite. @@ -43,9 +43,11 @@ k6 run load-testing/tests/appGateServerEtherium.js The `k6` load testing tool provides various command-line flags to customize and control your load tests. Below are some of the key flags that you can use: - `--vus`: Specifies the number of virtual users (VUs) to simulate. This flag allows you to set the concurrency level of your load test. + - Example: `k6 run script.js --vus=50` runs the test with 50 virtual users. - `--duration`: Defines the duration for which the test should run. You can specify the time in seconds (s), minutes (m), or hours (h). + - Example: `k6 run script.js --duration=1m` runs the test for 1 minute. - `--http-debug`: Enables HTTP debugging. This flag can be set to `full` for detailed logging of all HTTP requests and responses. Useful for troubleshooting and debugging your tests. @@ -75,20 +77,20 @@ INFO[0061] [k6-reporter v2.3.0] Generating HTML summary report source=console ✓ is status 200 ✓ is successful JSON-RPC response - checks.........................: 100.00% ✓ 12000 ✗ 0 + checks.........................: 100.00% ✓ 12000 ✗ 0 data_received..................: 1.6 MB 27 kB/s data_sent......................: 1.2 MB 19 kB/s - http_req_blocked...............: avg=52.52µs min=0s med=2µs max=7.08ms p(90)=4µs p(95)=6µs - http_req_connecting............: avg=37.73µs min=0s med=0s max=5.48ms p(90)=0s p(95)=0s + http_req_blocked...............: avg=52.52µs min=0s med=2µs max=7.08ms p(90)=4µs p(95)=6µs + http_req_connecting............: avg=37.73µs min=0s med=0s max=5.48ms p(90)=0s p(95)=0s http_req_duration..............: avg=8.51ms min=1.58ms med=5.98ms max=81.98ms p(90)=15.45ms p(95)=19.97ms { expected_response:true }...: avg=8.51ms min=1.58ms med=5.98ms max=81.98ms p(90)=15.45ms p(95)=19.97ms - http_req_failed................: 0.00% ✓ 0 ✗ 6000 - http_req_receiving.............: avg=42.18µs min=5µs med=25µs max=5.71ms p(90)=65µs p(95)=125µs - http_req_sending...............: avg=26.5µs min=2µs med=9µs max=7.2ms p(90)=21µs p(95)=42µs - http_req_tls_handshaking.......: avg=0s min=0s med=0s max=0s p(90)=0s p(95)=0s + http_req_failed................: 0.00% ✓ 0 ✗ 6000 + http_req_receiving.............: avg=42.18µs min=5µs med=25µs max=5.71ms p(90)=65µs p(95)=125µs + http_req_sending...............: avg=26.5µs min=2µs med=9µs max=7.2ms p(90)=21µs p(95)=42µs + http_req_tls_handshaking.......: avg=0s min=0s med=0s max=0s p(90)=0s p(95)=0s http_req_waiting...............: avg=8.44ms min=1.55ms med=5.93ms max=81.28ms p(90)=15.38ms p(95)=19.82ms http_reqs......................: 6000 98.915624/s - iteration_duration.............: avg=1s min=1s med=1s max=1.08s p(90)=1.01s p(95)=1.02s + iteration_duration.............: avg=1s min=1s med=1s max=1.08s p(90)=1.01s p(95)=1.02s iterations.....................: 6000 98.915624/s vus............................: 100 min=100 max=100 @@ -100,14 +102,13 @@ default ✓ [======================================] 100 VUs 1m0s An HTML report is generated in the execution directory. Open it in your default browser: -``` +```bash open summary.html ``` ### Adding a new load test -TODO(@okdas): Add link to PR next time a new type of load test is added. - +TODO_DOCUMENT(@okdas): Add link to PR next time a new type of load test is added. ### Sophisticated Reporting diff --git a/docusaurus/docs/operate/testing/load_testing_plan_1.md b/docusaurus/docs/operate/testing/load_testing_plan_1.md index 1aff02c58..601cb77c0 100644 --- a/docusaurus/docs/operate/testing/load_testing_plan_1.md +++ b/docusaurus/docs/operate/testing/load_testing_plan_1.md @@ -5,13 +5,6 @@ title: Load Testing - Plan #1 # Load Test #1 - Plan -:::warning - -TODO(@Olshansk, @okdas, @red-0ne, @RawthiL): Please reference the [forum post](https://forum.pokt.network/t/block-sizes-claims-and-proofs-in-the-multi-gateway-era/5060/9) for -an understanding of how it affects the load test plan in practice. - -::: - _This document outlines the first load test for the Shannon upgrade. IT **IS NOT** intended to be an exhaustive evaluation of the entire system's performance. **IT IS** intended to give visibility into the business logic of the platform, and create a baseline for future load tests._ - _All Poktroll `loadtest` issues on GitHub can be found [here](https://github.com/pokt-network/poktroll/issues?q=label%3Aloadtest+sort%3Aupdated-desc)._ @@ -20,6 +13,7 @@ _This document outlines the first load test for the Shannon upgrade. IT **IS NOT - [Goals](#goals) - [Non-Goals](#non-goals) +- [Origin Document](#origin-document) - [Load Profiles](#load-profiles) - [Variable Parameters](#variable-parameters) - [Constant Parameter](#constant-parameter) @@ -59,6 +53,13 @@ _This document outlines the first load test for the Shannon upgrade. IT **IS NOT 7. Accounting for `Failure cases`, since the primary focus is just evaluating happy path scale 8. Anything to do with `Quality of Service` as it is concerned from today’s Gateway POV +## Origin Document + +This [forum post](https://forum.pokt.network/t/block-sizes-claims-and-proofs-in-the-multi-gateway-era/5060/9) from Morse +is a good starting point to gain an understanding of why load testing is important and critical in Shannon. + +https://forum.pokt.network/t/block-sizes-claims-and-proofs-in-the-multi-gateway-era/5060/9 + ## Load Profiles ### Variable Parameters @@ -124,11 +125,11 @@ pie showData - `Data Availability State` - `Disk` could be a limiting factor depending on how quickly state grows | | RAM | CPU | Network | Disk | Time | -|-------------------------|-----|-----|---------|------|------| -| Proof Validation | ❓ | ❓ | | | ❓ | -| Block Generation | ❓ | | | | | -| Block Publishing | | | ❓ | | | -| Data Availability State | | | | ❓ | | +| ----------------------- | --- | --- | ------- | ---- | ---- | +| Proof Validation | ❓ | ❓ | | | ❓ | +| Block Generation | ❓ | | | | | +| Block Publishing | | | ❓ | | | +| Data Availability State | | | | ❓ | | #### 3. AppGate Server (Application, Gateway, etc…) @@ -142,11 +143,11 @@ pie showData - `Response handling` - Slow supplier responses could increase pending relays at the AppGate level (i.e. RAM) | | RAM | CPU | Network | Disk | Time | -|--------------------|-----|-----|---------|------|------| -| Relay Proxies | | | ❓ | | ❓ | -| Caches & State | ❓ | ❓ | | | | -| Request Processing | | | | | ❓ | -| ??? | | | | ❓ | | +| ------------------ | --- | --- | ------- | ---- | ---- | +| Relay Proxies | | | ❓ | | ❓ | +| Caches & State | ❓ | ❓ | | | | +| Request Processing | | | | | ❓ | +| ??? | | | | ❓ | | #### 4. RelayMiner (Supplier, SMT, etc..) @@ -160,11 +161,11 @@ pie showData - `Request generation` - Generating the actual response to the request via the dummy service | | RAM | CPU | Network | Disk | Time | -|---------------------|-----|-----|---------|------|------| -| SMT | ❓ | ❓ | | ❓ | ❓ | -| Caches & State | ❓ | | | | | -| Request Processing | | | | | ❓ | -| Response Generation | | ❓ | ❓ | | ❓ | +| ------------------- | --- | --- | ------- | ---- | ---- | +| SMT | ❓ | ❓ | | ❓ | ❓ | +| Caches & State | ❓ | | | | | +| Request Processing | | | | | ❓ | +| Response Generation | | ❓ | ❓ | | ❓ | ### Out-of-scope diff --git a/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md b/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md index 937b53373..83c83080e 100644 --- a/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md +++ b/docusaurus/docs/protocol/primitives/claim_and_proof_lifecycle.md @@ -12,10 +12,6 @@ understanding of the Pocket Network protocol. It is currently aiming to just be a reference and not provide a coherent narrative that is easily accessible to all readers. -TODO(@Olshansk): Iterate on this doc & link to governance params. - -TODO(@red-0ne): Review this document and submit a PR with updates & edits. - ::: - [Introduction](#introduction) @@ -137,8 +133,6 @@ a certain `Application`. The `sum` in the root of the SMST is the amount of work done. Each leaf has a different `weight` depending on the number of _"compute units"_ that were necessary to service that request. -_TODO_DOCUMENT(@Olshansk): Link to a document on compute units once it it written._ - ### Claim Protobuf A serialized version of the `Claim` is stored on-chain. @@ -153,7 +147,7 @@ You can find the definition for the [CreateClaim Transaction here](https://githu ### CreateClaim Validation -_TODO(@bryanchriswhite, @Olshansk): Update this section once [msg_server_create_claim.go](https://github.com/pokt-network/poktroll/blob/main/proto/poktroll/x/proof/keeper/msg_server_create_claim.go) is fully implemented._ +_TODO_DOCUMENT(@bryanchriswhite, @Olshansk): Update this section once [msg_server_create_claim.go](https://github.com/pokt-network/poktroll/blob/main/proto/poktroll/x/proof/keeper/msg_server_create_claim.go) is fully implemented._ ### Claim Window @@ -164,7 +158,7 @@ or too late, it will be rejected by the protocol. If a `Supplier` fails to submit a `Claim` during the Claim Window, it will forfeit any potential rewards it could earn in exchange for the work done. -_TODO(@Olshansk): Link to the governance params governing this once implemented._ +_TODO_DOCUMENT(@Olshansk): Link to the governance params governing this once implemented._ ## Proof @@ -176,8 +170,6 @@ At most one `Proof` exists for every `Claim`. A `Proof` is necessary for the `Claim` to be validated so the `Supplier` can be rewarded for the work done. -_TODO_DOCUMENT(@Olshansk): Link to a document on compute units once it it written._ - ### Proof Protobuf A serialized version of the `Proof` is stored on-chain. @@ -195,7 +187,7 @@ You can find the definition for the [SubmitProof Transaction here](https://githu ### SubmitProof Validation -_TODO(@bryanchriswhite, @Olshansk): Update this section once [msg_server_submit_proof.go](https://github.com/pokt-network/poktroll/blob/main/proto/poktroll/x/proof/keeper/msg_server_submit_proof.go) is fully implemented._ +_TODO_DOCUMENT(@bryanchriswhite, @Olshansk): Update this section once [msg_server_submit_proof.go](https://github.com/pokt-network/poktroll/blob/main/proto/poktroll/x/proof/keeper/msg_server_submit_proof.go) is fully implemented._ ### Proof Window @@ -206,7 +198,7 @@ early or too late, it will be rejected by the protocol. If a `Supplier` fails to submit a `Proof` during the Proof Window, the Claim will expire and it it will forfeit any previously claimed work done. -_TODO(@Olshansk): Link to the governance params governing this once implemented._ +_TODO_DOCUMENT(@Olshansk): Link to the governance params governing this once implemented._ ## Proof Security diff --git a/docusaurus/docs/protocol/primitives/gateways.md b/docusaurus/docs/protocol/primitives/gateways.md index 28eecb3f3..b44d0a5da 100644 --- a/docusaurus/docs/protocol/primitives/gateways.md +++ b/docusaurus/docs/protocol/primitives/gateways.md @@ -12,10 +12,6 @@ understanding of the Pocket Network protocol. It is currently aiming to just be a reference and not provide a coherent narrative that is easily accessible to all readers. -TODO(@Olshansk): Iterate on this doc & link to governance params. - -TODO(@red-0ne): Review this document and submit a PR with updates & edits. - ::: - [Introduction](#introduction) @@ -26,7 +22,7 @@ TODO(@red-0ne): Review this document and submit a PR with updates & edits. - [Application -\> Gateway Delegation](#application---gateway-delegation) - [Relay Signatures](#relay-signatures) - [Delegating Application Example](#delegating-application-example) -- [Gateway Off-Chain Operations](#gateway-off-chain-operations) +- [\[WIP\] Gateway Off-Chain Operations](#wip-gateway-off-chain-operations) ## Introduction @@ -282,11 +278,6 @@ As an example, consider an `Application` that has delegated to two independent one of `Application`, `Gateway 1`, or `Gateway 2`. - The `Application` is always the one paying for the service. - - ```mermaid flowchart S[Supplier] @@ -338,9 +329,7 @@ stateDiagram-v2 sigCheck --> Invalid: No ``` -## Gateway Off-Chain Operations - -TODO(@olshansk, @moatus): Expand on this section. +## [WIP] Gateway Off-Chain Operations Gateways can design and manage off-chain operations to coordinate with the `Client` including by not limited to: diff --git a/docusaurus/docs/protocol/primitives/probabilistic_proofs.md b/docusaurus/docs/protocol/primitives/probabilistic_proofs.md index fd664fae1..5b7b8d169 100644 --- a/docusaurus/docs/protocol/primitives/probabilistic_proofs.md +++ b/docusaurus/docs/protocol/primitives/probabilistic_proofs.md @@ -7,7 +7,7 @@ sidebar_position: 3 :::warning -TODO(@Olshansk): This is just a placeholder. Use the [probabilistic proofs](https://github.com/pokt-network/pocket-core/blob/staging/docs/proposals/probabilistic_proofs.md) design +TODO_DOCUMENT(@Olshansk): This is just a placeholder. Use the [probabilistic proofs](https://github.com/pokt-network/pocket-core/blob/staging/docs/proposals/probabilistic_proofs.md) design document as a reference for writing this. ::: diff --git a/docusaurus/docs/protocol/primitives/relay_mining.md b/docusaurus/docs/protocol/primitives/relay_mining.md index 60cc67720..300c24a31 100644 --- a/docusaurus/docs/protocol/primitives/relay_mining.md +++ b/docusaurus/docs/protocol/primitives/relay_mining.md @@ -7,7 +7,7 @@ sidebar_position: 3 :::warning -TODO(@Olshansk): This is just a placeholder. Use the [relay mining presentation](https://docs.google.com/presentation/d/1xlCGzS_oHXJOzvcu-jHZUfmhD3qeVCzc6SUSJijTuJ4/edit#slide=id.p) and +TODO_DOCUMENT(@Olshansk): This is just a placeholder. Use the [relay mining presentation](https://docs.google.com/presentation/d/1xlCGzS_oHXJOzvcu-jHZUfmhD3qeVCzc6SUSJijTuJ4/edit#slide=id.p) and the [relay mining paper](https://arxiv.org/abs/2305.10672) as a reference for writing this. ::: diff --git a/docusaurus/docs/protocol/primitives/session.md b/docusaurus/docs/protocol/primitives/session.md index 50472d61b..1dedb2cc8 100644 --- a/docusaurus/docs/protocol/primitives/session.md +++ b/docusaurus/docs/protocol/primitives/session.md @@ -7,7 +7,7 @@ sidebar_position: 1 :::warning -TODO(@Olshansk): This is just a placeholder. Use the session part of the [utility spec](https://github.com/pokt-network/pocket-network-protocol/tree/main/utility) to fill this section out. +TODO_DOCUMENT(@Olshansk): This is just a placeholder. Use the session part of the [utility spec](https://github.com/pokt-network/pocket-network-protocol/tree/main/utility) to fill this section out. ::: diff --git a/e2e/tests/session.feature b/e2e/tests/session.feature index 36e88e513..9dc86a09b 100644 --- a/e2e/tests/session.feature +++ b/e2e/tests/session.feature @@ -5,9 +5,9 @@ Feature: Session Namespace When the supplier "supplier1" has serviced a session with "5" relays for service "svc1" for application "app1" And the user should wait for the "proof" module "CreateClaim" Message to be submitted Then the claim created by supplier "supplier1" for service "svc1" for application "app1" should be persisted on-chain - # TODO_IMPROVE(@bryanchriswhite): And a cosmos-sdk event (e.g. EventClaimCreated) should be emitted. + # TODO_BLOCKER(@bryanchriswhite): And a cosmos-sdk event (e.g. EventClaimCreated) should be emitted. And the user should wait for the "proof" module "SubmitProof" Message to be submitted - # TODO_IMPROVE(@bryanchriswhite): And a cosmos-sdk event (e.g. EventClaimCreated) should be emitted. + # TODO_BLOCKER(@bryanchriswhite): And a cosmos-sdk event (e.g. EventClaimCreated) should be emitted. Then the proof submitted by supplier "supplier1" for service "svc1" for application "app1" should be persisted on-chain # TODO_BLOCKER(@red-0ne): Make sure to implement and validate this test diff --git a/e2e/tests/stake_app.feature b/e2e/tests/stake_app.feature index b3c1cd9a1..b88b437f3 100644 --- a/e2e/tests/stake_app.feature +++ b/e2e/tests/stake_app.feature @@ -10,7 +10,7 @@ Feature: Stake App Namespaces Then the user should be able to see standard output containing "txhash:" And the user should be able to see standard output containing "code: 0" And the pocketd binary should exit without error - # TODO_TECHDEBT: Wait for an admitted stake event instead of a time based waiting. + # TODO_TECHDEBT(@red-0ne): Wait for an admitted stake event instead of a time based waiting. And the user should wait for "5" seconds And the "application" for account "app2" is staked with "1000070" uPOKT And the account balance of "app2" should be "1000070" uPOKT "less" than before diff --git a/e2e/tests/stake_gateway.feature b/e2e/tests/stake_gateway.feature index 81bc5ad3b..bbfc5bb9c 100644 --- a/e2e/tests/stake_gateway.feature +++ b/e2e/tests/stake_gateway.feature @@ -8,7 +8,7 @@ Feature: Stake Gateway Namespaces Then the user should be able to see standard output containing "txhash:" And the user should be able to see standard output containing "code: 0" And the pocketd binary should exit without error - # TODO_TECHDEBT(@Olshansk, @red-0ne): Replace these time-based waits with event listening waits + # TODO_TECHDEBT(@red-0ne): Replace these time-based waits with event listening waits And the user should wait for "5" seconds And the "gateway" for account "gateway2" is staked with "1000070" uPOKT And the account balance of "gateway2" should be "1000070" uPOKT "less" than before diff --git a/e2e/tests/stake_supplier.feature b/e2e/tests/stake_supplier.feature index fc7776c64..52f84989d 100644 --- a/e2e/tests/stake_supplier.feature +++ b/e2e/tests/stake_supplier.feature @@ -10,7 +10,7 @@ Feature: Stake Supplier Namespace Then the user should be able to see standard output containing "txhash:" And the user should be able to see standard output containing "code: 0" And the pocketd binary should exit without error - # TODO_TECHDEBT(@Olshansk, @red-0ne): Replace these time-based waits with event listening waits + # TODO_TECHDEBT(@red-0ne): Replace these time-based waits with event listening waits And the user should wait for "5" seconds And the "supplier" for account "supplier2" is staked with "1000070" uPOKT And the account balance of "supplier2" should be "1000070" uPOKT "less" than before diff --git a/e2e/tests/update_params.feature b/e2e/tests/update_params.feature index 6277d0215..af9a9deda 100644 --- a/e2e/tests/update_params.feature +++ b/e2e/tests/update_params.feature @@ -1,7 +1,4 @@ Feature: Params Namespace - # TODO_DOCUMENT(@Olshansk): Document all of the on-chain governance parameters. - - Background: Scenario: An unauthorized user cannot update a module params Given the user has the pocketd binary installed diff --git a/load-testing/tests/relays_stress_helpers_test.go b/load-testing/tests/relays_stress_helpers_test.go index f16c4f0d0..3a512eefa 100644 --- a/load-testing/tests/relays_stress_helpers_test.go +++ b/load-testing/tests/relays_stress_helpers_test.go @@ -49,7 +49,7 @@ import ( // actorLoadTestIncrementPlans is a struct that holds the parameters for incrementing // all actors over the course of the load test. // -// TODO_UPNEXT(@red-One, @bryanchriswhite) move to a new file. +// TODO_TECHDEBT(@bryanchriswhite): move to a new file. type actorLoadTestIncrementPlans struct { apps actorLoadTestIncrementPlan gateways actorLoadTestIncrementPlan @@ -60,7 +60,7 @@ type actorLoadTestIncrementPlans struct { // actorLoadTestIncrementPlan is a struct that holds the parameters for incrementing // the number of any single actor type over the course of the load test. // -// TODO_UPNEXT(@red-One, @bryanchriswhite) move to a new file. +// TODO_TECHDEBT(@bryanchriswhite): move to a new file. type actorLoadTestIncrementPlan struct { // initialActorCount is the number of actors which will be ready // (i.e., funded, staked, and delegated, if applicable) at the start @@ -716,7 +716,7 @@ func (s *relaysSuite) sendDelegateInitialAppsTxs(apps, gateways []*accountInfo) // shouldIncrementActor returns true if the actor should be incremented based on // the sessionInfo provided and the actor's scaling parameters. // -// TODO_UPNEXT(@red-One, @bryanchriswhite) move to a new file. +// TODO_TECHDEBT(@bryanchriswhite): move to a new file. func (plan *actorLoadTestIncrementPlan) shouldIncrementActorCount( sharedParams *sharedtypes.Params, sessionInfo *sessionInfoNotif, @@ -729,7 +729,7 @@ func (plan *actorLoadTestIncrementPlan) shouldIncrementActorCount( } initialSessionNumber := testsession.GetSessionNumberWithDefaultParams(startBlockHeight) - // TODO_TECHDEBT(#21): replace with gov param query when available. + // TODO_BLOCKER(@bryanchriswhite): replace with gov param query when available. actorSessionIncRate := plan.blocksPerIncrement / int64(sharedParams.GetNumBlocksPerSession()) nextSessionNumber := sessionInfo.sessionNumber + 1 - initialSessionNumber isSessionStartHeight := sessionInfo.blockHeight == sessionInfo.sessionStartBlockHeight @@ -756,7 +756,7 @@ func (plan *actorLoadTestIncrementPlan) shouldIncrementSupplierCount( } initialSessionNumber := testsession.GetSessionNumberWithDefaultParams(startBlockHeight) - // TODO_TECHDEBT(#21): replace with gov param query when available. + // TODO_BLOCKER(@bryanchriswhite): replace with gov param query when available. supplierSessionIncRate := plan.blocksPerIncrement / int64(sharedParams.GetNumBlocksPerSession()) nextSessionNumber := sessionInfo.sessionNumber + 1 - initialSessionNumber isSessionEndHeight := sessionInfo.blockHeight == sessionInfo.sessionEndBlockHeight @@ -913,7 +913,7 @@ func (s *relaysSuite) sendStakeGatewaysTxs( // signWithRetries signs the transaction with the keyName provided, retrying // up to maxRetries times if the signing fails. -// TODO_INVESTIGATE: SignTx randomly fails at retrieving the account info with +// TODO_MAINNET: SignTx randomly fails at retrieving the account info with // the error post failed: Post "http://localhost:36657": EOF. This might be due to // concurrent requests trying to access the same account info and needs to be investigated. func (s *relaysSuite) signWithRetries( @@ -1016,7 +1016,7 @@ func (s *relaysSuite) waitUntilLatestBlockHeightEquals(targetHeight int64) int { // If the latest block height is greater than the txResult height, // then there is no way to know how many transactions to collect and the // should be test is canceled. - // TODO_IMPROVEMENT: Cache the transactions count of each observed block + // TODO_MAINNET: Cache the transactions count of each observed block // to avoid this issue. if s.latestBlock.Height() > targetHeight { s.Fatal("latest block height is greater than the txResult height; tx event not observed") @@ -1048,7 +1048,7 @@ func (s *relaysSuite) sendRelay(iteration uint64, relayPayload string) (appAddre // Use the pre-defined service ID that all application and suppliers are staking for. gatewayUrl.Path = testedService.Id - // TODO_TECHDEBT: Capture the relay response to check for failing relays. + // TODO_MAINNET: Capture the relay response to check for failing relays. // Send the relay request within a goroutine to avoid blocking the test batches // when suppliers or gateways are unresponsive. go func(gwURL, payload string) { diff --git a/pkg/appgateserver/config/appgate_configs_reader.go b/pkg/appgateserver/config/appgate_configs_reader.go index 8ee4a2301..1936835ab 100644 --- a/pkg/appgateserver/config/appgate_configs_reader.go +++ b/pkg/appgateserver/config/appgate_configs_reader.go @@ -7,7 +7,7 @@ import ( ) // YAMLAppGateServerConfig is the structure used to unmarshal the AppGateServer config file -// TODO_TECHDEBT: Rename self_signing parameter to `sovereign` in code, configs +// TODO_BETA: Rename self_signing parameter to `sovereign` in code, configs // and documentation type YAMLAppGateServerConfig struct { ListeningEndpoint string `yaml:"listening_endpoint"` diff --git a/pkg/appgateserver/endpoint_selector.go b/pkg/appgateserver/endpoint_selector.go index 70e0da95a..778e0bf42 100644 --- a/pkg/appgateserver/endpoint_selector.go +++ b/pkg/appgateserver/endpoint_selector.go @@ -8,10 +8,11 @@ import ( sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) -// TODO_IMPROVE: Use a more sophisticated endpoint selection strategy. -// Future optimizations (e.g. Quality-of-Service) can be introduced here. -// TODO(@h5law): Look into different endpoint selection depending on their suitability. -// getRelayerUrl gets the URL of the relayer for the given service. +// getRelayerUrl returns the next relayer endpoint to use for the given serviceId and rpcType. +// NB: This is a naive implementation of the endpoint selection strategy. +// It is intentionally kept simple for the sake of a clear example, and future +// optimizations (i.e. quality of service implementations) are left as an exercise +// to gateways. func (app *appGateServer) getRelayerUrl( serviceId string, rpcType sharedtypes.RPCType, diff --git a/pkg/appgateserver/server.go b/pkg/appgateserver/server.go index ea806c37c..1d76569e6 100644 --- a/pkg/appgateserver/server.go +++ b/pkg/appgateserver/server.go @@ -224,7 +224,7 @@ func (app *appGateServer) ServeHTTP(writer http.ResponseWriter, request *http.Re // Put the request body bytes back into the request body. request.Body = io.NopCloser(bytes.NewBuffer(requestPayloadBz)) - // TODO(@h5law, @red0ne): Add support for asynchronous relays, and switch on + // TODO_IMPROVE(@red-0ne): Add support for asynchronous relays, and switch on // the request type here. // TODO_RESEARCH: Should this be started in a goroutine, to allow for // concurrent requests from numerous applications? diff --git a/pkg/client/block/client.go b/pkg/client/block/client.go index 0192b5ee8..07ab0df44 100644 --- a/pkg/client/block/client.go +++ b/pkg/client/block/client.go @@ -21,7 +21,7 @@ const ( // defaultBlocksReplayLimit is the number of blocks that the replay // observable returned by LastNBlocks() will be able to replay. - // TODO_TECHDEBT/TODO_FUTURE: add a `blocksReplayLimit` field to the blockReplayClient + // TODO_TECHDEBT: add a `blocksReplayLimit` field to the blockReplayClient // struct that defaults to this but can be overridden via an option. defaultBlocksReplayLimit = 100 ) diff --git a/pkg/client/block/client_integration_test.go b/pkg/client/block/client_integration_test.go index 77fa321c8..50fe62a94 100644 --- a/pkg/client/block/client_integration_test.go +++ b/pkg/client/block/client_integration_test.go @@ -14,12 +14,12 @@ import ( "github.com/pokt-network/poktroll/testutil/testclient/testblock" ) -// TODO(#255): Refactor this integration test to use an in-memory simulated network +// TODO_IMPROVE(@bryanchriswhite, #255): Refactor this integration test to use an in-memory simulated network const blockIntegrationSubTimeout = 5 * time.Second func TestBlockClient_LastBlock(t *testing.T) { - t.Skip("TODO(@h5law): Figure out how to subscribe to events on the simulated localnet") + t.Skip("TODO_IMPROVE(@bryanchriswhite): Figure out how to subscribe to events on the simulated localnet") ctx := context.Background() blockClient := testblock.NewLocalnetClient(ctx, t) @@ -32,7 +32,7 @@ func TestBlockClient_LastBlock(t *testing.T) { } func TestBlockClient_BlocksObservable(t *testing.T) { - t.Skip("TODO(@h5law): Figure out how to subscribe to events on the simulated localnet") + t.Skip("TODO_IMPROVE(@bryanchriswhite): Figure out how to subscribe to events on the simulated localnet") ctx := context.Background() blockClient := testblock.NewLocalnetClient(ctx, t) diff --git a/pkg/client/block/client_test.go b/pkg/client/block/client_test.go index 0817eb905..170215011 100644 --- a/pkg/client/block/client_test.go +++ b/pkg/client/block/client_test.go @@ -150,7 +150,7 @@ func TestBlockClient(t *testing.T) { blockClient.Close() } -// TODO_BLOCKER: Fix duplicate definitions of this type across tests & source code. +// TODO_TECHDEBT: Fix duplicate definitions of this type across tests & source code. // This duplicates the unexported `cometBlockEvent` from `pkg/client/block/block.go`. // We need to answer the following questions to avoid this: // - Should tests be their own packages? (i.e. `package block` vs `package block_test`) diff --git a/pkg/client/delegation/client.go b/pkg/client/delegation/client.go index 00f45e2fa..54b922521 100644 --- a/pkg/client/delegation/client.go +++ b/pkg/client/delegation/client.go @@ -27,7 +27,7 @@ const ( // defaultRedelegationsReplayLimit is the number of redelegations that the // replay observable returned by LastNRedelegations() will be able to replay. - // TODO_TECHDEBT/TODO_FUTURE: add a `redelegationsReplayLimit` field to the + // TODO_TECHDEBT: add a `redelegationsReplayLimit` field to the // delegation client struct that defaults to this but can be overridden via // an option in future work. defaultRedelegationsReplayLimit = 100 diff --git a/pkg/client/delegation/client_integration_test.go b/pkg/client/delegation/client_integration_test.go index 1ea3cbaec..48b01a1d4 100644 --- a/pkg/client/delegation/client_integration_test.go +++ b/pkg/client/delegation/client_integration_test.go @@ -1,13 +1,7 @@ package delegation_test -// TODO(@h5law): Figure out how to use real components of the localnet -// - Create app and gateway actors -// - Stake them -// - Delegate to the gateway -// - Undelegate from the gateway -// Currently this test doesn't work, because (I think) it is using a mock -// keeper etc and this isn't actually interacting with the localnet where -// the DelegationClient is listening for events from. +// TODO_TECHDEBT(@bryanchriswhite): Consider refactoring / deleting these tests +// to import ( "context" @@ -31,11 +25,11 @@ const ( delegationIntegrationSubTimeout = 180 * time.Second ) -// TODO_UPNEXT(@h5law): Figure out the correct way to subscribe to events on the -// simulated localnet. Currently this test doesn't work. Although the delegation +// TODO_TEST(@bryanchriswhite): Figure out the correct way to subscribe to events +// on the simulated localnet. Currently this test doesn't work. Although the delegation // client subscribes it doesn't receive any events. func TestDelegationClient_RedelegationsObservables(t *testing.T) { - t.Skip("TODO(@h5law): Figure out how to subscribe to events on the simulated localnet") + t.Skip("TODO_TEST(@bryanchriswhite): Figure out how to subscribe to events on the simulated localnet") // Create the network with 2 applications and 1 gateway net, appAddresses, gatewayAddr := createNetworkWithApplicationsAndGateways(t) ctx, cancel := context.WithCancel(context.Background()) diff --git a/pkg/client/events/replay_client.go b/pkg/client/events/replay_client.go index 73db3acd1..938b03bd3 100644 --- a/pkg/client/events/replay_client.go +++ b/pkg/client/events/replay_client.go @@ -77,7 +77,7 @@ type replayClient[T any] struct { // events bytes observable returns an error and is updated with a new // "active" observable after a new events query subscription is created. // - // TODO_REFACTOR(@h5law): Look into making this a regular observable as + // TODO_TECHDEBT(@bryanchriswhite): Look into making this a regular observable as // we may no longer depend on it being replayable. replayObsCache observable.ReplayObservable[observable.ReplayObservable[T]] // replayObsCachePublishCh is the publish channel for replayObsCache. @@ -128,7 +128,7 @@ func NewEventsReplayClient[T any]( opt(rClient) } - // TODO_REFACTOR(@h5law): Look into making this a regular observable as + // TODO_TECHDEBT(@bryanchriswhite): Look into making this a regular observable as // we may no longer depend on it being replayable. replayObsCache, replayObsCachePublishCh := channel.NewReplayObservable[observable.ReplayObservable[T]]( ctx, diff --git a/pkg/client/interface.go b/pkg/client/interface.go index 9376cbad7..4beef582b 100644 --- a/pkg/client/interface.go +++ b/pkg/client/interface.go @@ -47,7 +47,7 @@ type SupplierClient interface { // SubmitProof sends proof messages which contain the smt.SparseMerkleClosestProof, // corresponding to some previously created claim for the same session. // The proof is validated on-chain as part of the pocket protocol. - // TODO_IMPROVE(#427): Use SparseCompactClosestProof here to reduce + // TODO_MAINNET(#427): Use SparseCompactClosestProof here to reduce // the amount of data stored on-chain. SubmitProofs( ctx context.Context, diff --git a/pkg/client/query/sharedquerier.go b/pkg/client/query/sharedquerier.go index 619bf7ee1..9db03a3b7 100644 --- a/pkg/client/query/sharedquerier.go +++ b/pkg/client/query/sharedquerier.go @@ -61,7 +61,7 @@ func (sq *sharedQuerier) GetParams(ctx context.Context) (*sharedtypes.Params, er // TODO_TECHDEBT(#543): We don't really want to have to query the params for every method call. // Once `ModuleParamsClient` is implemented, use its replay observable's `#Last()` method // to get the most recently (asynchronously) observed (and cached) value. -// TODO_BLOCKER(#543): We also don't really want to use the current value of the params. Instead, +// TODO_BLOCKER(@bryanchriswhite,#543): We also don't really want to use the current value of the params. Instead, // we should be using the value that the params had for the session which includes queryHeight. func (sq *sharedQuerier) GetClaimWindowOpenHeight(ctx context.Context, queryHeight int64) (int64, error) { sharedParams, err := sq.GetParams(ctx) diff --git a/pkg/client/tx/client.go b/pkg/client/tx/client.go index 430f71aaf..43ebf4412 100644 --- a/pkg/client/tx/client.go +++ b/pkg/client/tx/client.go @@ -39,7 +39,7 @@ const ( txWithSenderAddrQueryFmt = "tm.event='Tx' AND message.sender='%s'" ) -// TODO_TECHDEBT(@bryanchriswhite/@h5law): Refactor this to use the EventsReplayClient +// TODO_TECHDEBT(@bryanchriswhite): Refactor this to use the EventsReplayClient // In order to simplify the logic of the TxClient var _ client.TxClient = (*txClient)(nil) diff --git a/pkg/client/tx/client_test.go b/pkg/client/tx/client_test.go index 66e93189a..297cd0fab 100644 --- a/pkg/client/tx/client_test.go +++ b/pkg/client/tx/client_test.go @@ -42,7 +42,7 @@ const ( // TODO_TECHDEBT: add coverage for the transactions client handling an events bytes error either. func TestTxClient_SignAndBroadcast_Succeeds(t *testing.T) { - t.Skip("TODO_BLOCKER(#425): Revisit Observable test tooling & fix flaky test") + t.Skip("TODO_TECHDEBT(@bryanchriswhite, #425): Revisit Observable test tooling & fix flaky test") var ( // expectedTx is the expected transactions bytes that will be signed and broadcast // by the transaction client. It is computed and assigned in the diff --git a/pkg/crypto/rings/client.go b/pkg/crypto/rings/client.go index a1b8ea0a8..6b1668656 100644 --- a/pkg/crypto/rings/client.go +++ b/pkg/crypto/rings/client.go @@ -279,7 +279,7 @@ func (rc *ringClient) GetRingAddressesAtBlock( // TODO_TECHDEBT(#543): We don't really want to have to query the params for every method call. // Once `ModuleParamsClient` is implemented, use its replay observable's `#Last` method // to get the most recently (asynchronously) observed (and cached) value. - // TODO_BLOCKER(#543): We also don't really want to use the current value of the params. + // TODO_BLOCKER(@bryanchriswhite, #543): We also don't really want to use the current value of the params. // Instead, we should be using the value that the params had for the session given by blockHeight. sharedParams, err := rc.sharedQuerier.GetParams(ctx) if err != nil { diff --git a/pkg/observable/channel/observable_test.go b/pkg/observable/channel/observable_test.go index 0f017ae83..463368959 100644 --- a/pkg/observable/channel/observable_test.go +++ b/pkg/observable/channel/observable_test.go @@ -249,7 +249,7 @@ func TestChannelObservable_UnsubscribeObservers(t *testing.T) { } } -// TODO_INCOMPLETE/TODO_TECHDEBT: Implement `TestChannelObservable_ConcurrentSubUnSub` +// TODO_IMPROVE: Implement `TestChannelObservable_ConcurrentSubUnSub` func TestChannelObservable_ConcurrentSubUnSub(t *testing.T) { t.Skip("add coverage: subscribing and unsubscribing concurrently should not race") } @@ -323,7 +323,7 @@ func TestChannelObservable_SequentialPublishAndUnsubscription(t *testing.T) { } } -// TODO_TECHDEBT/TODO_INCOMPLETE: add coverage for active observers closing when publishCh closes. +// TODO_IMPROVE: add coverage for active observers closing when publishCh closes. func TestChannelObservable_ObserversCloseOnPublishChannelClose(t *testing.T) { t.Skip("add coverage: all observers should unsubscribe when publishCh closes") } diff --git a/pkg/observable/channel/observer.go b/pkg/observable/channel/observer.go index 98f43a99b..27d1388b1 100644 --- a/pkg/observable/channel/observer.go +++ b/pkg/observable/channel/observer.go @@ -139,7 +139,7 @@ func (obsvr *channelObserver[V]) notify(value V) { // release the read-lock to give write-lockers a turn. This case // continues the loop, re-read-locking and trying again. case <-sendRetryTicker.C: - // TODO_IMPROVE/TODO_CONSIDERATION: this is where we would implement + // TODO_IMPROVE: this is where we would implement // some backpressure strategy. It would be good to have a simple fail- // safe strategy that can be used by default; e.g. dropping the oldest // value if its buffer is full. diff --git a/pkg/partials/errors.go b/pkg/partials/errors.go index 887a3f34c..4931f1937 100644 --- a/pkg/partials/errors.go +++ b/pkg/partials/errors.go @@ -5,5 +5,5 @@ import sdkerrors "cosmossdk.io/errors" var ( codespace = "partial" ErrPartialInvalidPayload = sdkerrors.Register(codespace, 1, "invalid partial payload") - ErrPartialUnrecognisedRequestFormat = sdkerrors.Register(codespace, 2, "unrecognised request format in partial payload") + ErrPartialUnrecognizedRequestFormat = sdkerrors.Register(codespace, 2, "unrecognized request format in partial payload") ) diff --git a/pkg/partials/partial.go b/pkg/partials/partial.go index 1e699c1b4..61fcf3478 100644 --- a/pkg/partials/partial.go +++ b/pkg/partials/partial.go @@ -47,7 +47,7 @@ func GetComputeUnits(ctx context.Context, payloadBz []byte) (uint64, error) { return partialRequest.GetRPCComputeUnits(ctx) } -// TODO_BLOCKER(@h5law): This function currently only supports JSON-RPC and must +// TODO_BLOCKER(@red-0ne): This function currently only supports JSON-RPC and must // be extended to other request types. // PartiallyUnmarshalRequest unmarshals the payload into a partial request // that contains only the fields necessary to generate an error response and @@ -66,6 +66,6 @@ func PartiallyUnmarshalRequest(ctx context.Context, payloadBz []byte) (PartialPa if jsonPayload != nil { return jsonPayload, nil } - // TODO(@h5law): Handle other request types - return nil, ErrPartialUnrecognisedRequestFormat.Wrapf("got: %s", string(payloadBz)) + // TODO_BLOCKER(@red-0ne): Handle other request types + return nil, ErrPartialUnrecognizedRequestFormat.Wrapf("got: %s", string(payloadBz)) } diff --git a/pkg/partials/partials_test.go b/pkg/partials/partials_test.go index 84c749b2a..e0ae850f0 100644 --- a/pkg/partials/partials_test.go +++ b/pkg/partials/partials_test.go @@ -14,8 +14,8 @@ import ( sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) -// TODO(@h5law): Expand coverage with more test cases when more request types -// are implemented in the partials package. +// TODO_TEST(@red-0ne): Expand coverage with more test cases when more request +// types are implemented in the partials package. func TestPartials_GetErrorReply(t *testing.T) { _, logCtx := testpolylog.NewLoggerWithCtx( context.Background(), @@ -41,18 +41,18 @@ func TestPartials_GetErrorReply(t *testing.T) { expectedErr: nil, }, { - name: "invalid json - unrecognised payload", + name: "invalid json - unrecognized payload", err: errors.New("test error"), payload: []byte(`{"invalid": "payload"}`), expectedReply: nil, - expectedErr: ErrPartialUnrecognisedRequestFormat, + expectedErr: ErrPartialUnrecognizedRequestFormat, }, { - name: "invalid - unrecognised payload", + name: "invalid - unrecognized payload", err: errors.New("test error"), payload: []byte("invalid payload"), expectedReply: nil, - expectedErr: ErrPartialUnrecognisedRequestFormat, + expectedErr: ErrPartialUnrecognizedRequestFormat, }, } diff --git a/pkg/partials/payloads/jsonrpc.go b/pkg/partials/payloads/jsonrpc.go index 284a6f40c..78d55fbea 100644 --- a/pkg/partials/payloads/jsonrpc.go +++ b/pkg/partials/payloads/jsonrpc.go @@ -77,6 +77,6 @@ func (j *PartialJSONPayload) GenerateErrorPayload(err error) ([]byte, error) { // GetRPCComputeUnits returns the compute units for the RPC request func (j *PartialJSONPayload) GetRPCComputeUnits(ctx context.Context) (uint64, error) { - // TODO(@h5law): Implement this method + // TODO_BLOCKER(@red-0ne): Implement this method return 0, nil } diff --git a/pkg/partials/payloads/rest.go b/pkg/partials/payloads/rest.go index 273139280..1dc5a163f 100644 --- a/pkg/partials/payloads/rest.go +++ b/pkg/partials/payloads/rest.go @@ -18,7 +18,7 @@ type PartialRESTPayload struct { // is returned, if however the struct does not contain all the required fields // the success return value is false and a nil payload is returned. func PartiallyUnmarshalRESTPayload(payloadBz []byte) (restPayload *PartialRESTPayload, success bool) { - // TODO(@h5law): Implement this function + // TODO_BLOCKER(@red-0ne): Implement this function return nil, false } @@ -27,7 +27,7 @@ func PartiallyUnmarshalRESTPayload(payloadBz []byte) (restPayload *PartialRESTPa // It uses a non-pointer receiver to ensure the default values of unset fields // are present func (r PartialRESTPayload) ValidateBasic(ctx context.Context) error { - // TODO(@h5law): Implement this function + // TODO_BLOCKER(@red-0ne): Implement this function var err error return err } @@ -40,12 +40,12 @@ func (r *PartialRESTPayload) GetRPCType() types.RPCType { // GenerateErrorPayload creates a REST error payload using the headers from the // request payload. func (r *PartialRESTPayload) GenerateErrorPayload(err error) ([]byte, error) { - // TODO(@h5law): Implement this method + // TODO_BLOCKER(@red-0ne): Implement this method return nil, nil } // GetRPCComputeUnits returns the compute units for the RPC request func (r *PartialRESTPayload) GetRPCComputeUnits(ctx context.Context) (uint64, error) { - // TODO(@h5law): Implement this method + // TODO_BLOCKER(@red-0ne): Implement this method return 0, nil } diff --git a/pkg/relayer/miner/gen/gen_fixtures.go b/pkg/relayer/miner/gen/gen_fixtures.go index 59071d9ab..358cd722e 100644 --- a/pkg/relayer/miner/gen/gen_fixtures.go +++ b/pkg/relayer/miner/gen/gen_fixtures.go @@ -152,7 +152,7 @@ func genRandomizedMinedRelayFixtures( Res: nil, } - // TODO_BLOCKER: use canonical codec. + // TODO_TECHDEBT(@red-0ne): use canonical codec. relayBz, err := relay.Marshal() if err != nil { errCh <- err @@ -293,7 +293,7 @@ func newMapRelayMarshalLineFmt[T marshalable](lineFmt string) channel.MapFn[T, s _ context.Context, marsh T, ) (_ string, skip bool) { - // TODO_BLOCKER: marshal using canonical codec. + // TODO_TECHDEBT(@red-0ne): marshal using canonical codec. minedRelayBz, err := marsh.Marshal() if err != nil { log.Fatal(err) diff --git a/pkg/relayer/miner/miner.go b/pkg/relayer/miner/miner.go index 516896be2..fb3bed054 100644 --- a/pkg/relayer/miner/miner.go +++ b/pkg/relayer/miner/miner.go @@ -15,7 +15,7 @@ import ( var ( _ relayer.Miner = (*miner)(nil) - // TODO_BLOCKER: query on-chain governance params once available. + // TODO_BLOCKER(@Olshansk): query on-chain governance params once available. // Setting this to 0 to effectively disables mining for now. // I.e., all relays are added to the tree. defaultRelayDifficultyBits = 0 @@ -28,7 +28,7 @@ var ( // Available options: // - WithDifficulty // -// TODO_BLOCKER: The relay hashing and relay difficulty mechanisms & values must come +// TODO_BLOCKER(@Olshansk): The relay hashing and relay difficulty mechanisms & values must come // from on-chain. type miner struct { // relayDifficultyBits is the minimum difficulty that a relay must have to be @@ -92,8 +92,8 @@ func (mnr *miner) mapMineRelay( _ context.Context, relay *servicetypes.Relay, ) (_ either.Either[*relayer.MinedRelay], skip bool) { - // TODO_TECHDEBT(#446): Centralize the configuration for the SMT spec. - // TODO_BLOCKER: marshal using canonical codec. + // TODO_TECHDEBT(@red-0ne, #446): Centralize the configuration for the SMT spec. + // TODO_TECHDEBT(@red-0ne): marshal using canonical codec. relayBz, err := relay.Marshal() if err != nil { return either.Error[*relayer.MinedRelay](err), false diff --git a/pkg/relayer/miner/miner_test.go b/pkg/relayer/miner/miner_test.go index cabfbb0c6..e878b8475 100644 --- a/pkg/relayer/miner/miner_test.go +++ b/pkg/relayer/miner/miner_test.go @@ -129,7 +129,7 @@ func unmarshalHexMinedRelay( err = relay.Unmarshal(relayBz) require.NoError(t, err) - // TODO_TECHDEBT(#446): Centralize the configuration for the SMT spec. + // TODO_TECHDEBT(@red-0ne, #446): Centralize the configuration for the SMT spec. relayHashArr := servicetypes.GetHashFromBytes(relayBz) relayHash := relayHashArr[:] diff --git a/pkg/relayer/protocol/block_heights.go b/pkg/relayer/protocol/block_heights.go index 3dc658d35..9da3e78d6 100644 --- a/pkg/relayer/protocol/block_heights.go +++ b/pkg/relayer/protocol/block_heights.go @@ -31,7 +31,7 @@ func GetEarliestCreateClaimHeight(ctx context.Context, createClaimWindowStartBlo rngSeed, _ := binary.Varint(createClaimWindowStartBlockHash) randomNumber := rand.NewSource(rngSeed).Int63() - // TODO_BLOCKER(#402): query the on-chain governance parameter once available. + // TODO_BLOCKER(@bryanchriswhite, #402): query the on-chain governance parameter once available. // randCreateClaimHeightOffset := randomNumber % (claimproofparams.GovCreateClaimIntervalBlocks - claimproofparams.GovCreateClaimWindowBlocks - 1) _ = randomNumber randCreateClaimHeightOffset := int64(0) @@ -59,7 +59,7 @@ func GetEarliestSubmitProofHeight(ctx context.Context, submitProofWindowStartBlo rngSeed, _ := binary.Varint(earliestSubmitProofBlockHash) randomNumber := rand.NewSource(rngSeed).Int63() - // TODO_BLOCKER: query the on-chain governance parameter once available. + // TODO_BLOCKER(@bryanchriswhite): query the on-chain governance parameter once available. // randSubmitProofHeightOffset := randomNumber % (claimproofparams.GovSubmitProofIntervalBlocks - claimproofparams.GovSubmitProofWindowBlocks - 1) _ = randomNumber randSubmitProofHeightOffset := int64(0) diff --git a/pkg/relayer/protocol/difficulty.go b/pkg/relayer/protocol/difficulty.go index d390d8c47..4ab8b357c 100644 --- a/pkg/relayer/protocol/difficulty.go +++ b/pkg/relayer/protocol/difficulty.go @@ -2,9 +2,6 @@ package protocol import "math/bits" -// TODO_BLOCKER: Revisit this part of the algorithm after initial TestNet Launch. -// TODO_TEST: Add extensive tests for the core relay mining business logic. - // MustCountDifficultyBits returns the number of leading zero bits in the given // byte slice. It panics if an error is encountered. func MustCountDifficultyBits(bz []byte) int { @@ -19,7 +16,7 @@ func MustCountDifficultyBits(bz []byte) int { // CountHashDifficultyBits returns the number of leading zero bits in the given byte // slice. It returns an error if the byte slice is all zero bits. // -// TODO_IMPROVE(@h5law): Remove the forloop logic and replace with a simplified +// TODO_BLOCKER(@Olshansk): Remove the forloop logic and replace with a simplified // single method that accounts for the fact that block hashes/paths are always // 32 bytes. We use Sha256 (32 bytes) and CosmosSDK defaults to 32 byte block // hashes so specifying makes sense here. diff --git a/pkg/relayer/proxy/relay_verifier.go b/pkg/relayer/proxy/relay_verifier.go index 11cba8b7d..c8be82703 100644 --- a/pkg/relayer/proxy/relay_verifier.go +++ b/pkg/relayer/proxy/relay_verifier.go @@ -64,7 +64,8 @@ func (rp *relayerProxy) VerifyRelayRequest( // - serviceId (which is not provided by the relayRequest) // - applicationAddress (which is used to to verify the relayRequest signature) // - // TODO_BLOCKER: Revisit the assumptions above but good enough for now. + // TODO_BLOCKER(@Olshansk): Revisit the assumptions above and updated this if + // structure if necessary. if session.SessionId != sessionHeader.GetSessionId() { return ErrRelayerProxyInvalidSession.Wrapf( "session mismatch, expecting: %+v, got: %+v", diff --git a/pkg/relayer/proxy/server_builder.go b/pkg/relayer/proxy/server_builder.go index 3a7983054..a39f008cc 100644 --- a/pkg/relayer/proxy/server_builder.go +++ b/pkg/relayer/proxy/server_builder.go @@ -96,7 +96,7 @@ func (rp *relayerProxy) initializeProxyServers( for _, serverConfig := range rp.serverConfigs { rp.logger.Info().Str("server host", serverConfig.ListenAddress).Msg("starting relay proxy server") - // TODO(@h5law): Implement a switch that handles all synchronous + // TODO_TECHDEBT(@red-0ne): Implement a switch that handles all synchronous // RPC types in one server type and asynchronous RPC types in another // to create the appropriate RelayServer. // Initialize the server according to the server type defined in the config file diff --git a/pkg/relayer/proxy/synchronous.go b/pkg/relayer/proxy/synchronous.go index ff83739cf..10eb327f1 100644 --- a/pkg/relayer/proxy/synchronous.go +++ b/pkg/relayer/proxy/synchronous.go @@ -343,7 +343,7 @@ func decodeHTTPResponseBody(httpResponse *http.Response) (io.ReadCloser, error) switch httpResponse.Header.Get("Content-Encoding") { case "gzip": return gzip.NewReader(httpResponse.Body) - // TODO: Add other algorithms, or an alternative would be to switch to http + // TODO_IMPROVE(@okdas): Add other algorithms, or an alternative would be to switch to http // client that manages all low-level HTTP decisions for us, something like // https://github.com/imroc/req, https://github.com/valyala/fasthttp or // https://github.com/go-resty/resty diff --git a/pkg/relayer/session/claim.go b/pkg/relayer/session/claim.go index 544d7025c..ace048ec7 100644 --- a/pkg/relayer/session/claim.go +++ b/pkg/relayer/session/claim.go @@ -96,7 +96,7 @@ func (rs *relayerSessionsManager) waitForEarliestCreateClaimsHeight( return nil } - // TODO_BLOCKER: query the on-chain governance parameter once available. + // TODO_BLOCKER(@bryanchriswhite): query the on-chain governance parameter once available. // + claimproofparams.GovCreateClaimWindowStartHeightOffset // we wait for createClaimsWindowOpenHeight to be received before proceeding since we need its hash diff --git a/pkg/relayer/session/proof.go b/pkg/relayer/session/proof.go index 9acb77803..3177d7040 100644 --- a/pkg/relayer/session/proof.go +++ b/pkg/relayer/session/proof.go @@ -79,9 +79,9 @@ func (rs *relayerSessionsManager) waitForEarliestSubmitProofsHeightAndGeneratePr // first one from the group to calculate the earliest height for proof submission. sessionEndHeight := sessionTrees[0].GetSessionHeader().GetSessionEndBlockHeight() - // TODO_TECHDEBT(#516): Centralize the business logic that involves taking + // TODO_TECHDEBT(@bryanchriswhite, #516): Centralize the business logic that involves taking // into account the heights, windows and grace periods into helper functions. - // TODO_BLOCKER(#516): The proof submission window SHOULD NOT overlap with the + // TODO_BLOCKER(@bryanchriswhite, #516): The proof submission window SHOULD NOT overlap with the // claim window. The proof submission window start SHOULD be relative to the // claim window end. sessionGracePeriodEndHeight := shared.GetSessionGracePeriodEndHeight(sessionEndHeight) @@ -89,7 +89,7 @@ func (rs *relayerSessionsManager) waitForEarliestSubmitProofsHeightAndGeneratePr // of the session to be included in the claim before the smt is closed. createClaimsWindowStartHeight := sessionGracePeriodEndHeight + 1 submitProofsWindowStartHeight := createClaimsWindowStartHeight - // TODO_BLOCKER(#516): query the on-chain governance parameter once available. + // TODO_BLOCKER(@bryanchriswhite, #516): query the on-chain governance parameter once available. // + claimproofparams.GovSubmitProofWindowStartHeightOffset // we wait for submitProofsWindowStartHeight to be received before proceeding since we need its hash @@ -103,7 +103,7 @@ func (rs *relayerSessionsManager) waitForEarliestSubmitProofsHeightAndGeneratePr // source of entropy for all the session trees in that batch, waiting for it to // be received before proceeding. sessionPathBlock := rs.waitForBlock(ctx, sessionGracePeriodEndHeight) - // TODO_BLOCKER(#516): Wait one more block to ensure that a claim submitted at the earliest + // TODO_BLOCKER(@bryanchriswhite, #516): Wait one more block to ensure that a claim submitted at the earliest // possible height is committed. This delay will also need to account for claim/proof // window offsets which will be added in the future. _ = rs.waitForBlock(ctx, submitProofsWindowStartHeight) diff --git a/pkg/relayer/session/session.go b/pkg/relayer/session/session.go index 98a681d2a..e45ab952d 100644 --- a/pkg/relayer/session/session.go +++ b/pkg/relayer/session/session.go @@ -228,8 +228,8 @@ func (rs *relayerSessionsManager) forEachBlockClaimSessionsFn( // no longer eligible to be claimed, but that's not always the case. // Once claim window closing is implemented, they will be filtered out // downstream at the waitForEarliestCreateClaimsHeight step. - // TODO_BLOCKER: Introduce governance claim and proof window durations, - // implement off-chain window closing and on-chain window checks. + // TODO_BLOCKER(@bryanchriswhite): Introduce governance claim and + // proof window durations, implement off-chain window closing and on-chain window checks. if sessionGracePeriodEndHeight <= block.Height() { // Iterate over the sessionsTrees that have grace period ending at this // block height and add them to the list of sessionTrees to be published. diff --git a/pkg/relayer/session/session_test.go b/pkg/relayer/session/session_test.go index 09e39c26f..65ab64b58 100644 --- a/pkg/relayer/session/session_test.go +++ b/pkg/relayer/session/session_test.go @@ -110,7 +110,7 @@ func TestRelayerSessionsManager_Start(t *testing.T) { sessionClaimWindowOpenHeight := shared.GetClaimWindowOpenHeight(&sharedParams, sessionEndHeight) // Publish a block to the blockPublishCh to trigger claim creation for the session. - // TODO_TECHDEBT(#516): assumes claiming at sessionClaimWindowOpenHeight is valid. + // TODO_BLOCKER(@bryanchriswhite, #516): assumes claiming at sessionClaimWindowOpenHeight is valid. // This will likely change in future work. triggerClaimBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, sessionClaimWindowOpenHeight) blockPublishCh <- triggerClaimBlock @@ -118,7 +118,7 @@ func TestRelayerSessionsManager_Start(t *testing.T) { // TODO_IMPROVE: ensure correctness of persisted session trees here. // Publish a block to the blockPublishCh to trigger proof submission for the session. - // TODO_TECHDEBT(#516): assumes proving at sessionClaimWindowOpenHeight + 1 is valid. + // TODO_BLOCKER(@bryanchriswhite, #516): assumes proving at sessionClaimWindowOpenHeight + 1 is valid. // This will likely change in future work. triggerProofBlock := testblock.NewAnyTimesBlock(t, emptyBlockHash, sessionClaimWindowOpenHeight+1) blockPublishCh <- triggerProofBlock diff --git a/proto/poktroll/application/application.proto b/proto/poktroll/application/application.proto index b302b21bd..013d3080e 100644 --- a/proto/poktroll/application/application.proto +++ b/proto/poktroll/application/application.proto @@ -14,7 +14,7 @@ message Application { string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the application using cosmos' ScalarDescriptor to ensure deterministic encoding cosmos.base.v1beta1.Coin stake = 2; // The total amount of uPOKT the application has staked repeated poktroll.shared.ApplicationServiceConfig service_configs = 3; // The list of services this appliccation is configured to request service for - // TODO_TECHDEBT: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. + // TODO_BETA: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. // Ensure to rename all relevant configs, comments, variables, function names, etc as well. repeated string delegatee_gateway_addresses = 4 [(cosmos_proto.scalar) = "cosmos.AddressString", (gogoproto.nullable) = false]; // The Bech32 encoded addresses for all delegatee Gateways, in a non-nullable slice // A map from sessionEndHeights to a list of Gateways. diff --git a/proto/poktroll/service/query.proto b/proto/poktroll/service/query.proto index 909394ed6..6b60c1d65 100644 --- a/proto/poktroll/service/query.proto +++ b/proto/poktroll/service/query.proto @@ -41,7 +41,7 @@ message QueryParamsResponse { } message QueryGetServiceRequest { - // TODO: We could support getting services by name. + // TODO_IMPROVE: We could support getting services by name. string id = 1; } diff --git a/proto/poktroll/service/tx.proto b/proto/poktroll/service/tx.proto index 469c47b1e..2cd44a288 100644 --- a/proto/poktroll/service/tx.proto +++ b/proto/poktroll/service/tx.proto @@ -29,9 +29,6 @@ message MsgUpdateParams { // authority is the address that controls the module (defaults to x/gov unless overwritten). string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // TODO_IMPROVE(#322): The requirement to provide all params is adopted from the - // latest Cosmos SDK version. We should look into either improving this ourselves - // or seeing if it is on their roadmap. // params defines the x/service parameters to update. // NOTE: All parameters must be supplied. @@ -45,9 +42,7 @@ message MsgUpdateParamsResponse {} // MsgAddService defines a message for adding a new message to the network. // Services can be added by any actor in the network making them truly // permissionless. -// TODO_DOCUMENT(@h5law): This is a key function in making services -// permissionless, document it's usage and design - in docusaurus covering how -// the entire process works. +// TODO_BETA: Add Champions / Sources once its fully defined. message MsgAddService { option (cosmos.msg.v1.signer) = "address"; // https://docs.cosmos.network/main/build/building-modules/messages-and-queries string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // The Bech32 address of the service supplier using cosmos' ScalarDescriptor diff --git a/proto/poktroll/shared/service.proto b/proto/poktroll/shared/service.proto index 03b045d72..5ba16f7ef 100644 --- a/proto/poktroll/shared/service.proto +++ b/proto/poktroll/shared/service.proto @@ -6,14 +6,12 @@ package poktroll.shared; option go_package = "github.com/pokt-network/poktroll/x/shared/types"; -// TODO_CLEANUP(@Olshansk): Add native optional identifiers once its supported; https://github.com/ignite/cli/issues/3698 - // Service message to encapsulate unique and semantic identifiers for a service on the network message Service { // For example, what if we want to request a session for a certain service but with some additional configs that identify it? string id = 1; // Unique identifier for the service - // TODO_TECHDEBT: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary + // TODO_BETA: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary string name = 2; // (Optional) Semantic human readable name for the service } @@ -21,7 +19,7 @@ message Service { message ApplicationServiceConfig { Service service = 1; // The Service for which the application is configured - // TODO_RESEARCH: There is an opportunity for applications to advertise the max + // TODO_MAINNET: There is an opportunity for applications to advertise the max // they're willing to pay for a certain configuration/price, but this is outside of scope. // RPCConfig rpc_configs = 2; // List of endpoints for the service } @@ -30,7 +28,7 @@ message ApplicationServiceConfig { message SupplierServiceConfig { Service service = 1; // The Service for which the supplier is configured repeated SupplierEndpoint endpoints = 2; // List of endpoints for the service - // TODO_RESEARCH: There is an opportunity for supplier to advertise the min + // TODO_MAINNET: There is an opportunity for supplier to advertise the min // they're willing to earn for a certain configuration/price, but this is outside of scope. } diff --git a/proto/poktroll/tokenomics/params.proto b/proto/poktroll/tokenomics/params.proto index ee12e8af7..2a0d16c78 100644 --- a/proto/poktroll/tokenomics/params.proto +++ b/proto/poktroll/tokenomics/params.proto @@ -12,7 +12,6 @@ message Params { option (gogoproto.equal) = true; // The amount of upokt that a compute unit should translate to when settling a session. - // TODO_DOCUMENT(@Olshansk): Make sure to document the units of this parameter (or the map) once finalized. uint64 compute_units_to_tokens_multiplier = 1 [(gogoproto.jsontag) = "compute_units_to_tokens_multiplier", (gogoproto.moretags) = "yaml:\"compute_units_to_tokens_multiplier\""]; // IMPORTANT: Make sure to update all related files if you're modifying or adding a new parameter. diff --git a/proto/poktroll/tokenomics/relay_mining_difficulty.proto b/proto/poktroll/tokenomics/relay_mining_difficulty.proto index 599e881ad..7ed463770 100644 --- a/proto/poktroll/tokenomics/relay_mining_difficulty.proto +++ b/proto/poktroll/tokenomics/relay_mining_difficulty.proto @@ -23,7 +23,7 @@ message RelayMiningDifficulty { // 0b0000111... (until 32 bytes are filled up). bytes target_hash = 4; - // TODO_BLOCKER_BETA(@Olshansk): Add a `hash_algorithm` field either in this + // TODO_BETA(@Olshansk): Add a `hash_algorithm` field either in this // structure or elsewhere so we can support changing it over time. There should // be one source of truth, somewhere on chain, to stay in sync with the SMT // configuration. diff --git a/testutil/testkeyring/keyring.go b/testutil/testkeyring/keyring.go index f6c503d8e..39c2828c5 100644 --- a/testutil/testkeyring/keyring.go +++ b/testutil/testkeyring/keyring.go @@ -16,7 +16,7 @@ import ( // pre-generated accounts to populated the provided keyring, kr. It then returns // the pre-generated accounts which were used. // -// TODO_CONSIDERATION: Returning a new PreGeneratedAccountIterator instead of +// TODO_TECHDEBT: Returning a new PreGeneratedAccountIterator instead of // the slice of accounts could be more idiomatic. It would only contain keys which // are known to be in the keyring. func CreatePreGeneratedKeyringAccounts( diff --git a/testutil/testpolylog/event.go b/testutil/testpolylog/event.go index c41708c13..82636e50c 100644 --- a/testutil/testpolylog/event.go +++ b/testutil/testpolylog/event.go @@ -97,7 +97,7 @@ func RunEventMethodTests( // method to call on the logger using reflect and for the sub-test // descriptions. // - // TODO_TECHDEBT/TODO_COMMUNITY: `strings.Title()` is deprecated. Follow + // TODO_TECHDEBT: `strings.Title()` is deprecated. Follow // migration guidance in godocs: https://pkg.go.dev/strings@go1.21.4#Title. levelMethodName := strings.Title(level.String()) diff --git a/testutil/testproxy/relayerproxy.go b/testutil/testproxy/relayerproxy.go index aaeb1d687..f6ff48e2e 100644 --- a/testutil/testproxy/relayerproxy.go +++ b/testutil/testproxy/relayerproxy.go @@ -282,7 +282,7 @@ func WithSuccessiveSessions( } } -// TODO_TECHDEBT(@red-0ne): This function only supports JSON-RPC requests and +// TODO_BLOCKER(@red-0ne): This function only supports JSON-RPC requests and // needs to have its http.Request "Content-Type" header passed-in as a parameter // and take out the GetRelayResponseError function which parses JSON-RPC responses // to make it RPC-type agnostic. diff --git a/testutil/testrelayer/relays.go b/testutil/testrelayer/relays.go index 858bb1f68..c75a2ed00 100644 --- a/testutil/testrelayer/relays.go +++ b/testutil/testrelayer/relays.go @@ -29,8 +29,8 @@ func NewMinedRelay( Res: &servicetypes.RelayResponse{}, } - // TODO_TECHDEBT(#446): Centralize the configuration for the SMT spec. - // TODO_BLOCKER: marshal using canonical codec. + // TODO_TECHDEBT(@red-0ne, #446): Centralize the configuration for the SMT spec. + // TODO_TECHDEBT(@red-0ne): marshal using canonical codec. relayBz, err := relay.Marshal() require.NoError(t, err) relayHashArr := servicetypes.GetHashFromBytes(relayBz) diff --git a/x/application/keeper/msg_server_unstake_application.go b/x/application/keeper/msg_server_unstake_application.go index 0b0b399b4..74f662d41 100644 --- a/x/application/keeper/msg_server_unstake_application.go +++ b/x/application/keeper/msg_server_unstake_application.go @@ -10,7 +10,7 @@ import ( "github.com/pokt-network/poktroll/x/application/types" ) -// TODO(#73): Determine if an application needs an unbonding period after unstaking. +// TODO(#489): Determine if an application needs an unbonding period after unstaking. func (k msgServer) UnstakeApplication( ctx context.Context, msg *types.MsgUnstakeApplication, diff --git a/x/application/keeper/prune_undelegations.go b/x/application/keeper/prune_undelegations.go index eb2e276e9..f4cde25ea 100644 --- a/x/application/keeper/prune_undelegations.go +++ b/x/application/keeper/prune_undelegations.go @@ -13,7 +13,7 @@ import ( // undelegation from applications to gateways are delayed before being pruned. // TODO_DOCUMENT(@red-0ne): Need to document the flow from this comment // so its clear to everyone why this is necessary; https://github.com/pokt-network/poktroll/issues/476#issuecomment-2052639906. -// TODO_CONSIDERATION(#516): Should this be configurable? Note that it should +// TODO_MAINNET(#516): Should this be configurable? Note that it should // likely be a function of SubmitProofCloseWindowNumBlocks once implemented. const NumSessionsAppToGatewayUndelegationRetention = 2 diff --git a/x/application/module/query.go b/x/application/module/query.go index c23fe79ae..6662ea51c 100644 --- a/x/application/module/query.go +++ b/x/application/module/query.go @@ -3,15 +3,14 @@ package application import ( "fmt" - "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/application/types" ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group application queries under a subcommand cmd := &cobra.Command{ diff --git a/x/application/module/tx.go b/x/application/module/tx.go index 314b8bbbe..c74852a65 100644 --- a/x/application/module/tx.go +++ b/x/application/module/tx.go @@ -3,15 +3,14 @@ package application import ( "fmt" - "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/application/types" ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/application/simulation/stake_application.go b/x/application/simulation/stake_application.go index 5b9b7b21d..9e5c94ca3 100644 --- a/x/application/simulation/stake_application.go +++ b/x/application/simulation/stake_application.go @@ -11,7 +11,6 @@ import ( "github.com/pokt-network/poktroll/x/application/types" ) -// TODO(@Olshansk): Implement simulation for application staking func SimulateMsgStakeApplication( ak types.AccountKeeper, bk types.BankKeeper, diff --git a/x/application/types/application.pb.go b/x/application/types/application.pb.go index 5edf3c603..928be876e 100644 --- a/x/application/types/application.pb.go +++ b/x/application/types/application.pb.go @@ -31,7 +31,7 @@ type Application struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Stake *types.Coin `protobuf:"bytes,2,opt,name=stake,proto3" json:"stake,omitempty"` ServiceConfigs []*types1.ApplicationServiceConfig `protobuf:"bytes,3,rep,name=service_configs,json=serviceConfigs,proto3" json:"service_configs,omitempty"` - // TODO_TECHDEBT: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. + // TODO_BETA: Rename `delegatee_gateway_addresses` to `gateway_addresses_delegated_to`. // Ensure to rename all relevant configs, comments, variables, function names, etc as well. DelegateeGatewayAddresses []string `protobuf:"bytes,4,rep,name=delegatee_gateway_addresses,json=delegateeGatewayAddresses,proto3" json:"delegatee_gateway_addresses,omitempty"` // A map from sessionEndHeights to a list of Gateways. diff --git a/x/application/types/genesis.go b/x/application/types/genesis.go index 7052405e9..f0c91d1ce 100644 --- a/x/application/types/genesis.go +++ b/x/application/types/genesis.go @@ -33,7 +33,7 @@ func (gs GenesisState) Validate() error { // Check that the stake value for the apps is valid and that the delegatee addresses are valid for _, app := range gs.ApplicationList { - // TODO_TECHDEBT: Consider creating shared helpers across the board for stake validation, + // TODO_MAINNET: Consider creating shared helpers across the board for stake validation, // similar to how we have `ValidateAppServiceConfigs` below if app.Stake == nil { return ErrAppInvalidStake.Wrapf("nil stake amount for application") diff --git a/x/application/types/message_stake_application.go b/x/application/types/message_stake_application.go index 7631b161d..0692066b4 100644 --- a/x/application/types/message_stake_application.go +++ b/x/application/types/message_stake_application.go @@ -29,7 +29,7 @@ func (msg *MsgStakeApplication) ValidateBasic() error { return ErrAppInvalidAddress.Wrapf("invalid application address %s; (%v)", msg.Address, err) } - // TODO_TECHDEBT: Centralize stake related verification and share across different parts of the source code + // TODO_TECHDEBT(@red-0ne): Centralize stake related verification and share across different parts of the source code // Validate the stake amount if msg.Stake == nil { return ErrAppInvalidStake.Wrapf("nil application stake; (%v)", err) diff --git a/x/application/types/params.go b/x/application/types/params.go index 732aca8fb..fc990971b 100644 --- a/x/application/types/params.go +++ b/x/application/types/params.go @@ -12,7 +12,7 @@ var ( _ paramtypes.ParamSet = (*Params)(nil) KeyMaxDelegatedGateways = []byte("MaxDelegatedGateways") - // TODO: Determine the default value + // TODO_MAINNET: Determine the default value DefaultMaxDelegatedGateways uint64 = 7 ) diff --git a/x/gateway/keeper/msg_server_stake_gateway.go b/x/gateway/keeper/msg_server_stake_gateway.go index 5088f0723..82c511aaf 100644 --- a/x/gateway/keeper/msg_server_stake_gateway.go +++ b/x/gateway/keeper/msg_server_stake_gateway.go @@ -10,8 +10,6 @@ import ( "github.com/pokt-network/poktroll/x/gateway/types" ) -// TODO_IMPROVE(@Olshansk): Add more logging to staking & unstaking branches (success, failure, etc...). - func (k msgServer) StakeGateway( goCtx context.Context, msg *types.MsgStakeGateway, diff --git a/x/gateway/keeper/msg_server_unstake_gateway.go b/x/gateway/keeper/msg_server_unstake_gateway.go index 653b9138c..9fd4031e2 100644 --- a/x/gateway/keeper/msg_server_unstake_gateway.go +++ b/x/gateway/keeper/msg_server_unstake_gateway.go @@ -10,8 +10,7 @@ import ( "github.com/pokt-network/poktroll/x/gateway/types" ) -// TODO_TECHDEBT(#49): Add un-delegation from delegated apps -// TODO(#73): Determine if a gateway needs an unbonding period after unstaking. +// TODO_BLOCKER(#489): Apps & gateways unbonding periods func (k msgServer) UnstakeGateway( goCtx context.Context, msg *types.MsgUnstakeGateway, diff --git a/x/gateway/module/module.go b/x/gateway/module/module.go index ffa418184..c244d1724 100644 --- a/x/gateway/module/module.go +++ b/x/gateway/module/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + // this line is used by starport scaffolding # 1 + "cosmossdk.io/core/appmodule" "cosmossdk.io/core/store" "cosmossdk.io/depinject" @@ -18,8 +20,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" - // this line is used by starport scaffolding # 1 - modulev1 "github.com/pokt-network/poktroll/api/poktroll/gateway/module" "github.com/pokt-network/poktroll/x/gateway/keeper" "github.com/pokt-network/poktroll/x/gateway/types" @@ -141,7 +141,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw // ConsensusVersion is a sequence number for state-breaking change of the module. // It should be incremented on each consensus-breaking change introduced by the module. // To avoid wrong/empty versions, the initial version should be set to 1. -// TODO_TECHDEBT(#395): Make consensus version configurable +// TODO_MAINNET(#395): Make consensus version configurable func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock contains the logic that is automatically triggered at the beginning of each block. diff --git a/x/gateway/module/query.go b/x/gateway/module/query.go index f4dc50d24..aa76ee607 100644 --- a/x/gateway/module/query.go +++ b/x/gateway/module/query.go @@ -10,7 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group gateway queries under a subcommand cmd := &cobra.Command{ diff --git a/x/gateway/module/tx.go b/x/gateway/module/tx.go index 1792814fa..5d473c1b1 100644 --- a/x/gateway/module/tx.go +++ b/x/gateway/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/proof/keeper/keeper.go b/x/proof/keeper/keeper.go index c12e9ee05..23d473c8c 100644 --- a/x/proof/keeper/keeper.go +++ b/x/proof/keeper/keeper.go @@ -69,7 +69,7 @@ func NewKeeper( // and AccountKeeperQueryClient that are thin wrappers around the Application and // Account keepers respectively to satisfy the RingClient needs. // - // TODO_IMPROVE_CONSIDERATION: Make ring signature verification a stateless + // TODO_MAINNET(@red-0ne): Make ring signature verification a stateless // function and get rid of the RingClient and its dependencies by moving // application ring retrieval to the application keeper, and making it // retrievable using the application query client for off-chain actors. Signature diff --git a/x/proof/keeper/msg_server_create_claim.go b/x/proof/keeper/msg_server_create_claim.go index 776b19444..8fa39ff10 100644 --- a/x/proof/keeper/msg_server_create_claim.go +++ b/x/proof/keeper/msg_server_create_claim.go @@ -11,8 +11,8 @@ import ( ) func (k msgServer) CreateClaim(ctx context.Context, msg *types.MsgCreateClaim) (*types.MsgCreateClaimResponse, error) { - // TODO_BLOCKER: Prevent Claim upserts after the ClaimWindow is closed. - // TODO_BLOCKER: Validate the signature on the Claim message corresponds to the supplier before Upserting. + // TODO_BLOCKER(@bryanchriswhite): Prevent Claim upserts after the ClaimWindow is closed. + // TODO_BLOCKER(@bryanchriswhite): Validate the signature on the Claim message corresponds to the supplier before Upserting. isSuccessful := false defer telemetry.EventSuccessCounter( @@ -46,7 +46,7 @@ func (k msgServer) CreateClaim(ctx context.Context, msg *types.MsgCreateClaim) ( ) /* - TODO_INCOMPLETE: + TODO_BLOCKER(@bryanchriswhite): ### Msg distribution validation (depends on sessionRes validation) 1. [ ] governance-based earliest block offset @@ -66,13 +66,14 @@ func (k msgServer) CreateClaim(ctx context.Context, msg *types.MsgCreateClaim) ( RootHash: msg.GetRootHash(), } - // TODO_BLOCKER: check if this claim already exists and return an appropriate error - // in any case where the supplier should no longer be able to update the given proof. + // TODO_BLOCKER(@Olshansk): check if this claim already exists and return an + // appropriate error in any case where the supplier should no longer be able + // to update the given proof. k.Keeper.UpsertClaim(ctx, claim) logger.Info("created new claim") isSuccessful = true - // TODO: return the claim in the response. + // TODO_BETA: return the claim in the response. return &types.MsgCreateClaimResponse{}, nil } diff --git a/x/proof/keeper/msg_server_submit_proof.go b/x/proof/keeper/msg_server_submit_proof.go index b7d05a439..2f3954411 100644 --- a/x/proof/keeper/msg_server_submit_proof.go +++ b/x/proof/keeper/msg_server_submit_proof.go @@ -43,15 +43,15 @@ func init() { // A proof that's stored on-chain is what leads to rewards (i.e. inflation) // downstream, making the series of checks a critical part of the protocol. // -// TODO_BLOCKER: Prevent proof upserts after the tokenomics module has processed -// the respective session. +// TODO_BLOCKER(@bryanchriswhite): Prevent proof upserts after the tokenomics +// module has processed the respective session. // // Note: The entity sending the SubmitProof messages does not necessarily need // to correspond to the supplier signing the proof. For example, a single entity // could (theoretically) batch multiple proofs (signed by the corresponding supplier) // into one transaction to save on transaction fees. func (k msgServer) SubmitProof(ctx context.Context, msg *types.MsgSubmitProof) (*types.MsgSubmitProofResponse, error) { - // TODO_BLOCKER_DISCUSS: A potential issue with doing proof validation inside + // TODO_MAINNET: A potential issue with doing proof validation inside // `SubmitProof` is that we will not be storing false proofs on-chain (e.g. for slashing purposes). // This could be considered a feature (e.g. less state bloat against sybil attacks) // or a bug (i.e. no mechanisms for slashing suppliers who submit false proofs). @@ -67,7 +67,7 @@ func (k msgServer) SubmitProof(ctx context.Context, msg *types.MsgSubmitProof) ( ) /* - TODO_DOCUMENT(@bryanchriswhite): Document these steps in proof + TODO_BLOCKER(@bryanchriswhite): Document these steps in proof verification, link to the doc for reference and delete the comments. ## Actions (error if anything fails) @@ -138,7 +138,7 @@ func (k msgServer) SubmitProof(ctx context.Context, msg *types.MsgSubmitProof) ( ) } - // TODO_IMPROVE(#427): Utilize smt.VerifyCompactClosestProof here to + // TODO_MAINNET(#427): Utilize smt.VerifyCompactClosestProof here to // reduce on-chain storage requirements for proofs. // Get the relay request and response from the proof.GetClosestMerkleProof. relayBz := sparseMerkleClosestProof.GetValueHash(&SmtSpec) @@ -180,7 +180,7 @@ func (k msgServer) SubmitProof(ctx context.Context, msg *types.MsgSubmitProof) ( logger.Info("successfully compared relay response session header") // Verify the relay request's signature. - // TODO_TECHDEBT(@h5law): Fetch the correct ring for the session this relay is from. + // TODO_BLOCKER(@red-0ne): Fetch the correct ring for the session this relay is from. if err := k.ringClient.VerifyRelayRequestSignature(ctx, relayReq); err != nil { return nil, status.Error(codes.FailedPrecondition, err.Error()) } @@ -235,8 +235,9 @@ func (k msgServer) SubmitProof(ctx context.Context, msg *types.MsgSubmitProof) ( } logger.Info(fmt.Sprintf("queried and validated the claim for session ID %q", sessionHeader.SessionId)) - // TODO_BLOCKER: check if this proof already exists and return an appropriate error - // in any case where the supplier should no longer be able to update the given proof. + // TODO_BLOCKER(@Olshansk): check if this proof already exists and return an + // appropriate error in any case where the supplier should no longer be able + // to update the given proof. k.UpsertProof(ctx, proof) logger.Info("successfully upserted the proof") @@ -400,7 +401,7 @@ func validateMiningDifficulty(relayBz []byte, minRelayDifficultyBits uint64) err ) } - // TODO: Devise a test that tries to attack the network and ensure that there + // TODO_MAINNET: Devise a test that tries to attack the network and ensure that there // is sufficient telemetry. if uint64(relayDifficultyBits) < minRelayDifficultyBits { return types.ErrProofInvalidRelay.Wrapf( @@ -438,12 +439,12 @@ func (k msgServer) validateClosestPath( // // TODO_TECHDEBT(@red-0ne): Centralize the business logic that involves taking // into account the heights, windows and grace periods into helper functions. - // TODO_BLOCKER@(#516): Update `blockHeight` to be the value of when the `ProofWindow` + // TODO_BLOCKER(@bryanchriswhite, #516): Update `blockHeight` to be the value of when the `ProofWindow` // opens once the variable is added. sessionGracePeriodEndHeight := shared.GetSessionGracePeriodEndHeight(sessionHeader.GetSessionEndBlockHeight()) blockHash := k.sessionKeeper.GetBlockHash(ctx, sessionGracePeriodEndHeight) - // TODO: Investigate "proof for the path provided does not match one expected by the on-chain protocol" + // TODO_BETA: Investigate "proof for the path provided does not match one expected by the on-chain protocol" // error that may occur due to block height differing from the off-chain part. fmt.Println("E2E_DEBUG: height for block hash when verifying the proof", sessionGracePeriodEndHeight, sessionHeader.GetSessionId()) @@ -460,7 +461,7 @@ func (k msgServer) validateClosestPath( } func GetPathForProof(blockHash []byte, sessionId string) []byte { - // TODO_BLOCKER(@Olshansk, @red-0ne, @h5law): We need to replace the return + // TODO_BLOCKER(@Olshansk): We need to replace the return // statement below and change all relevant parts in the codebase. // See the conversation in the following thread for more details: https://github.com/pokt-network/poktroll/pull/406#discussion_r1520790083 path := make([]byte, SmtSpec.PathHasherSize()) diff --git a/x/proof/keeper/msg_server_submit_proof_test.go b/x/proof/keeper/msg_server_submit_proof_test.go index 93573ba48..8e0154301 100644 --- a/x/proof/keeper/msg_server_submit_proof_test.go +++ b/x/proof/keeper/msg_server_submit_proof_test.go @@ -491,7 +491,7 @@ func TestMsgServer_SubmitProof_Error(t *testing.T) { ), }, { - // TODO_TEST(community): expand: test case to cover each session header field. + // TODO_TEST: expand: test case to cover each session header field. desc: "relay response session header must match proof session header", newProofMsg: func(t *testing.T) *types.MsgSubmitProof { // Construct a session tree with 1 relay with a session header containing @@ -1036,7 +1036,7 @@ func newTestProofMsg( // createClaimAndStoreBlockHash creates a valid claim, submits it on-chain, // and on success, stores the block hash for retrieval at future heights. -// TODO_CONSIDERATION(@bryanchriswhite): Consider if we could/should split +// TODO_TECHDEBT(@bryanchriswhite): Consider if we could/should split // this into two functions. func createClaimAndStoreBlockHash( ctx context.Context, diff --git a/x/proof/keeper/msg_server_update_param_test.go b/x/proof/keeper/msg_server_update_param_test.go index 9b11ccb4f..ce1971887 100644 --- a/x/proof/keeper/msg_server_update_param_test.go +++ b/x/proof/keeper/msg_server_update_param_test.go @@ -31,7 +31,4 @@ func TestMsgUpdateParam_UpdateMinRelayDifficultyBitsOnly(t *testing.T) { require.NoError(t, err) require.Equal(t, uint64(expectedMinRelayDifficultyBits), res.Params.MinRelayDifficultyBits) - - // TODO_BLOCKER: once we have more than one param per module, add assertions - // here which ensure that other params were not changed! } diff --git a/x/proof/keeper/proof.go b/x/proof/keeper/proof.go index 4f574c2ca..7fd1d40e9 100644 --- a/x/proof/keeper/proof.go +++ b/x/proof/keeper/proof.go @@ -15,7 +15,7 @@ import ( func (k Keeper) UpsertProof(ctx context.Context, proof types.Proof) { logger := k.Logger().With("method", "UpsertProof") - // TODO_IMPROVE(#427): Use the marshal method on the SparseCompactClosestProof + // TODO_MAINNET(#427): Use the marshal method on the SparseCompactClosestProof // type here instead in order to reduce space stored on chain. proofBz := k.cdc.MustMarshal(&proof) storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) diff --git a/x/proof/module/genesis.go b/x/proof/module/genesis.go index db137654b..1fe136cf7 100644 --- a/x/proof/module/genesis.go +++ b/x/proof/module/genesis.go @@ -8,7 +8,6 @@ import ( ) // InitGenesis initializes the module's state from a provided genesis state. -// TODO_TECHDEBT(@Olshansk): Remove existing claims from genesis. func InitGenesis(ctx context.Context, k keeper.Keeper, genState types.GenesisState) { // Set all the claim for _, claim := range genState.ClaimList { diff --git a/x/proof/module/genesis_test.go b/x/proof/module/genesis_test.go index b7bb79cbc..9f792e497 100644 --- a/x/proof/module/genesis_test.go +++ b/x/proof/module/genesis_test.go @@ -29,7 +29,7 @@ func TestGenesis(t *testing.T) { RootHash: []byte{1, 2, 3}, }, }, - // TODO_BLOCKER: finish genesis proof list validation. + // TODO_TEST: finish genesis proof list validation. //ProofList: []types.Proof{ // { // Index: "0", diff --git a/x/proof/module/helpers_test.go b/x/proof/module/helpers_test.go index 304cd4652..462c237e7 100644 --- a/x/proof/module/helpers_test.go +++ b/x/proof/module/helpers_test.go @@ -134,7 +134,7 @@ func networkWithClaimObjects( appAcct.Address.String(), ) claims = append(claims, *claim) - // TODO_HACK(#196, @Olshansk): Move this outside of the forloop + // TODO_HACK(#196): Move this outside of the forloop // so that the test iteration is faster. The current issue has // to do with a "incorrect account sequence timestamp" error require.NoError(t, net.WaitForNextBlock()) diff --git a/x/proof/module/module.go b/x/proof/module/module.go index d102c2e2d..a96341571 100644 --- a/x/proof/module/module.go +++ b/x/proof/module/module.go @@ -18,8 +18,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" - // this line is used by starport scaffolding # 1 - modulev1 "github.com/pokt-network/poktroll/api/poktroll/proof/module" "github.com/pokt-network/poktroll/x/proof/keeper" "github.com/pokt-network/poktroll/x/proof/types" diff --git a/x/proof/module/query.go b/x/proof/module/query.go index 750df66a8..9fb24e453 100644 --- a/x/proof/module/query.go +++ b/x/proof/module/query.go @@ -10,7 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group supplier queries under a subcommand cmd := &cobra.Command{ diff --git a/x/proof/module/query_claim_test.go b/x/proof/module/query_claim_test.go index 7054dd83a..af4453fc3 100644 --- a/x/proof/module/query_claim_test.go +++ b/x/proof/module/query_claim_test.go @@ -70,7 +70,7 @@ func TestClaim_Show(t *testing.T) { // NB: this is *NOT* a gRPC status error because the bech32 parse // error occurs during request validation (i.e. client-side). expectedErr: types.ErrProofInvalidAddress.Wrapf( - // TODO_CONSIDERATION: prefer using "%q" in error format strings + // TODO_TECHDEBT: prefer using "%q" in error format strings // to disambiguate empty string from space or no output. "invalid supplier address for claim being retrieved %s; (decoding bech32 failed: invalid separator index -1)", "invalid_bech32_supplier_address", diff --git a/x/proof/module/query_proof_test.go b/x/proof/module/query_proof_test.go index cd3c7a1b4..3bcd4848f 100644 --- a/x/proof/module/query_proof_test.go +++ b/x/proof/module/query_proof_test.go @@ -1,6 +1,6 @@ package proof_test -// TODO_UPNEXT(@Olshansk): Add these tests back in after merging on-chain Proof persistence. +// TODO_BLOCKER(@Olshansk): Add these tests back in after merging on-chain Proof persistence. // Prevent strconv unused error // var _ = strconv.IntSize // @@ -132,7 +132,7 @@ package proof_test // } // }) // -// TODO_BLOCKER: add "BySupplierAddress", "BySession", "ByHeight" tests. +// TODO_TEST: add "BySupplierAddress", "BySession", "ByHeight" tests. // // t.Run("Total", func(t *testing.T) { // args := request(nil, 0, uint64(len(proofs)), true) diff --git a/x/proof/module/tx.go b/x/proof/module/tx.go index 161864cf9..c3c8d0215 100644 --- a/x/proof/module/tx.go +++ b/x/proof/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/proof/module/tx_create_claim_test.go b/x/proof/module/tx_create_claim_test.go index fc74039f4..b78d76bf6 100644 --- a/x/proof/module/tx_create_claim_test.go +++ b/x/proof/module/tx_create_claim_test.go @@ -1,3 +1,3 @@ package proof -// TODO_NEXT(@bryanchriswhite #140): add comprehensive CLI test coverage for creating claims. +// TODO_TEST(@bryanchriswhite, #140): add comprehensive CLI test coverage for creating claims. diff --git a/x/proof/module/tx_submit_proof_test.go b/x/proof/module/tx_submit_proof_test.go index 75279675c..1e5104b4b 100644 --- a/x/proof/module/tx_submit_proof_test.go +++ b/x/proof/module/tx_submit_proof_test.go @@ -1,3 +1,3 @@ package proof_test -// TODO_NEXT(@bryanchriswhite #141): add comprehensive CLI test coverage for submitting proofs. +// TODO_TEST(@bryanchriswhite #141): add comprehensive CLI test coverage for submitting proofs. diff --git a/x/proof/types/genesis.go b/x/proof/types/genesis.go index 0371b9441..3df18ef67 100644 --- a/x/proof/types/genesis.go +++ b/x/proof/types/genesis.go @@ -20,7 +20,7 @@ func (gs GenesisState) Validate() error { // Ensure claims are unique with respect to a given session ID and supplier address. for _, claim := range gs.ClaimList { - // TODO_BLOCKER: ensure the corresponding supplier exists and is staked. + // TODO_TEST: ensure the corresponding supplier exists and is staked. if claim.GetRootHash() == nil { return fmt.Errorf("root hash cannot be nil") diff --git a/x/proof/types/genesis_test.go b/x/proof/types/genesis_test.go index bc2440f62..1f2601f00 100644 --- a/x/proof/types/genesis_test.go +++ b/x/proof/types/genesis_test.go @@ -38,7 +38,7 @@ func TestGenesisState_Validate(t *testing.T) { RootHash: []byte{1, 2, 3}, }, }, - // TODO_BLOCKER: finish genesis proof list validation. + // TODO_TEST: finish genesis proof list validation. //ProofList: []types.Proof{ // { // SupplierAddress: sample.AccAddress(), @@ -112,7 +112,7 @@ func TestGenesisState_Validate(t *testing.T) { }, isValid: false, }, - // TODO_BLOCKER: finish genesis proof list validation. + // TODO_TEST:: finish genesis proof list validation. //{ // desc: "duplicated proof", // genState: &types.GenesisState{ diff --git a/x/proof/types/key_claim.go b/x/proof/types/key_claim.go index d7a7d37ac..73e99d7fb 100644 --- a/x/proof/types/key_claim.go +++ b/x/proof/types/key_claim.go @@ -36,4 +36,4 @@ func ClaimSupplierEndSessionHeightKey(sessionEndHeight int64, primaryKey []byte) return KeyComposite(heightBz, primaryKey) } -// TODO_TECHDEBT(@olshanks): add helpers for composing query-side key prefixes & document key/value prefix design. +// TODO_TECHDEBT(@Olshansk): add helpers for composing query-side key prefixes & document key/value prefix design. diff --git a/x/proof/types/message_submit_proof.go b/x/proof/types/message_submit_proof.go index 4e720b5cd..f491a6259 100644 --- a/x/proof/types/message_submit_proof.go +++ b/x/proof/types/message_submit_proof.go @@ -20,7 +20,7 @@ func NewMsgSubmitProof(supplierAddress string, sessionHeader *sessiontypes.Sessi // ValidateBasic ensures that the bech32 address strings for the supplier and // application addresses are valid and that the proof and service ID are not empty. // -// TODO_TECHDEBT: Call `msg.GetSessionHeader().ValidateBasic()` once its implemented +// TODO_BETA: Call `msg.GetSessionHeader().ValidateBasic()` once its implemented func (msg *MsgSubmitProof) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.GetSupplierAddress()); err != nil { return sdkerrors.ErrInvalidAddress.Wrapf( @@ -46,7 +46,7 @@ func (msg *MsgSubmitProof) ValidateBasic() error { return ErrProofInvalidProof.Wrap("proof cannot be empty") } - // TODO_BLOCKER: attempt to deserialize the proof for additional validation. + // TODO_MAINNET: attempt to deserialize the proof for additional validation. return nil } diff --git a/x/proof/types/params.go b/x/proof/types/params.go index aba00b70c..aa899d5da 100644 --- a/x/proof/types/params.go +++ b/x/proof/types/params.go @@ -7,7 +7,7 @@ var ( KeyMinRelayDifficultyBits = []byte("MinRelayDifficultyBits") ParamMinRelayDifficultyBits = "min_relay_difficulty_bits" - DefaultMinRelayDifficultyBits uint64 = 0 // TODO_BLOCKER(#142, #401): Determine the default value. + DefaultMinRelayDifficultyBits uint64 = 0 // TODO_MAINNET(#142, #401): Determine the default value. ) // ParamKeyTable the param key table for launch module diff --git a/x/proof/types/query_validation.go b/x/proof/types/query_validation.go index 568e23ff6..08fa44d2c 100644 --- a/x/proof/types/query_validation.go +++ b/x/proof/types/query_validation.go @@ -19,7 +19,7 @@ func (query *QueryGetClaimRequest) ValidateBasic() error { return ErrProofInvalidAddress.Wrapf("invalid supplier address for claim being retrieved %s; (%v)", query.SupplierAddress, err) } - // TODO_TECHDEBT: Validate the session ID once we have a deterministic way to generate it + // TODO_BLOCKER(@bryanchriswhite): Validate the session ID once we have a deterministic way to generate it if query.SessionId == "" { return ErrProofInvalidSessionId.Wrapf("invalid session ID for claim being retrieved %s", query.SessionId) } @@ -40,7 +40,7 @@ func (query *QueryAllClaimsRequest) ValidateBasic() error { case *QueryAllClaimsRequest_SessionId: logger.Warn(). Str("session_id", filter.SessionId). - Msg("TODO_TECHDEBT: Validate the session ID once we have a deterministic way to generate it") + Msg("TODO_BLOCKER(@bryanchriswhite): Validate the session ID once we have a deterministic way to generate it") case *QueryAllClaimsRequest_SessionEndHeight: if filter.SessionEndHeight < 0 { @@ -57,7 +57,7 @@ func (query *QueryGetProofRequest) ValidateBasic() error { return ErrProofInvalidAddress.Wrapf("invalid supplier address for proof being retrieved %s; (%v)", query.SupplierAddress, err) } - // TODO_TECHDEBT: Validate the session ID once we have a deterministic way to generate it + // TODO_BLOCKER(@bryanchriswhite): Validate the session ID once we have a deterministic way to generate it if query.SessionId == "" { return ErrProofInvalidSessionId.Wrapf("invalid session ID for proof being retrieved %s", query.SessionId) } @@ -78,7 +78,7 @@ func (query *QueryAllProofsRequest) ValidateBasic() error { case *QueryAllProofsRequest_SessionId: logger.Warn(). Str("session_id", filter.SessionId). - Msg("TODO_TECHDEBT: Validate the session ID once we have a deterministic way to generate it") + Msg("TODO_BLOCKER(@bryanchriswhite): Validate the session ID once we have a deterministic way to generate it") case *QueryAllProofsRequest_SessionEndHeight: if filter.SessionEndHeight < 0 { diff --git a/x/proof/types/shared_query_client.go b/x/proof/types/shared_query_client.go index b8ee9f233..b70198d3f 100644 --- a/x/proof/types/shared_query_client.go +++ b/x/proof/types/shared_query_client.go @@ -37,7 +37,7 @@ func (sharedQueryClient *SharedKeeperQueryClient) GetParams( // TODO_TECHDEBT(#543): We don't really want to have to query the params for every method call. // Once `ModuleParamsClient` is implemented, use its replay observable's `#Last()` method // to get the most recently (asynchronously) observed (and cached) value. -// TODO_BLOCKER(#543): We also don't really want to use the current value of the params. +// TODO_BLOCKER(@bryanchriswhite, #543): We also don't really want to use the current value of the params. // Instead, we should be using the value that the params had for the session given by blockHeight. func (sharedQueryClient *SharedKeeperQueryClient) GetClaimWindowOpenHeight( ctx context.Context, diff --git a/x/service/module/module.go b/x/service/module/module.go index e57949906..ddba433ea 100644 --- a/x/service/module/module.go +++ b/x/service/module/module.go @@ -18,8 +18,6 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" - // this line is used by starport scaffolding # 1 - modulev1 "github.com/pokt-network/poktroll/api/poktroll/service/module" "github.com/pokt-network/poktroll/x/service/keeper" "github.com/pokt-network/poktroll/x/service/types" @@ -141,7 +139,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw // ConsensusVersion is a sequence number for state-breaking change of the module. // It should be incremented on each consensus-breaking change introduced by the module. // To avoid wrong/empty versions, the initial version should be set to 1. -// TODO_TECHDEBT(#395): Make consensus version configurable +// TODO_MAINNET(#395): Make consensus version configurable func (AppModule) ConsensusVersion() uint64 { return 1 } // BeginBlock contains the logic that is automatically triggered at the beginning of each block. diff --git a/x/service/module/tx.go b/x/service/module/tx.go index 48abdd9cc..4ae1d1f13 100644 --- a/x/service/module/tx.go +++ b/x/service/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/service/types/message_add_service.go b/x/service/types/message_add_service.go index eaed93489..b19d920e3 100644 --- a/x/service/types/message_add_service.go +++ b/x/service/types/message_add_service.go @@ -23,7 +23,7 @@ func (msg *MsgAddService) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(msg.Address); err != nil { return ErrServiceInvalidAddress.Wrapf("invalid supplier address %s; (%v)", msg.Address, err) } - // TODO_TECHDEBT: Add a validate basic function to the `Service` object + // TODO_BETA: Add a validate basic function to the `Service` object if msg.Service.Id == "" { return ErrServiceMissingID } diff --git a/x/service/types/params.go b/x/service/types/params.go index ee3a4b792..f4a921df3 100644 --- a/x/service/types/params.go +++ b/x/service/types/params.go @@ -8,7 +8,7 @@ import ( // DefaultAddServiceFee is the default value for the add service fee // parameter in the genesis state of the service module. -// TODO_BLOCKER: Revisit default param values for service fee +// TODO_BETA: Revisit default param values for service fee const ( ParamAddServiceFee = "add_service_fee" DefaultAddServiceFee = 1000000000 // 1000 POKT @@ -48,7 +48,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { // Validate validates the set of params func (p Params) Validate() error { - // TODO(@h5law): Look into better validation + // TODO_MAINNET: Look into better validation if p.AddServiceFee < DefaultAddServiceFee { return ErrServiceInvalidServiceFee.Wrapf( "AddServiceFee param %d uPOKT: got %d", @@ -66,7 +66,7 @@ func validateAddServiceFee(v interface{}) error { return fmt.Errorf("invalid parameter type: %T", v) } - // TODO_BLOCKER: implement validation + // TODO_BETA: implement validation _ = addServiceFee return nil diff --git a/x/service/types/query.pb.go b/x/service/types/query.pb.go index 676ffc0de..2d9a1cd89 100644 --- a/x/service/types/query.pb.go +++ b/x/service/types/query.pb.go @@ -116,7 +116,7 @@ func (m *QueryParamsResponse) GetParams() Params { } type QueryGetServiceRequest struct { - // TODO: We could support getting services by name. + // TODO_IMPROVE: We could support getting services by name. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } diff --git a/x/service/types/relay.go b/x/service/types/relay.go index 8e27941fa..b882c60ac 100644 --- a/x/service/types/relay.go +++ b/x/service/types/relay.go @@ -84,7 +84,7 @@ func (res RelayResponse) GetSignableBytesHash() ([32]byte, error) { // and SupplierSignature fields. // TODO_TEST: Add tests for RelayResponse validation func (res *RelayResponse) ValidateBasic() error { - // TODO_FUTURE: if a client gets a response with an invalid/incomplete + // TODO: if a client gets a response with an invalid/incomplete // SessionHeader, consider sending an on-chain challenge, lowering their // QoS, or other future work. diff --git a/x/service/types/tx.pb.go b/x/service/types/tx.pb.go index 2cd1b04ab..9fed7d7e2 100644 --- a/x/service/types/tx.pb.go +++ b/x/service/types/tx.pb.go @@ -129,9 +129,7 @@ var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo // MsgAddService defines a message for adding a new message to the network. // Services can be added by any actor in the network making them truly // permissionless. -// TODO_DOCUMENT(@h5law): This is a key function in making services -// permissionless, document it's usage and design - in docusaurus covering how -// the entire process works. +// TODO_BETA: Add Champions / Sources once its fully defined. type MsgAddService struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Service types.Service `protobuf:"bytes,2,opt,name=service,proto3" json:"service"` diff --git a/x/session/keeper/session_hydrator.go b/x/session/keeper/session_hydrator.go index 08aa97722..5281b8df8 100644 --- a/x/session/keeper/session_hydrator.go +++ b/x/session/keeper/session_hydrator.go @@ -19,7 +19,7 @@ import ( var SHA3HashLen = crypto.SHA3_256.Size() -// TODO_BLOCKER(#21): Make these configurable governance param +// TODO_BLOCKER(@bryanchriswhite, #21): Make these configurable governance param const ( NumSupplierPerSession = 15 SessionIDComponentDelimiter = "." @@ -89,7 +89,7 @@ func (k Keeper) HydrateSession(ctx context.Context, sh *sessionHydrator) (*types // hydrateSessionMetadata hydrates metadata related to the session such as the height at which the session started, its number, the number of blocks per session, etc.. func (k Keeper) hydrateSessionMetadata(ctx context.Context, sh *sessionHydrator) error { - // TODO_TECHDEBT: Add a test if `blockHeight` is ahead of the current chain or what this node is aware of + // TODO_TEST: Add a test if `blockHeight` is ahead of the current chain or what this node is aware of lastCommittedBlockHeight := sdk.UnwrapSDKContext(ctx).BlockHeight() if sh.blockHeight > lastCommittedBlockHeight { @@ -99,7 +99,7 @@ func (k Keeper) hydrateSessionMetadata(ctx context.Context, sh *sessionHydrator) ) } - // TODO_BLOCKER(#543): If the num_blocks_per_session param has ever been changed, + // TODO_BLOCKER(@bryanchriswhite, #543): If the num_blocks_per_session param has ever been changed, // this function may cause unexpected behavior for historical sessions. sharedParams := k.sharedKeeper.GetParams(ctx) sh.session.NumBlocksPerSession = int64(sharedParams.NumBlocksPerSession) @@ -114,8 +114,8 @@ func (k Keeper) hydrateSessionMetadata(ctx context.Context, sh *sessionHydrator) func (k Keeper) hydrateSessionID(ctx context.Context, sh *sessionHydrator) error { prevHashBz := k.GetBlockHash(ctx, sh.sessionHeader.SessionStartBlockHeight) - // TODO_TECHDEBT: In the future, we will need to validate that the Service is a valid service depending on whether - // or not its permissioned or permissionless + // TODO_MAINNET: In the future, we will need to validate that the Service is + // a valid service depending on whether or not its permissioned or permissionless if !sharedhelpers.IsValidService(sh.sessionHeader.Service) { return types.ErrSessionHydration.Wrapf("invalid service: %v", sh.sessionHeader.Service) @@ -162,10 +162,10 @@ func (k Keeper) hydrateSessionApplication(ctx context.Context, sh *sessionHydrat func (k Keeper) hydrateSessionSuppliers(ctx context.Context, sh *sessionHydrator) error { logger := k.Logger().With("method", "hydrateSessionSuppliers") - // TODO_TECHDEBT(@Olshansk, @bryanchriswhite): Need to retrieve the suppliers at SessionStartBlockHeight, - // NOT THE CURRENT ONE which is what's provided by the context. For now, for simplicity, - // only retrieving the suppliers at the current block height which could create a discrepancy - // if new suppliers were staked mid session. + // TODO_BLOCKER(@Olshansk): Retrieve the suppliers at SessionStartBlockHeight, + // NOT THE CURRENT ONE which is what's provided by the context. For now, for + // simplicity, only retrieving the suppliers at the current block height which + // could create a discrepancy if new suppliers were staked mid session. // TODO(@bryanchriswhite): Investigate if `BlockClient` + `ReplayObservable` where `N = SessionLength` could be used here.` suppliers := k.supplierKeeper.GetAllSuppliers(ctx) @@ -207,9 +207,10 @@ func (k Keeper) hydrateSessionSuppliers(ctx context.Context, sh *sessionHydrator return nil } -// TODO_INVESTIGATE: We are using a `Go` native implementation for a pseudo-random number generator. In order -// for it to be language agnostic, a general purpose algorithm MUST be used. -// pseudoRandomSelection returns a random subset of the candidates. +// TODO_BETA: We are using a `Go` native implementation for a pseudo-random +// number generator. In order for it to be language agnostic, a general purpose +// algorithm MUST be used. pseudoRandomSelection returns a random subset of the +// candidates. func pseudoRandomSelection( candidates []*sharedtypes.Supplier, numTarget int, diff --git a/x/session/keeper/session_hydrator_test.go b/x/session/keeper/session_hydrator_test.go index 412f1182e..515a98e73 100644 --- a/x/session/keeper/session_hydrator_test.go +++ b/x/session/keeper/session_hydrator_test.go @@ -51,7 +51,7 @@ func TestSession_HydrateSession_Success_BaseCase(t *testing.T) { } func TestSession_HydrateSession_Metadata(t *testing.T) { - // TODO_TECHDEBT: Extend these tests once `NumBlocksPerSession` is configurable. + // TODO_TEST: Extend these tests once `NumBlocksPerSession` is configurable. // Currently assumes NumBlocksPerSession=4 tests := []struct { desc string @@ -136,7 +136,7 @@ func TestSession_HydrateSession_Metadata(t *testing.T) { } func TestSession_HydrateSession_SessionId(t *testing.T) { - // TODO_TECHDEBT: Extend these tests once `NumBlocksPerSession` is configurable. + // TODO_TEST: Extend these tests once `NumBlocksPerSession` is configurable. // Currently assumes NumBlocksPerSession=4 tests := []struct { desc string @@ -220,7 +220,7 @@ func TestSession_HydrateSession_SessionId(t *testing.T) { } } -// TODO_TECHDEBT: Expand these tests to account for application joining/leaving the network at different heights as well changing the services they support +// TODO_TEST: Expand these tests to account for application joining/leaving the network at different heights as well changing the services they support func TestSession_HydrateSession_Application(t *testing.T) { tests := []struct { // Description @@ -264,7 +264,7 @@ func TestSession_HydrateSession_Application(t *testing.T) { expectedErr: types.ErrSessionHydration, }, - // TODO_TECHDEBT: Add tests for when: + // TODO_TEST: Add tests for when: // - Application join/leaves (stakes/unstakes) altogether // - Application adds/removes certain services mid-session // - Application increases stakes mid-session @@ -287,9 +287,9 @@ func TestSession_HydrateSession_Application(t *testing.T) { } } -// TODO_TECHDEBT: Expand these tests to account for supplier joining/leaving the network at different heights as well changing the services they support +// TODO_TEST: Expand these tests to account for supplier joining/leaving the network at different heights as well changing the services they support func TestSession_HydrateSession_Suppliers(t *testing.T) { - // TODO_TECHDEBT: Extend these tests once `NumBlocksPerSession` is configurable. + // TODO_TEST: Extend these tests once `NumBlocksPerSession` is configurable. // Currently assumes NumSupplierPerSession=15 tests := []struct { // Description @@ -321,11 +321,11 @@ func TestSession_HydrateSession_Suppliers(t *testing.T) { numExpectedSuppliers: 1, expectedErr: nil, }, - // TODO_TECHDEBT: Add this test once we make the num suppliers per session configurable + // TODO_TEST: Add this test once we make the num suppliers per session configurable // { // name: "num_suppliers_available > num_suppliers_per_session_param", // }, - // TODO_TECHDEBT: Add tests for when: + // TODO_TEST: Add tests for when: // - Supplier join/leaves (stakes/unstakes) altogether // - Supplier adds/removes certain services mid-session // - Supplier increases stakes mid-session diff --git a/x/session/types/session_header.go b/x/session/types/session_header.go index 45bb43859..ff322b938 100644 --- a/x/session/types/session_header.go +++ b/x/session/types/session_header.go @@ -6,7 +6,7 @@ import ( sharedhelpers "github.com/pokt-network/poktroll/x/shared/helpers" ) -// TODO_TECHDEBT: Ensure this is used everywhere a SessionHeader is validated. +// TODO_BETA: Ensure this is used everywhere a SessionHeader is validated. // ValidateBasic performs basic stateless validation of a SessionHeader. func (sh *SessionHeader) ValidateBasic() error { // Validate the application address diff --git a/x/shared/helpers/service.go b/x/shared/helpers/service.go index 9c1071871..d06bd3489 100644 --- a/x/shared/helpers/service.go +++ b/x/shared/helpers/service.go @@ -28,7 +28,7 @@ func init() { } // IsValidService checks if the provided ServiceId struct has valid fields -// TODO_TECHDEBT: Refactor to a `Service#ValidateBasic` method. +// TODO_TECHDEBT(BETA): Refactor to a `Service#ValidateBasic` method. func IsValidService(service *sharedtypes.Service) bool { // Check if service Id and Name are valid using the provided helper functions return service != nil && @@ -37,7 +37,7 @@ func IsValidService(service *sharedtypes.Service) bool { } // IsValidServiceId checks if the input string is a valid serviceId -// TODO_TECHDEBT: Refactor to a `ServiceId#ValidateBasic` method. +// TODO_TECHDEBT(BETA): Refactor to a `ServiceId#ValidateBasic` method. func IsValidServiceId(serviceId string) bool { // ServiceId CANNOT be empty if len(serviceId) == 0 { diff --git a/x/shared/helpers/service_configs.go b/x/shared/helpers/service_configs.go index 95335d058..3adee97c3 100644 --- a/x/shared/helpers/service_configs.go +++ b/x/shared/helpers/service_configs.go @@ -68,7 +68,7 @@ func ValidateSupplierServiceConfigs(services []*sharedtypes.SupplierServiceConfi return fmt.Errorf("endpoint.RpcType is not a valid RPCType: %v", serviceConfig) } - // TODO: Validate configs once they are being used + // TODO_BLOCKER(@okdas): Validate configs once they are being used // if endpoint.Configs == nil { // return fmt.Errorf("endpoint.Configs cannot be nil: %v", serviceConfig) // } diff --git a/x/shared/session.go b/x/shared/session.go index fe18c79e1..7f43c7141 100644 --- a/x/shared/session.go +++ b/x/shared/session.go @@ -5,8 +5,8 @@ import sharedtypes "github.com/pokt-network/poktroll/x/shared/types" // SessionGracePeriodBlocks is the number of blocks after the session ends before the // "session grace period" is considered to have elapsed. // -// TODO_BLOCKER: This is a place-holder that will be removed once the respective -// governance parameter is implemented. +// TODO_BLOCKER(@bryanchriswhite): This is a place-holder that will be removed +// once the respective governance parameter is implemented. const SessionGracePeriodBlocks = 4 // GetSessionStartHeight returns the block height at which the session containing @@ -20,7 +20,7 @@ func GetSessionStartHeight(sharedParams *sharedtypes.Params, queryHeight int64) numBlocksPerSession := int64(sharedParams.GetNumBlocksPerSession()) - // TODO_BLOCKER(#543): If the num_blocks_per_session param has ever been changed, + // TODO_BLOCKER(@bryanchriswhite, #543): If the num_blocks_per_session param has ever been changed, // this function may cause unexpected behavior. return queryHeight - ((queryHeight - 1) % numBlocksPerSession) } @@ -52,7 +52,7 @@ func GetSessionNumber(sharedParams *sharedtypes.Params, queryHeight int64) int64 numBlocksPerSession := int64(sharedParams.GetNumBlocksPerSession()) - // TODO_BLOCKER(#543): If the num_blocks_per_session param has ever been changed, + // TODO_BLOCKER(@bryanchriswhite, #543): If the num_blocks_per_session param has ever been changed, // this function may cause unexpected behavior. return ((queryHeight - 1) / numBlocksPerSession) + 1 } diff --git a/x/shared/types/service.pb.go b/x/shared/types/service.pb.go index 793ab1886..7338d5226 100644 --- a/x/shared/types/service.pb.go +++ b/x/shared/types/service.pb.go @@ -91,7 +91,7 @@ func (ConfigOptions) EnumDescriptor() ([]byte, []int) { type Service struct { // For example, what if we want to request a session for a certain service but with some additional configs that identify it? Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // TODO_TECHDEBT: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary + // TODO_BETA: Name is currently unused but acts as a reminder that an optional onchain representation of the service is necessary Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } diff --git a/x/supplier/client/cli/tx_create_claim_test.go b/x/supplier/client/cli/tx_create_claim_test.go index 276b6d093..bc2fbc439 100644 --- a/x/supplier/client/cli/tx_create_claim_test.go +++ b/x/supplier/client/cli/tx_create_claim_test.go @@ -1,3 +1,3 @@ package cli -// TODO_NEXT(@bryanchriswhite #140): add comprehensive CLI test coverage for creating claims. +// TODO_TECHDEBT(@bryanchriswhite, #140): add comprehensive CLI test coverage for creating claims. diff --git a/x/supplier/client/cli/tx_submit_proof_test.go b/x/supplier/client/cli/tx_submit_proof_test.go index d3cd52933..5d6c84a02 100644 --- a/x/supplier/client/cli/tx_submit_proof_test.go +++ b/x/supplier/client/cli/tx_submit_proof_test.go @@ -1,3 +1,3 @@ package cli -// TODO_NEXT(@bryanchriswhite #141): add comprehensive CLI test coverage for submitting proofs. +// TODO_TEST(@bryanchriswhite, #141): add comprehensive CLI test coverage for submitting proofs. diff --git a/x/supplier/config/supplier_configs_reader.go b/x/supplier/config/supplier_configs_reader.go index dc1c2ad97..f440be735 100644 --- a/x/supplier/config/supplier_configs_reader.go +++ b/x/supplier/config/supplier_configs_reader.go @@ -179,7 +179,7 @@ func parseEndpointRPCType(endpoint YAMLServiceEndpoint) (sharedtypes.RPCType, er switch strings.ToLower(endpoint.RPCType) { case "json_rpc": return sharedtypes.RPCType_JSON_RPC, nil - // TODO(@red-0ne): This hasn't been implemented yet but is part of the + // TODO_BLOCKER(@red-0ne): This hasn't been implemented yet but is part of the // configurations, which is why we're not returning an error here. case "rest": return sharedtypes.RPCType_REST, nil diff --git a/x/supplier/keeper/msg_server_unstake_supplier.go b/x/supplier/keeper/msg_server_unstake_supplier.go index 5d71d0510..dd36c7f2e 100644 --- a/x/supplier/keeper/msg_server_unstake_supplier.go +++ b/x/supplier/keeper/msg_server_unstake_supplier.go @@ -10,7 +10,7 @@ import ( "github.com/pokt-network/poktroll/x/supplier/types" ) -// TODO(#73): Determine if an application needs an unbonding period after unstaking. +// TODO_BETA(#489): Determine if an application needs an unbonding period after unstaking. func (k msgServer) UnstakeSupplier( ctx context.Context, msg *types.MsgUnstakeSupplier, diff --git a/x/supplier/keeper/query_supplier.go b/x/supplier/keeper/query_supplier.go index f1f5f21c8..e4c429e06 100644 --- a/x/supplier/keeper/query_supplier.go +++ b/x/supplier/keeper/query_supplier.go @@ -58,7 +58,7 @@ func (k Keeper) Supplier( supplier, found := k.GetSupplier(ctx, req.Address) if !found { - // TODO_TECHDEBT(#384): conform to logging conventions once established + // TODO_TECHDEBT(@bryanchriswhite, #384): conform to logging conventions once established msg := fmt.Sprintf("supplier with address %q", req.GetAddress()) return nil, status.Error(codes.NotFound, msg) } diff --git a/x/supplier/keeper/supplier.go b/x/supplier/keeper/supplier.go index af9f8778b..3dfc2e0e5 100644 --- a/x/supplier/keeper/supplier.go +++ b/x/supplier/keeper/supplier.go @@ -62,5 +62,5 @@ func (k Keeper) GetAllSuppliers(ctx context.Context) (suppliers []sharedtypes.Su return } -// TODO_OPTIMIZE: Index suppliers by service so we can easily query k.GetAllSuppliers(ctx, Service) +// TODO_MAINNET: Index suppliers by service so we can easily query k.GetAllSuppliers(ctx, Service) // func (k Keeper) GetAllSuppliers(ctx, sdkContext, serviceId string) (suppliers []sharedtypes.Supplier) {} diff --git a/x/supplier/module/query.go b/x/supplier/module/query.go index b49ebf142..11769f738 100644 --- a/x/supplier/module/query.go +++ b/x/supplier/module/query.go @@ -10,7 +10,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetQueryCmd() *cobra.Command { // Group supplier queries under a subcommand cmd := &cobra.Command{ diff --git a/x/supplier/module/tx.go b/x/supplier/module/tx.go index 535cfa1f7..943cf1895 100644 --- a/x/supplier/module/tx.go +++ b/x/supplier/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(@bryanchriswhite, #370): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/supplier/types/genesis.go b/x/supplier/types/genesis.go index d7d3a341a..96f5fc63e 100644 --- a/x/supplier/types/genesis.go +++ b/x/supplier/types/genesis.go @@ -33,7 +33,7 @@ func (gs GenesisState) Validate() error { // Check that the stake value for the suppliers is valid for _, supplier := range gs.SupplierList { - // TODO_TECHDEBT: Consider creating shared helpers across the board for stake validation, + // TODO_MAINNET: Consider creating shared helpers across the board for stake validation, // similar to how we have `ValidateAppServiceConfigs` below if supplier.Stake == nil { return ErrSupplierInvalidStake.Wrapf("nil stake amount for supplier") diff --git a/x/supplier/types/message_stake_supplier.go b/x/supplier/types/message_stake_supplier.go index 535fa0d57..1c9ef498b 100644 --- a/x/supplier/types/message_stake_supplier.go +++ b/x/supplier/types/message_stake_supplier.go @@ -29,7 +29,8 @@ func (msg *MsgStakeSupplier) ValidateBasic() error { return ErrSupplierInvalidAddress.Wrapf("invalid supplier address %s; (%v)", msg.Address, err) } - // TODO_TECHDEBT: Centralize stake related verification and share across different parts of the source code + // TODO_MAINNET: Centralize stake related verification and share across different + // parts of the source code // Validate the stake amount if msg.Stake == nil { return ErrSupplierInvalidStake.Wrap("nil supplier stake") diff --git a/x/supplier/types/message_stake_supplier_test.go b/x/supplier/types/message_stake_supplier_test.go index 1f960042d..4d6fe5bb4 100644 --- a/x/supplier/types/message_stake_supplier_test.go +++ b/x/supplier/types/message_stake_supplier_test.go @@ -11,7 +11,7 @@ import ( sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) -// TODO_CLEANUP: This test has a lot of copy-pasted code from test to test. +// TODO_TECHDEBT: This test has a lot of copy-pasted code from test to test. // It can be simplified by splitting it into smaller tests where the common // fields don't need to be explicitly specified from test to test. func TestMsgStakeSupplier_ValidateBasic(t *testing.T) { diff --git a/x/tokenomics/keeper/keeper_test.go b/x/tokenomics/keeper/keeper_test.go index c9b59ab3b..6452d8da6 100644 --- a/x/tokenomics/keeper/keeper_test.go +++ b/x/tokenomics/keeper/keeper_test.go @@ -111,7 +111,7 @@ func (s *TestSuite) TestClaimSettlement_ClaimPendingBeforeSettlement() { // 2. Settle pending claims just after the session ended. // Expectations: Claims should not be settled because the proof window hasn't closed yet. - // TODO_IMPROVE(@red-0ne, @Olshansk): Use the governance parameters for more + // TODO_BLOCKER(@red-0ne): Use the governance parameters for more // precise block heights once they are implemented. blockHeight = claim.SessionHeader.SessionEndBlockHeight + 2 // session ended but proof window is still open sdkCtx = sdkCtx.WithBlockHeight(blockHeight) @@ -143,7 +143,7 @@ func (s *TestSuite) TestClaimSettlement_ClaimExpired_ProofRequiredAndNotProvided // 1. Settle pending claims after proof window closes // Expectation: All (1) claims should be expired. - // TODO_IMPROVE(@red-0ne, @Olshansk): Use the governance parameters for more precise block heights once they are implemented. + // TODO_BLOCKER(@red-0ne): Use the governance parameters for more precise block heights once they are implemented. blockHeight := claim.SessionHeader.SessionEndBlockHeight * 10 // proof window has definitely closed at this point sdkCtx = sdkCtx.WithBlockHeight(blockHeight) numClaimsSettled, numClaimsExpired, err := s.keepers.SettlePendingClaims(sdkCtx) @@ -185,7 +185,7 @@ func (s *TestSuite) TestClaimSettlement_ClaimSettled_ProofRequiredAndProvided() // 1. Settle pending claims after proof window closes // Expectation: All (1) claims should be claimed. - // TODO_IMPROVE(@red-0ne, @Olshansk): Use the governance parameters for more precise block heights once they are implemented. + // TODO_BLOCKER(@red-0ne): Use the governance parameters for more precise block heights once they are implemented. blockHeight := s.claim.SessionHeader.SessionEndBlockHeight * 10 // proof window has definitely closed at this point sdkCtx = sdkCtx.WithBlockHeight(blockHeight) numClaimsSettled, numClaimsExpired, err := s.keepers.SettlePendingClaims(sdkCtx) @@ -224,7 +224,7 @@ func (s *TestSuite) TestClaimSettlement_Settles_WhenAProofIsNotRequired() { // 1. Settle pending claims after proof window closes // Expectation: All (1) claims should be claimed. - // TODO_IMPROVE(@red-0ne, @Olshansk): Use the governance parameters for more precise block heights once they are implemented. + // TODO_BLOCKER(@red-0ne): Use the governance parameters for more precise block heights once they are implemented. blockHeight := claim.SessionHeader.SessionEndBlockHeight * 10 // proof window has definitely closed at this point sdkCtx = sdkCtx.WithBlockHeight(blockHeight) numClaimsSettled, numClaimsExpired, err := s.keepers.SettlePendingClaims(sdkCtx) diff --git a/x/tokenomics/keeper/msg_server_update_param_test.go b/x/tokenomics/keeper/msg_server_update_param_test.go index 344734671..b327cfcf9 100644 --- a/x/tokenomics/keeper/msg_server_update_param_test.go +++ b/x/tokenomics/keeper/msg_server_update_param_test.go @@ -32,5 +32,4 @@ func TestMsgUpdateParam_UpdateMinRelayDifficultyBitsOnly(t *testing.T) { // Ensure the new values are set correctly require.Equal(t, uint64(expectedComputeUnitsToTokensMultiplier), res.Params.ComputeUnitsToTokensMultiplier) - // TODO_BLOCKER: once we have more than one param per module, add assertions here which ensure that other params were not changed! } diff --git a/x/tokenomics/keeper/query_params_test.go b/x/tokenomics/keeper/query_params_test.go index 34381a7f3..42044a1ee 100644 --- a/x/tokenomics/keeper/query_params_test.go +++ b/x/tokenomics/keeper/query_params_test.go @@ -11,7 +11,7 @@ import ( func TestGetParams(t *testing.T) { k, ctx, _, _ := testkeeper.TokenomicsKeeperWithActorAddrs(t) - // TODO_INVESTIGATE(#394): Params tests don't assert initial state. + // TODO_TECHDEBT(@bryanchriswhite, #394): Params tests don't assert initial state. params := types.DefaultParams() require.NoError(t, k.SetParams(ctx, params)) diff --git a/x/tokenomics/keeper/settle_pending_claims.go b/x/tokenomics/keeper/settle_pending_claims.go index 59c87aa38..24ac68d6f 100644 --- a/x/tokenomics/keeper/settle_pending_claims.go +++ b/x/tokenomics/keeper/settle_pending_claims.go @@ -13,7 +13,7 @@ import ( ) const ( - // TODO_BLOCKER/TODO_UPNEXT(@Olshansk): Implement this properly. Using a constant + // TODO_BLOCKER(@bryanchriswhite): Implement this properly. Using a constant // for "probabilistic proofs" is just a simple placeholder mechanism to get // #359 over the finish line. ProofRequiredComputeUnits = 100 @@ -126,12 +126,12 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) (numClaimsSettled, numClaim func (k Keeper) getExpiringClaims(ctx sdk.Context) (expiringClaims []prooftypes.Claim) { blockHeight := ctx.BlockHeight() - // TODO_BLOCKER: query the on-chain governance parameter once available. + // TODO_BLOCKER(@bryanchriswhite): query the on-chain governance parameter once available. // `* 3` is just a random factor Olshansky added for now to make sure expiration // doesn't happen immediately after a session's grace period is complete. submitProofWindowEndHeight := shared.SessionGracePeriodBlocks * int64(3) - // TODO_BLOCKER(@Olshansk): Optimize this by indexing claims appropriately + // TODO_TECHDEBT: Optimize this by indexing claims appropriately // and only retrieving the claims that need to be settled rather than all // of them and iterating through them one by one. claims := k.proofKeeper.GetAllClaims(ctx) @@ -151,13 +151,13 @@ func (k Keeper) getExpiringClaims(ctx sdk.Context) (expiringClaims []prooftypes. // isProofRequiredForClaim checks if a proof is required for a claim. // If it is not, the claim will be settled without a proof. // If it is, the claim will only be settled if a valid proof is available. -// TODO_TECHDEBT(#419): Document safety assumptions of the probabilistic proofs mechanism. +// TODO_BLOCKER(@bryanchriswhite, #419): Document safety assumptions of the probabilistic proofs mechanism. func (k Keeper) isProofRequiredForClaim(_ sdk.Context, claim *prooftypes.Claim) bool { // NB: Assumption that claim is non-nil and has a valid root sum because it // is retrieved from the store and validated, on-chain, at time of creation. root := (smt.MerkleRoot)(claim.GetRootHash()) claimComputeUnits := root.Sum() - // TODO_BLOCKER(#419): This is just VERY BASIC placeholder logic to have something + // TODO_BLOCKER(@Olshansk, #419): This is just VERY BASIC placeholder logic to have something // in place while we implement proper probabilistic proofs. If you're reading it, // do not overthink it and look at the documents linked in #419. if claimComputeUnits < ProofRequiredComputeUnits { diff --git a/x/tokenomics/keeper/settle_session_accounting.go b/x/tokenomics/keeper/settle_session_accounting.go index 909517c49..9d8cee1aa 100644 --- a/x/tokenomics/keeper/settle_session_accounting.go +++ b/x/tokenomics/keeper/settle_session_accounting.go @@ -16,7 +16,7 @@ import ( ) const ( - // TODO_TECHDEBT: Retrieve this from the SMT package + // TODO_TECHDEBT(@Olshansk): Retrieve this from the SMT package // The number of bytes expected to be contained in the root hash being // claimed in order to represent both the digest and the sum. smstRootSize = 40 @@ -29,7 +29,7 @@ const ( // ASSUMPTION: It is assumed the caller of this function validated the claim // against a proof BEFORE calling this function. // -// TODO_BLOCKER(@Olshansk): Is there a way to limit who can call this function? +// TODO_MAINNET(@Olshansk): Research if there's a way to limit who can call this function? func (k Keeper) SettleSessionAccounting( ctx context.Context, claim *prooftypes.Claim, @@ -75,7 +75,7 @@ func (k Keeper) SettleSessionAccounting( // Retrieve the sum of the root as a proxy into the amount of work done root := (smt.MerkleRoot)(claim.GetRootHash()) - // TODO_DISCUSS: This check should be the responsibility of the SMST package + // TODO_BLOCKER(@Olshansk): This check should be the responsibility of the SMST package // since it's used to get compute units from the root hash. if root == nil || len(root) != smstRootSize { logger.Error(fmt.Sprintf("received an invalid root hash of size: %d", len(root))) @@ -153,13 +153,13 @@ func (k Keeper) SettleSessionAccounting( settlementAmtuPOKT, application.Stake, )) - // TODO_BLOCKER(@Olshansk, @RawthiL): The application was over-serviced in the last session so it basically + // TODO_MAINNET(@Olshansk, @RawthiL): The application was over-serviced in the last session so it basically // goes "into debt". Need to design a way to handle this when we implement // probabilistic proofs and add all the parameter logic. Do we touch the application balance? // Do we just let it go into debt? Do we penalize the application? Do we unstake it? Etc... settlementAmt = sdk.NewCoin("upokt", math.Int(application.Stake.Amount)) settlementAmtuPOKT = sdk.NewCoins(settlementAmt) - // TODO_BLOCKER: The application should be immediately unstaked at this point in time + // TODO_BLOCKER(@Olshansk): The application should be immediately unstaked at this point in time } // Burn uPOKT from the application module account which was held in escrow diff --git a/x/tokenomics/keeper/settle_session_accounting_test.go b/x/tokenomics/keeper/settle_session_accounting_test.go index 614f88b34..a94e01ea4 100644 --- a/x/tokenomics/keeper/settle_session_accounting_test.go +++ b/x/tokenomics/keeper/settle_session_accounting_test.go @@ -20,9 +20,6 @@ import ( tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) -// TODO_TEST(@bryanchriswhite, @Olshansk): Improve tokenomics tests (i.e. checking balances) -// once in-memory network integration tests are supported. - func TestSettleSessionAccounting_HandleAppGoingIntoDebt(t *testing.T) { keepers, ctx := testkeeper.NewTokenomicsModuleKeepers(t) @@ -59,7 +56,7 @@ func TestSettleSessionAccounting_HandleAppGoingIntoDebt(t *testing.T) { err := keepers.SettleSessionAccounting(ctx, &claim) require.NoError(t, err) - // TODO_BLOCKER: Need to make sure the application is unstaked at this point in time. + // TODO_TEST: Need to make sure the application is unstaked at this point in time. } func TestSettleSessionAccounting_ValidAccounting(t *testing.T) { diff --git a/x/tokenomics/keeper/update_relay_mining_difficulty.go b/x/tokenomics/keeper/update_relay_mining_difficulty.go index 07ca79319..6cf7d7496 100644 --- a/x/tokenomics/keeper/update_relay_mining_difficulty.go +++ b/x/tokenomics/keeper/update_relay_mining_difficulty.go @@ -25,7 +25,7 @@ const ( // the off-chain SMTs, across all suppliers, for each service. // It indirectly drives the off-chain resource requirements of the network // in additional to playing a critical role in Relay Mining. - // TODO_UPNEXT(#542, @Olshansk): Make this a governance parameter. + // TODO_BLOCKER(@Olshansk, #542): Make this a governance parameter. TargetNumRelays = uint64(10e4) ) @@ -52,7 +52,7 @@ func (k Keeper) UpdateRelayMiningDifficulty( } } - // TODO_CONSIDERATION: We could potentially compute the smoothing factor + // TODO_MAINNET(@Olshansk): We could potentially compute the smoothing factor // using a common formula, such as alpha = 2 / (N+1), where N is the number // of periods. // N := ctx.BlockHeight() - prevDifficulty.BlockHeight @@ -71,7 +71,7 @@ func (k Keeper) UpdateRelayMiningDifficulty( } k.SetRelayMiningDifficulty(ctx, newDifficulty) - // TODO_UPNEXT(#542, @Olshansk): Emit an event for the updated difficulty. + // TODO_BLOCKER(@Olshansk, #542): Emit an event for the updated difficulty. logger.Info(fmt.Sprintf("Updated relay mining difficulty for service %s at height %d from %v to %v", serviceId, sdkCtx.BlockHeight(), prevDifficulty.TargetHash, newDifficulty.TargetHash)) } diff --git a/x/tokenomics/module/tx.go b/x/tokenomics/module/tx.go index b407bafa0..8c4dfb4de 100644 --- a/x/tokenomics/module/tx.go +++ b/x/tokenomics/module/tx.go @@ -10,7 +10,7 @@ import ( ) // GetTxCmd returns the transaction commands for this module -// TODO_TECHDEBT(#370): remove if custom query commands are consolidated into AutoCLI. +// TODO_TECHDEBT(#370, @bryanchriswhite): remove if custom query commands are consolidated into AutoCLI. func (am AppModule) GetTxCmd() *cobra.Command { cmd := &cobra.Command{ Use: types.ModuleName, diff --git a/x/tokenomics/module/tx_update_params.go b/x/tokenomics/module/tx_update_params.go index 0668900ab..0f242665d 100644 --- a/x/tokenomics/module/tx_update_params.go +++ b/x/tokenomics/module/tx_update_params.go @@ -13,8 +13,7 @@ import ( var _ = strconv.Itoa(0) -// TODO_BLOCKER(#322): Update the CLI once we determine settle on how to maintain and update parameters. -// TODO_TECHDEBT(@red-0ne): Add a config file for on-chain parameters. +// TODO_BLOCKER(@bryanchriswhite, #322): Update the CLI once we determine settle on how to maintain and update parameters. func CmdUpdateParams() *cobra.Command { cmd := &cobra.Command{ Use: "update-params ", diff --git a/x/tokenomics/types/params.go b/x/tokenomics/types/params.go index 42f62d9b0..0757607b6 100644 --- a/x/tokenomics/types/params.go +++ b/x/tokenomics/types/params.go @@ -9,7 +9,7 @@ var ( KeyComputeUnitsToTokensMultiplier = []byte("ComputeUnitsToTokensMultiplier") ParamComputeUnitsToTokensMultiplier = "compute_units_to_tokens_multiplier" - DefaultComputeUnitsToTokensMultiplier uint64 = 42 // TODO_BLOCKER: Determine the default value. + DefaultComputeUnitsToTokensMultiplier uint64 = 42 // TODO_MAINNET: Determine the default value. ) // ParamKeyTable the param key table for launch module diff --git a/x/tokenomics/types/params.pb.go b/x/tokenomics/types/params.pb.go index 3cd51f78d..304b55579 100644 --- a/x/tokenomics/types/params.pb.go +++ b/x/tokenomics/types/params.pb.go @@ -27,7 +27,6 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // Params defines the parameters for the tokenomics module. type Params struct { // The amount of upokt that a compute unit should translate to when settling a session. - // TODO_DOCUMENT(@Olshansk): Make sure to document the units of this parameter (or the map) once finalized. ComputeUnitsToTokensMultiplier uint64 `protobuf:"varint,1,opt,name=compute_units_to_tokens_multiplier,json=computeUnitsToTokensMultiplier,proto3" json:"compute_units_to_tokens_multiplier" yaml:"compute_units_to_tokens_multiplier"` } From fee66f4ff20f00a9f984f4d284d573e4f37c7aea Mon Sep 17 00:00:00 2001 From: Bryan White Date: Wed, 5 Jun 2024 10:48:47 +0200 Subject: [PATCH 12/12] chore: update comments --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index cd286cda5..fe97387d1 100644 --- a/Makefile +++ b/Makefile @@ -825,7 +825,7 @@ params_update_tokenomics_all: ## Update the tokenomics module params poktrolld tx authz exec ./tools/scripts/params/tokenomics_all.json $(PARAM_FLAGS) .PHONY: params_update_tokenomics_compute_units_to_tokens_multiplier -params_update_tokenomics_compute_units_to_tokens_multiplier: ## Update the tokenomics module params +params_update_tokenomics_compute_units_to_tokens_multiplier: ## Update the tokenomics module compute_units_to_tokens_multiplier param poktrolld tx authz exec ./tools/scripts/params/tokenomics_compute_units_to_tokens_multiplier.json $(PARAM_FLAGS) ### Proof Module Params ### @@ -834,7 +834,7 @@ params_update_proof_all: ## Update the proof module params poktrolld tx authz exec ./tools/scripts/params/proof_all.json $(PARAM_FLAGS) .PHONY: params_update_proof_min_relay_difficulty_bits -params_update_proof_min_relay_difficulty_bits: ## Update the proof module params +params_update_proof_min_relay_difficulty_bits: ## Update the proof module min_relay_difficulty_bits param poktrolld tx authz exec ./tools/scripts/params/proof_min_relay_difficulty_bits.json $(PARAM_FLAGS) ### Shared Module Params ### @@ -843,19 +843,19 @@ params_update_shared_all: ## Update the session module params poktrolld tx authz exec ./tools/scripts/params/shared_all.json $(PARAM_FLAGS) .PHONY: params_update_shared_num_blocks_per_session -params_update_shared_num_blocks_per_session: ## Update the shared module params +params_update_shared_num_blocks_per_session: ## Update the shared module num_blocks_per_session param poktrolld tx authz exec ./tools/scripts/params/shared_num_blocks_per_session.json $(PARAM_FLAGS) .PHONY: params_update_shared_claim_window_open_offset_blocks -params_update_shared_claim_window_open_offset_blocks: ## Update the shared module params +params_update_shared_claim_window_open_offset_blocks: ## Update the shared module claim_window_open_offset_blocks param poktrolld tx authz exec ./tools/scripts/params/shared_claim_window_open_offset_blocks.json $(PARAM_FLAGS) .PHONY: params_update_shared_claim_window_close_offset_blocks -params_update_shared_claim_window_close_offset_blocks: ## Update the shared module params +params_update_shared_claim_window_close_offset_blocks: ## Update the shared module claim_window_close_offset_blocks param poktrolld tx authz exec ./tools/scripts/params/shared_claim_window_close_offset_blocks.json $(PARAM_FLAGS) .PHONY: params_update_shared_proof_window_open_offset_blocks -params_update_shared_proof_window_open_offset_blocks: ## Update the shared module params +params_update_shared_proof_window_open_offset_blocks: ## Update the shared module proof_window_open_offset_blocks param poktrolld tx authz exec ./tools/scripts/params/shared_proof_window_open_offset_blocks.json $(PARAM_FLAGS) .PHONY: params_query_all