From ac48a5626cf8a0b39843c59b33f15034a94a7704 Mon Sep 17 00:00:00 2001 From: Redouane Lakrache Date: Mon, 14 Oct 2024 15:06:57 +0200 Subject: [PATCH] [Tokenomics] Implement difficulty proportional rewards (#880) **This is a repost of PR #840 which did not get merged into main** ## Summary This PR incorporated the mining difficulty into the claim reward calculation. * Encapsulates the claimed tokens into a `claim.GetClaimeduPOKT(params, difficulty)` * Implements a test to assert that the difficulty based rewards are proportional to the off-chain relays served. * Removes unused `min_relay_difficulty_bits` gov. param. It is based on the preparation work of PR #836. ## Issue - #781 - #758 ## Type of change Select one or more from the following: - [x] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [ ] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [x] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - [ ] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [x] I have tested my changes using the available tooling - [x] I have commented my code - [x] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [x] I have left TODOs throughout the codebase, if applicable --- api/poktroll/proof/event.pulsar.go | 393 +++++++++--------- .../service/relay_mining_difficulty.pulsar.go | 1 + api/poktroll/tokenomics/event.pulsar.go | 296 +++++++------ .../develop/developer_guide/adding_params.md | 14 +- makefiles/params.mk | 4 - pkg/client/interface.go | 2 +- pkg/client/query/servicequerier.go | 18 +- pkg/relayer/miner/gen/gen_fixtures.go | 1 - pkg/relayer/miner/miner.go | 6 +- pkg/relayer/miner/miner_test.go | 4 +- pkg/relayer/session/claim.go | 10 +- pkg/relayer/session/proof.go | 12 +- pkg/relayer/session/session_test.go | 4 + proto/poktroll/proof/event.proto | 8 +- .../service/relay_mining_difficulty.proto | 1 + proto/poktroll/tokenomics/event.proto | 8 +- .../service/relay_mining_difficulty_test.go | 32 ++ .../relay_mining_integration_test.go | 286 ++++++++----- testutil/keeper/tokenomics.go | 19 + .../testqueryclients/servicequerier.go | 2 +- testutil/testrelayer/relays.go | 4 +- tools/scripts/params/proof_all.json | 1 - .../proof_min_relay_difficulty_bits.json | 12 - x/proof/keeper/msg_server_submit_proof.go | 22 +- x/proof/types/claim.go | 81 ++++ x/proof/types/errors.go | 1 + x/proof/types/event.pb.go | 148 +++---- .../keeper/update_relay_mining_difficulty.go | 64 ++- x/service/types/relay_mining_difficulty.pb.go | 1 + .../keeper_settle_pending_claims_test.go | 121 ++++-- x/tokenomics/keeper/settle_pending_claims.go | 64 ++- x/tokenomics/keeper/token_logic_modules.go | 32 +- .../keeper/token_logic_modules_test.go | 8 +- x/tokenomics/tokenomics.go | 28 -- x/tokenomics/types/event.pb.go | 144 +++---- 35 files changed, 1068 insertions(+), 784 deletions(-) delete mode 100644 tools/scripts/params/proof_min_relay_difficulty_bits.json delete mode 100644 x/tokenomics/tokenomics.go diff --git a/api/poktroll/proof/event.pulsar.go b/api/poktroll/proof/event.pulsar.go index be2eeaf14..2954b58b7 100644 --- a/api/poktroll/proof/event.pulsar.go +++ b/api/poktroll/proof/event.pulsar.go @@ -20,7 +20,7 @@ var ( fd_EventClaimCreated_num_relays protoreflect.FieldDescriptor fd_EventClaimCreated_num_claimed_compute_units protoreflect.FieldDescriptor fd_EventClaimCreated_num_estimated_compute_units protoreflect.FieldDescriptor - fd_EventClaimCreated_claimed_amount_upokt protoreflect.FieldDescriptor + fd_EventClaimCreated_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -30,7 +30,7 @@ func init() { fd_EventClaimCreated_num_relays = md_EventClaimCreated.Fields().ByName("num_relays") fd_EventClaimCreated_num_claimed_compute_units = md_EventClaimCreated.Fields().ByName("num_claimed_compute_units") fd_EventClaimCreated_num_estimated_compute_units = md_EventClaimCreated.Fields().ByName("num_estimated_compute_units") - fd_EventClaimCreated_claimed_amount_upokt = md_EventClaimCreated.Fields().ByName("claimed_amount_upokt") + fd_EventClaimCreated_claimed_upokt = md_EventClaimCreated.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimCreated)(nil) @@ -122,9 +122,9 @@ func (x *fastReflection_EventClaimCreated) Range(f func(protoreflect.FieldDescri return } } - if x.ClaimedAmountUpokt != nil { - value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) - if !f(fd_EventClaimCreated_claimed_amount_upokt, value) { + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimCreated_claimed_upokt, value) { return } } @@ -151,8 +151,8 @@ func (x *fastReflection_EventClaimCreated) Has(fd protoreflect.FieldDescriptor) return x.NumClaimedComputeUnits != uint64(0) case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": return x.NumEstimatedComputeUnits != uint64(0) - case "poktroll.proof.EventClaimCreated.claimed_amount_upokt": - return x.ClaimedAmountUpokt != nil + case "poktroll.proof.EventClaimCreated.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -177,8 +177,8 @@ func (x *fastReflection_EventClaimCreated) Clear(fd protoreflect.FieldDescriptor x.NumClaimedComputeUnits = uint64(0) case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": x.NumEstimatedComputeUnits = uint64(0) - case "poktroll.proof.EventClaimCreated.claimed_amount_upokt": - x.ClaimedAmountUpokt = nil + case "poktroll.proof.EventClaimCreated.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -207,8 +207,8 @@ func (x *fastReflection_EventClaimCreated) Get(descriptor protoreflect.FieldDesc case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": value := x.NumEstimatedComputeUnits return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventClaimCreated.claimed_amount_upokt": - value := x.ClaimedAmountUpokt + case "poktroll.proof.EventClaimCreated.claimed_upokt": + value := x.ClaimedUpokt return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -238,8 +238,8 @@ func (x *fastReflection_EventClaimCreated) Set(fd protoreflect.FieldDescriptor, x.NumClaimedComputeUnits = value.Uint() case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": x.NumEstimatedComputeUnits = value.Uint() - case "poktroll.proof.EventClaimCreated.claimed_amount_upokt": - x.ClaimedAmountUpokt = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.proof.EventClaimCreated.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimCreated")) @@ -265,11 +265,11 @@ func (x *fastReflection_EventClaimCreated) Mutable(fd protoreflect.FieldDescript x.Claim = new(Claim) } return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) - case "poktroll.proof.EventClaimCreated.claimed_amount_upokt": - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = new(v1beta1.Coin) + case "poktroll.proof.EventClaimCreated.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) } - return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventClaimCreated.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventClaimCreated is not mutable")) case "poktroll.proof.EventClaimCreated.num_claimed_compute_units": @@ -298,7 +298,7 @@ func (x *fastReflection_EventClaimCreated) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.proof.EventClaimCreated.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventClaimCreated.claimed_amount_upokt": + case "poktroll.proof.EventClaimCreated.claimed_upokt": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -383,8 +383,8 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { if x.NumEstimatedComputeUnits != 0 { n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) } - if x.ClaimedAmountUpokt != nil { - l = options.Size(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -416,8 +416,8 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ClaimedAmountUpokt != nil { - encoded, err := options.Marshal(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -603,7 +603,7 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { } case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -630,10 +630,10 @@ func (x *fastReflection_EventClaimCreated) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = &v1beta1.Coin{} + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -678,7 +678,7 @@ var ( fd_EventClaimUpdated_num_relays protoreflect.FieldDescriptor fd_EventClaimUpdated_num_claimed_compute_units protoreflect.FieldDescriptor fd_EventClaimUpdated_num_estimated_compute_units protoreflect.FieldDescriptor - fd_EventClaimUpdated_claimed_amount_upokt protoreflect.FieldDescriptor + fd_EventClaimUpdated_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -688,7 +688,7 @@ func init() { fd_EventClaimUpdated_num_relays = md_EventClaimUpdated.Fields().ByName("num_relays") fd_EventClaimUpdated_num_claimed_compute_units = md_EventClaimUpdated.Fields().ByName("num_claimed_compute_units") fd_EventClaimUpdated_num_estimated_compute_units = md_EventClaimUpdated.Fields().ByName("num_estimated_compute_units") - fd_EventClaimUpdated_claimed_amount_upokt = md_EventClaimUpdated.Fields().ByName("claimed_amount_upokt") + fd_EventClaimUpdated_claimed_upokt = md_EventClaimUpdated.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimUpdated)(nil) @@ -780,9 +780,9 @@ func (x *fastReflection_EventClaimUpdated) Range(f func(protoreflect.FieldDescri return } } - if x.ClaimedAmountUpokt != nil { - value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) - if !f(fd_EventClaimUpdated_claimed_amount_upokt, value) { + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimUpdated_claimed_upokt, value) { return } } @@ -809,8 +809,8 @@ func (x *fastReflection_EventClaimUpdated) Has(fd protoreflect.FieldDescriptor) return x.NumClaimedComputeUnits != uint64(0) case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": return x.NumEstimatedComputeUnits != uint64(0) - case "poktroll.proof.EventClaimUpdated.claimed_amount_upokt": - return x.ClaimedAmountUpokt != nil + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -835,8 +835,8 @@ func (x *fastReflection_EventClaimUpdated) Clear(fd protoreflect.FieldDescriptor x.NumClaimedComputeUnits = uint64(0) case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": x.NumEstimatedComputeUnits = uint64(0) - case "poktroll.proof.EventClaimUpdated.claimed_amount_upokt": - x.ClaimedAmountUpokt = nil + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -865,8 +865,8 @@ func (x *fastReflection_EventClaimUpdated) Get(descriptor protoreflect.FieldDesc case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": value := x.NumEstimatedComputeUnits return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventClaimUpdated.claimed_amount_upokt": - value := x.ClaimedAmountUpokt + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + value := x.ClaimedUpokt return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -896,8 +896,8 @@ func (x *fastReflection_EventClaimUpdated) Set(fd protoreflect.FieldDescriptor, x.NumClaimedComputeUnits = value.Uint() case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": x.NumEstimatedComputeUnits = value.Uint() - case "poktroll.proof.EventClaimUpdated.claimed_amount_upokt": - x.ClaimedAmountUpokt = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventClaimUpdated")) @@ -923,11 +923,11 @@ func (x *fastReflection_EventClaimUpdated) Mutable(fd protoreflect.FieldDescript x.Claim = new(Claim) } return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) - case "poktroll.proof.EventClaimUpdated.claimed_amount_upokt": - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = new(v1beta1.Coin) + case "poktroll.proof.EventClaimUpdated.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) } - return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventClaimUpdated.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventClaimUpdated is not mutable")) case "poktroll.proof.EventClaimUpdated.num_claimed_compute_units": @@ -956,7 +956,7 @@ func (x *fastReflection_EventClaimUpdated) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.proof.EventClaimUpdated.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventClaimUpdated.claimed_amount_upokt": + case "poktroll.proof.EventClaimUpdated.claimed_upokt": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -1041,8 +1041,8 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { if x.NumEstimatedComputeUnits != 0 { n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) } - if x.ClaimedAmountUpokt != nil { - l = options.Size(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1074,8 +1074,8 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ClaimedAmountUpokt != nil { - encoded, err := options.Marshal(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1261,7 +1261,7 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { } case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1288,10 +1288,10 @@ func (x *fastReflection_EventClaimUpdated) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = &v1beta1.Coin{} + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -1337,7 +1337,7 @@ var ( fd_EventProofSubmitted_num_relays protoreflect.FieldDescriptor fd_EventProofSubmitted_num_claimed_compute_units protoreflect.FieldDescriptor fd_EventProofSubmitted_num_estimated_compute_units protoreflect.FieldDescriptor - fd_EventProofSubmitted_claimed_amount_upokt protoreflect.FieldDescriptor + fd_EventProofSubmitted_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -1348,7 +1348,7 @@ func init() { fd_EventProofSubmitted_num_relays = md_EventProofSubmitted.Fields().ByName("num_relays") fd_EventProofSubmitted_num_claimed_compute_units = md_EventProofSubmitted.Fields().ByName("num_claimed_compute_units") fd_EventProofSubmitted_num_estimated_compute_units = md_EventProofSubmitted.Fields().ByName("num_estimated_compute_units") - fd_EventProofSubmitted_claimed_amount_upokt = md_EventProofSubmitted.Fields().ByName("claimed_amount_upokt") + fd_EventProofSubmitted_claimed_upokt = md_EventProofSubmitted.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventProofSubmitted)(nil) @@ -1446,9 +1446,9 @@ func (x *fastReflection_EventProofSubmitted) Range(f func(protoreflect.FieldDesc return } } - if x.ClaimedAmountUpokt != nil { - value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) - if !f(fd_EventProofSubmitted_claimed_amount_upokt, value) { + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventProofSubmitted_claimed_upokt, value) { return } } @@ -1477,8 +1477,8 @@ func (x *fastReflection_EventProofSubmitted) Has(fd protoreflect.FieldDescriptor return x.NumClaimedComputeUnits != uint64(0) case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": return x.NumEstimatedComputeUnits != uint64(0) - case "poktroll.proof.EventProofSubmitted.claimed_amount_upokt": - return x.ClaimedAmountUpokt != nil + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1505,8 +1505,8 @@ func (x *fastReflection_EventProofSubmitted) Clear(fd protoreflect.FieldDescript x.NumClaimedComputeUnits = uint64(0) case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": x.NumEstimatedComputeUnits = uint64(0) - case "poktroll.proof.EventProofSubmitted.claimed_amount_upokt": - x.ClaimedAmountUpokt = nil + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1538,8 +1538,8 @@ func (x *fastReflection_EventProofSubmitted) Get(descriptor protoreflect.FieldDe case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": value := x.NumEstimatedComputeUnits return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventProofSubmitted.claimed_amount_upokt": - value := x.ClaimedAmountUpokt + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + value := x.ClaimedUpokt return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -1571,8 +1571,8 @@ func (x *fastReflection_EventProofSubmitted) Set(fd protoreflect.FieldDescriptor x.NumClaimedComputeUnits = value.Uint() case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": x.NumEstimatedComputeUnits = value.Uint() - case "poktroll.proof.EventProofSubmitted.claimed_amount_upokt": - x.ClaimedAmountUpokt = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofSubmitted")) @@ -1603,11 +1603,11 @@ func (x *fastReflection_EventProofSubmitted) Mutable(fd protoreflect.FieldDescri x.Proof = new(Proof) } return protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) - case "poktroll.proof.EventProofSubmitted.claimed_amount_upokt": - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = new(v1beta1.Coin) + case "poktroll.proof.EventProofSubmitted.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) } - return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventProofSubmitted.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventProofSubmitted is not mutable")) case "poktroll.proof.EventProofSubmitted.num_claimed_compute_units": @@ -1639,7 +1639,7 @@ func (x *fastReflection_EventProofSubmitted) NewField(fd protoreflect.FieldDescr return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.proof.EventProofSubmitted.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventProofSubmitted.claimed_amount_upokt": + case "poktroll.proof.EventProofSubmitted.claimed_upokt": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -1728,8 +1728,8 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods if x.NumEstimatedComputeUnits != 0 { n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) } - if x.ClaimedAmountUpokt != nil { - l = options.Size(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1761,8 +1761,8 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ClaimedAmountUpokt != nil { - encoded, err := options.Marshal(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1998,7 +1998,7 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods } case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2025,10 +2025,10 @@ func (x *fastReflection_EventProofSubmitted) ProtoMethods() *protoiface.Methods if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = &v1beta1.Coin{} + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -2074,7 +2074,7 @@ var ( fd_EventProofUpdated_num_relays protoreflect.FieldDescriptor fd_EventProofUpdated_num_claimed_compute_units protoreflect.FieldDescriptor fd_EventProofUpdated_num_estimated_compute_units protoreflect.FieldDescriptor - fd_EventProofUpdated_claimed_amount_upokt protoreflect.FieldDescriptor + fd_EventProofUpdated_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -2085,7 +2085,7 @@ func init() { fd_EventProofUpdated_num_relays = md_EventProofUpdated.Fields().ByName("num_relays") fd_EventProofUpdated_num_claimed_compute_units = md_EventProofUpdated.Fields().ByName("num_claimed_compute_units") fd_EventProofUpdated_num_estimated_compute_units = md_EventProofUpdated.Fields().ByName("num_estimated_compute_units") - fd_EventProofUpdated_claimed_amount_upokt = md_EventProofUpdated.Fields().ByName("claimed_amount_upokt") + fd_EventProofUpdated_claimed_upokt = md_EventProofUpdated.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventProofUpdated)(nil) @@ -2183,9 +2183,9 @@ func (x *fastReflection_EventProofUpdated) Range(f func(protoreflect.FieldDescri return } } - if x.ClaimedAmountUpokt != nil { - value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) - if !f(fd_EventProofUpdated_claimed_amount_upokt, value) { + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventProofUpdated_claimed_upokt, value) { return } } @@ -2214,8 +2214,8 @@ func (x *fastReflection_EventProofUpdated) Has(fd protoreflect.FieldDescriptor) return x.NumClaimedComputeUnits != uint64(0) case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": return x.NumEstimatedComputeUnits != uint64(0) - case "poktroll.proof.EventProofUpdated.claimed_amount_upokt": - return x.ClaimedAmountUpokt != nil + case "poktroll.proof.EventProofUpdated.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -2242,8 +2242,8 @@ func (x *fastReflection_EventProofUpdated) Clear(fd protoreflect.FieldDescriptor x.NumClaimedComputeUnits = uint64(0) case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": x.NumEstimatedComputeUnits = uint64(0) - case "poktroll.proof.EventProofUpdated.claimed_amount_upokt": - x.ClaimedAmountUpokt = nil + case "poktroll.proof.EventProofUpdated.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -2275,8 +2275,8 @@ func (x *fastReflection_EventProofUpdated) Get(descriptor protoreflect.FieldDesc case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": value := x.NumEstimatedComputeUnits return protoreflect.ValueOfUint64(value) - case "poktroll.proof.EventProofUpdated.claimed_amount_upokt": - value := x.ClaimedAmountUpokt + case "poktroll.proof.EventProofUpdated.claimed_upokt": + value := x.ClaimedUpokt return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -2308,8 +2308,8 @@ func (x *fastReflection_EventProofUpdated) Set(fd protoreflect.FieldDescriptor, x.NumClaimedComputeUnits = value.Uint() case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": x.NumEstimatedComputeUnits = value.Uint() - case "poktroll.proof.EventProofUpdated.claimed_amount_upokt": - x.ClaimedAmountUpokt = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.proof.EventProofUpdated.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.proof.EventProofUpdated")) @@ -2340,11 +2340,11 @@ func (x *fastReflection_EventProofUpdated) Mutable(fd protoreflect.FieldDescript x.Proof = new(Proof) } return protoreflect.ValueOfMessage(x.Proof.ProtoReflect()) - case "poktroll.proof.EventProofUpdated.claimed_amount_upokt": - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = new(v1beta1.Coin) + case "poktroll.proof.EventProofUpdated.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) } - return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.proof.EventProofUpdated.num_relays": panic(fmt.Errorf("field num_relays of message poktroll.proof.EventProofUpdated is not mutable")) case "poktroll.proof.EventProofUpdated.num_claimed_compute_units": @@ -2376,7 +2376,7 @@ func (x *fastReflection_EventProofUpdated) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.proof.EventProofUpdated.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.proof.EventProofUpdated.claimed_amount_upokt": + case "poktroll.proof.EventProofUpdated.claimed_upokt": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -2465,8 +2465,8 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { if x.NumEstimatedComputeUnits != 0 { n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) } - if x.ClaimedAmountUpokt != nil { - l = options.Size(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -2498,8 +2498,8 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ClaimedAmountUpokt != nil { - encoded, err := options.Marshal(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -2735,7 +2735,7 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { } case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2762,10 +2762,10 @@ func (x *fastReflection_EventProofUpdated) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = &v1beta1.Coin{} + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -2826,7 +2826,7 @@ type EventClaimCreated struct { NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` - ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimCreated) Reset() { @@ -2877,9 +2877,9 @@ func (x *EventClaimCreated) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (x *EventClaimCreated) GetClaimedAmountUpokt() *v1beta1.Coin { +func (x *EventClaimCreated) GetClaimedUpokt() *v1beta1.Coin { if x != nil { - return x.ClaimedAmountUpokt + return x.ClaimedUpokt } return nil } @@ -2894,7 +2894,7 @@ type EventClaimUpdated struct { NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` - ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimUpdated) Reset() { @@ -2945,9 +2945,9 @@ func (x *EventClaimUpdated) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (x *EventClaimUpdated) GetClaimedAmountUpokt() *v1beta1.Coin { +func (x *EventClaimUpdated) GetClaimedUpokt() *v1beta1.Coin { if x != nil { - return x.ClaimedAmountUpokt + return x.ClaimedUpokt } return nil } @@ -2962,7 +2962,7 @@ type EventProofSubmitted struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` - ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventProofSubmitted) Reset() { @@ -3020,9 +3020,9 @@ func (x *EventProofSubmitted) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (x *EventProofSubmitted) GetClaimedAmountUpokt() *v1beta1.Coin { +func (x *EventProofSubmitted) GetClaimedUpokt() *v1beta1.Coin { if x != nil { - return x.ClaimedAmountUpokt + return x.ClaimedUpokt } return nil } @@ -3038,7 +3038,7 @@ type EventProofUpdated struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays,omitempty"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units,omitempty"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` - ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventProofUpdated) Reset() { @@ -3096,9 +3096,9 @@ func (x *EventProofUpdated) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (x *EventProofUpdated) GetClaimedAmountUpokt() *v1beta1.Coin { +func (x *EventProofUpdated) GetClaimedUpokt() *v1beta1.Coin { if x != nil { - return x.ClaimedAmountUpokt + return x.ClaimedUpokt } return nil } @@ -3113,7 +3113,7 @@ var file_poktroll_proof_event_proto_rawDesc = []byte{ 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 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, 0x1a, 0x1a, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9b, + 0x6f, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x87, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, @@ -3133,19 +3133,46 @@ var file_poktroll_proof_event_proto_rawDesc = []byte{ 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, - 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, - 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, - 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, - 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x9b, 0x03, 0x0a, - 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x87, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, + 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, + 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, + 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, + 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, + 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, + 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, + 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, + 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, + 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, + 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, + 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, + 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, + 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, + 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, + 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, + 0x6b, 0x74, 0x22, 0xc1, 0x03, 0x0a, 0x13, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, + 0x66, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, + 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, + 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, - 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, + 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, + 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, @@ -3159,72 +3186,40 @@ var file_poktroll_proof_event_proto_rawDesc = []byte{ 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, - 0x69, 0x74, 0x73, 0x12, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xea, 0xde, - 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0xd5, 0x03, 0x0a, 0x13, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x74, - 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x72, - 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, - 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, - 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, - 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, - 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, - 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, - 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, - 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, - 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x65, 0x0a, 0x14, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, - 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, - 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, - 0x6b, 0x74, 0x22, 0xd3, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x6f, - 0x66, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, - 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, - 0x12, 0x36, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x70, 0x72, 0x6f, 0x6f, - 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, - 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, - 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, - 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, - 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, - 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, - 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x43, 0x6c, - 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, - 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, - 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, - 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, - 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, - 0x73, 0x12, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xea, 0xde, 0x1f, 0x14, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, - 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, - 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x42, 0x9e, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, + 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, + 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, + 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, + 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0xbf, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, + 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x36, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, + 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, + 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x05, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x2d, 0x0a, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, + 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, + 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, + 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, + 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, + 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, + 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x42, 0x9e, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, @@ -3262,15 +3257,15 @@ var file_poktroll_proof_event_proto_goTypes = []interface{}{ } var file_poktroll_proof_event_proto_depIdxs = []int32{ 4, // 0: poktroll.proof.EventClaimCreated.claim:type_name -> poktroll.proof.Claim - 5, // 1: poktroll.proof.EventClaimCreated.claimed_amount_upokt:type_name -> cosmos.base.v1beta1.Coin + 5, // 1: poktroll.proof.EventClaimCreated.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin 4, // 2: poktroll.proof.EventClaimUpdated.claim:type_name -> poktroll.proof.Claim - 5, // 3: poktroll.proof.EventClaimUpdated.claimed_amount_upokt:type_name -> cosmos.base.v1beta1.Coin + 5, // 3: poktroll.proof.EventClaimUpdated.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin 4, // 4: poktroll.proof.EventProofSubmitted.claim:type_name -> poktroll.proof.Claim 6, // 5: poktroll.proof.EventProofSubmitted.proof:type_name -> poktroll.proof.Proof - 5, // 6: poktroll.proof.EventProofSubmitted.claimed_amount_upokt:type_name -> cosmos.base.v1beta1.Coin + 5, // 6: poktroll.proof.EventProofSubmitted.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin 4, // 7: poktroll.proof.EventProofUpdated.claim:type_name -> poktroll.proof.Claim 6, // 8: poktroll.proof.EventProofUpdated.proof:type_name -> poktroll.proof.Proof - 5, // 9: poktroll.proof.EventProofUpdated.claimed_amount_upokt:type_name -> cosmos.base.v1beta1.Coin + 5, // 9: poktroll.proof.EventProofUpdated.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin 10, // [10:10] is the sub-list for method output_type 10, // [10:10] is the sub-list for method input_type 10, // [10:10] is the sub-list for extension type_name diff --git a/api/poktroll/service/relay_mining_difficulty.pulsar.go b/api/poktroll/service/relay_mining_difficulty.pulsar.go index ba6a6bea4..10e3920a7 100644 --- a/api/poktroll/service/relay_mining_difficulty.pulsar.go +++ b/api/poktroll/service/relay_mining_difficulty.pulsar.go @@ -610,6 +610,7 @@ const ( // RelayMiningDifficulty is a message used to store the on-chain Relay Mining // difficulty associated with a specific service ID. +// TODO_TECHDEBT: Embed this message in the Service message. type RelayMiningDifficulty struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/poktroll/tokenomics/event.pulsar.go b/api/poktroll/tokenomics/event.pulsar.go index f69665680..507b21ed9 100644 --- a/api/poktroll/tokenomics/event.pulsar.go +++ b/api/poktroll/tokenomics/event.pulsar.go @@ -22,7 +22,7 @@ var ( fd_EventClaimExpired_num_relays protoreflect.FieldDescriptor fd_EventClaimExpired_num_claimed_compute_units protoreflect.FieldDescriptor fd_EventClaimExpired_num_estimated_compute_units protoreflect.FieldDescriptor - fd_EventClaimExpired_claimed_amount_upokt protoreflect.FieldDescriptor + fd_EventClaimExpired_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -33,7 +33,7 @@ func init() { fd_EventClaimExpired_num_relays = md_EventClaimExpired.Fields().ByName("num_relays") fd_EventClaimExpired_num_claimed_compute_units = md_EventClaimExpired.Fields().ByName("num_claimed_compute_units") fd_EventClaimExpired_num_estimated_compute_units = md_EventClaimExpired.Fields().ByName("num_estimated_compute_units") - fd_EventClaimExpired_claimed_amount_upokt = md_EventClaimExpired.Fields().ByName("claimed_amount_upokt") + fd_EventClaimExpired_claimed_upokt = md_EventClaimExpired.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimExpired)(nil) @@ -131,9 +131,9 @@ func (x *fastReflection_EventClaimExpired) Range(f func(protoreflect.FieldDescri return } } - if x.ClaimedAmountUpokt != nil { - value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) - if !f(fd_EventClaimExpired_claimed_amount_upokt, value) { + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimExpired_claimed_upokt, value) { return } } @@ -162,8 +162,8 @@ func (x *fastReflection_EventClaimExpired) Has(fd protoreflect.FieldDescriptor) return x.NumClaimedComputeUnits != uint64(0) case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": return x.NumEstimatedComputeUnits != uint64(0) - case "poktroll.tokenomics.EventClaimExpired.claimed_amount_upokt": - return x.ClaimedAmountUpokt != nil + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -190,8 +190,8 @@ func (x *fastReflection_EventClaimExpired) Clear(fd protoreflect.FieldDescriptor x.NumClaimedComputeUnits = uint64(0) case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": x.NumEstimatedComputeUnits = uint64(0) - case "poktroll.tokenomics.EventClaimExpired.claimed_amount_upokt": - x.ClaimedAmountUpokt = nil + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -223,8 +223,8 @@ func (x *fastReflection_EventClaimExpired) Get(descriptor protoreflect.FieldDesc case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": value := x.NumEstimatedComputeUnits return protoreflect.ValueOfUint64(value) - case "poktroll.tokenomics.EventClaimExpired.claimed_amount_upokt": - value := x.ClaimedAmountUpokt + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + value := x.ClaimedUpokt return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -256,8 +256,8 @@ func (x *fastReflection_EventClaimExpired) Set(fd protoreflect.FieldDescriptor, x.NumClaimedComputeUnits = value.Uint() case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": x.NumEstimatedComputeUnits = value.Uint() - case "poktroll.tokenomics.EventClaimExpired.claimed_amount_upokt": - x.ClaimedAmountUpokt = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimExpired")) @@ -283,11 +283,11 @@ func (x *fastReflection_EventClaimExpired) Mutable(fd protoreflect.FieldDescript x.Claim = new(proof.Claim) } return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) - case "poktroll.tokenomics.EventClaimExpired.claimed_amount_upokt": - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = new(v1beta1.Coin) + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) } - return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.tokenomics.EventClaimExpired.expiration_reason": panic(fmt.Errorf("field expiration_reason of message poktroll.tokenomics.EventClaimExpired is not mutable")) case "poktroll.tokenomics.EventClaimExpired.num_relays": @@ -320,7 +320,7 @@ func (x *fastReflection_EventClaimExpired) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.tokenomics.EventClaimExpired.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.tokenomics.EventClaimExpired.claimed_amount_upokt": + case "poktroll.tokenomics.EventClaimExpired.claimed_upokt": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -408,8 +408,8 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { if x.NumEstimatedComputeUnits != 0 { n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) } - if x.ClaimedAmountUpokt != nil { - l = options.Size(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -441,8 +441,8 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ClaimedAmountUpokt != nil { - encoded, err := options.Marshal(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -652,7 +652,7 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { } case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -679,10 +679,10 @@ func (x *fastReflection_EventClaimExpired) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = &v1beta1.Coin{} + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -728,7 +728,7 @@ var ( fd_EventClaimSettled_num_relays protoreflect.FieldDescriptor fd_EventClaimSettled_num_claimed_compute_units protoreflect.FieldDescriptor fd_EventClaimSettled_num_estimated_compute_units protoreflect.FieldDescriptor - fd_EventClaimSettled_claimed_amount_upokt protoreflect.FieldDescriptor + fd_EventClaimSettled_claimed_upokt protoreflect.FieldDescriptor ) func init() { @@ -739,7 +739,7 @@ func init() { fd_EventClaimSettled_num_relays = md_EventClaimSettled.Fields().ByName("num_relays") fd_EventClaimSettled_num_claimed_compute_units = md_EventClaimSettled.Fields().ByName("num_claimed_compute_units") fd_EventClaimSettled_num_estimated_compute_units = md_EventClaimSettled.Fields().ByName("num_estimated_compute_units") - fd_EventClaimSettled_claimed_amount_upokt = md_EventClaimSettled.Fields().ByName("claimed_amount_upokt") + fd_EventClaimSettled_claimed_upokt = md_EventClaimSettled.Fields().ByName("claimed_upokt") } var _ protoreflect.Message = (*fastReflection_EventClaimSettled)(nil) @@ -837,9 +837,9 @@ func (x *fastReflection_EventClaimSettled) Range(f func(protoreflect.FieldDescri return } } - if x.ClaimedAmountUpokt != nil { - value := protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) - if !f(fd_EventClaimSettled_claimed_amount_upokt, value) { + if x.ClaimedUpokt != nil { + value := protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) + if !f(fd_EventClaimSettled_claimed_upokt, value) { return } } @@ -868,8 +868,8 @@ func (x *fastReflection_EventClaimSettled) Has(fd protoreflect.FieldDescriptor) return x.NumClaimedComputeUnits != uint64(0) case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": return x.NumEstimatedComputeUnits != uint64(0) - case "poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt": - return x.ClaimedAmountUpokt != nil + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + return x.ClaimedUpokt != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) @@ -896,8 +896,8 @@ func (x *fastReflection_EventClaimSettled) Clear(fd protoreflect.FieldDescriptor x.NumClaimedComputeUnits = uint64(0) case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": x.NumEstimatedComputeUnits = uint64(0) - case "poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt": - x.ClaimedAmountUpokt = nil + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + x.ClaimedUpokt = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) @@ -929,8 +929,8 @@ func (x *fastReflection_EventClaimSettled) Get(descriptor protoreflect.FieldDesc case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": value := x.NumEstimatedComputeUnits return protoreflect.ValueOfUint64(value) - case "poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt": - value := x.ClaimedAmountUpokt + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + value := x.ClaimedUpokt return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { @@ -962,8 +962,8 @@ func (x *fastReflection_EventClaimSettled) Set(fd protoreflect.FieldDescriptor, x.NumClaimedComputeUnits = value.Uint() case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": x.NumEstimatedComputeUnits = value.Uint() - case "poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt": - x.ClaimedAmountUpokt = value.Message().Interface().(*v1beta1.Coin) + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + x.ClaimedUpokt = value.Message().Interface().(*v1beta1.Coin) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: poktroll.tokenomics.EventClaimSettled")) @@ -989,11 +989,11 @@ func (x *fastReflection_EventClaimSettled) Mutable(fd protoreflect.FieldDescript x.Claim = new(proof.Claim) } return protoreflect.ValueOfMessage(x.Claim.ProtoReflect()) - case "poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt": - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = new(v1beta1.Coin) + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = new(v1beta1.Coin) } - return protoreflect.ValueOfMessage(x.ClaimedAmountUpokt.ProtoReflect()) + return protoreflect.ValueOfMessage(x.ClaimedUpokt.ProtoReflect()) case "poktroll.tokenomics.EventClaimSettled.proof_requirement": panic(fmt.Errorf("field proof_requirement of message poktroll.tokenomics.EventClaimSettled is not mutable")) case "poktroll.tokenomics.EventClaimSettled.num_relays": @@ -1026,7 +1026,7 @@ func (x *fastReflection_EventClaimSettled) NewField(fd protoreflect.FieldDescrip return protoreflect.ValueOfUint64(uint64(0)) case "poktroll.tokenomics.EventClaimSettled.num_estimated_compute_units": return protoreflect.ValueOfUint64(uint64(0)) - case "poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt": + case "poktroll.tokenomics.EventClaimSettled.claimed_upokt": m := new(v1beta1.Coin) return protoreflect.ValueOfMessage(m.ProtoReflect()) default: @@ -1114,8 +1114,8 @@ func (x *fastReflection_EventClaimSettled) ProtoMethods() *protoiface.Methods { if x.NumEstimatedComputeUnits != 0 { n += 1 + runtime.Sov(uint64(x.NumEstimatedComputeUnits)) } - if x.ClaimedAmountUpokt != nil { - l = options.Size(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + l = options.Size(x.ClaimedUpokt) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -1147,8 +1147,8 @@ func (x *fastReflection_EventClaimSettled) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.ClaimedAmountUpokt != nil { - encoded, err := options.Marshal(x.ClaimedAmountUpokt) + if x.ClaimedUpokt != nil { + encoded, err := options.Marshal(x.ClaimedUpokt) if err != nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -1358,7 +1358,7 @@ func (x *fastReflection_EventClaimSettled) ProtoMethods() *protoiface.Methods { } case 6: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1385,10 +1385,10 @@ func (x *fastReflection_EventClaimSettled) ProtoMethods() *protoiface.Methods { if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - if x.ClaimedAmountUpokt == nil { - x.ClaimedAmountUpokt = &v1beta1.Coin{} + if x.ClaimedUpokt == nil { + x.ClaimedUpokt = &v1beta1.Coin{} } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedAmountUpokt); err != nil { + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.ClaimedUpokt); err != nil { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex @@ -2697,9 +2697,9 @@ type EventClaimExpired struct { // Number of estimated compute units claimed as a function of the number of claimed // compute units and the relay difficulty multiplier for the particular service. NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` - // The amount of uPOKT claimed to be rewarded for the work done as a function of + // The uPOKT coin claimed to be rewarded for the work done as a function of // the number of estimated compute units and the compute uints to token multiplier. - ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimExpired) Reset() { @@ -2757,9 +2757,9 @@ func (x *EventClaimExpired) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (x *EventClaimExpired) GetClaimedAmountUpokt() *v1beta1.Coin { +func (x *EventClaimExpired) GetClaimedUpokt() *v1beta1.Coin { if x != nil { - return x.ClaimedAmountUpokt + return x.ClaimedUpokt } return nil } @@ -2782,9 +2782,9 @@ type EventClaimSettled struct { // Number of estimated compute units claimed as a function of the number of claimed // compute units and the relay difficulty multiplier for the particular service. NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units,omitempty"` - // The amount of uPOKT claimed to be rewarded for the work done as a function of + // The uPOKT coin claimed to be rewarded for the work done as a function of // the number of estimated compute units and the compute uints to token multiplier. - ClaimedAmountUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt,omitempty"` + ClaimedUpokt *v1beta1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt,omitempty"` } func (x *EventClaimSettled) Reset() { @@ -2842,9 +2842,9 @@ func (x *EventClaimSettled) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (x *EventClaimSettled) GetClaimedAmountUpokt() *v1beta1.Coin { +func (x *EventClaimSettled) GetClaimedUpokt() *v1beta1.Coin { if x != nil { - return x.ClaimedAmountUpokt + return x.ClaimedUpokt } return nil } @@ -2985,7 +2985,7 @@ var file_poktroll_tokenomics_event_proto_rawDesc = []byte{ 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, 0x1a, 0x1a, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2f, 0x74, 0x79, 0x70, - 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8b, 0x04, 0x0a, 0x11, 0x45, 0x76, 0x65, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf7, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, @@ -3012,92 +3012,90 @@ var file_poktroll_tokenomics_event_proto_rawDesc = []byte{ 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, - 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x18, 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, - 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x87, 0x04, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, - 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, - 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, - 0x69, 0x6d, 0x42, 0x09, 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x12, 0x6a, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x26, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, - 0x2e, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x70, 0x72, 0x6f, - 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x10, - 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x12, 0x2d, 0x0a, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, - 0x6c, 0x61, 0x79, 0x73, 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, - 0x58, 0x0a, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, - 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x42, 0x1d, 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, - 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, - 0x73, 0x52, 0x16, 0x6e, 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, - 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, - 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, - 0xea, 0xde, 0x1f, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, - 0x18, 0x6e, 0x75, 0x6d, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, - 0x70, 0x75, 0x74, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x65, 0x0a, 0x14, 0x63, 0x6c, 0x61, - 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, - 0x69, 0x6e, 0x42, 0x18, 0xea, 0xde, 0x1f, 0x14, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x12, 0x63, 0x6c, - 0x61, 0x69, 0x6d, 0x65, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x6f, 0x6b, 0x74, - 0x22, 0x81, 0x02, 0x0a, 0x1c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x64, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x70, 0x70, - 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x12, 0x34, 0x0a, 0x16, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x12, 0x3e, 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x62, - 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x42, 0x75, - 0x72, 0x6e, 0x12, 0x40, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, - 0x62, 0x75, 0x72, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x42, 0x75, 0x72, 0x6e, 0x22, 0xbe, 0x01, 0x0a, 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, - 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x34, 0x0a, - 0x16, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, - 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, - 0x64, 0x64, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x10, 0x6e, 0x75, 0x6d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, - 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x41, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x60, 0x0a, 0x15, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x45, 0x78, - 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x21, - 0x0a, 0x1d, 0x45, 0x58, 0x50, 0x49, 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, - 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x52, 0x4f, 0x4f, 0x46, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, - 0x4e, 0x47, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x52, 0x4f, 0x4f, 0x46, 0x5f, 0x49, 0x4e, - 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x42, 0xbc, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x17, - 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x42, 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 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, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xa2, 0x02, 0x03, 0x50, 0x54, - 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xca, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, - 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xe2, 0x02, 0x1f, - 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, - 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x3a, 0x3a, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, + 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, + 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, + 0x6b, 0x74, 0x22, 0xf3, 0x03, 0x0a, 0x11, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x42, 0x09, + 0xea, 0xde, 0x1f, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x52, 0x05, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x12, 0x6a, 0x0a, 0x11, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x70, 0x6f, + 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x2e, 0x50, 0x72, 0x6f, + 0x6f, 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x42, 0x15, 0xea, 0xde, 0x1f, 0x11, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x5f, 0x72, + 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x10, 0x70, 0x72, 0x6f, 0x6f, + 0x66, 0x52, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x0a, + 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, + 0x42, 0x0e, 0xea, 0xde, 0x1f, 0x0a, 0x6e, 0x75, 0x6d, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x73, + 0x52, 0x09, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x6c, 0x61, 0x79, 0x73, 0x12, 0x58, 0x0a, 0x19, 0x6e, + 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, + 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1d, + 0xea, 0xde, 0x1f, 0x19, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x5f, + 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x16, 0x6e, + 0x75, 0x6d, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x5e, 0x0a, 0x1b, 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, + 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, + 0x6e, 0x69, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x42, 0x1f, 0xea, 0xde, 0x1f, 0x1b, + 0x6e, 0x75, 0x6d, 0x5f, 0x65, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, + 0x6d, 0x70, 0x75, 0x74, 0x65, 0x5f, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x52, 0x18, 0x6e, 0x75, 0x6d, + 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, + 0x55, 0x6e, 0x69, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x65, 0x64, + 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x11, 0xea, 0xde, 0x1f, 0x0d, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x65, 0x64, 0x5f, 0x75, 0x70, 0x6f, 0x6b, 0x74, 0x52, 0x0c, 0x63, 0x6c, 0x61, 0x69, + 0x6d, 0x65, 0x64, 0x55, 0x70, 0x6f, 0x6b, 0x74, 0x22, 0x81, 0x02, 0x0a, 0x1c, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x76, 0x65, + 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x70, 0x70, + 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x64, 0x64, 0x72, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, + 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x3e, 0x0a, 0x0d, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0c, 0x65, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x40, 0x0a, 0x0e, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x62, 0x75, 0x72, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0d, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x42, 0x75, 0x72, 0x6e, 0x22, 0xbe, 0x01, 0x0a, + 0x14, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x65, 0x64, 0x12, 0x34, 0x0a, 0x16, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x5f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x12, 0x2c, 0x0a, 0x12, 0x6e, + 0x75, 0x6d, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x63, 0x6c, 0x61, 0x69, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x45, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x73, 0x12, 0x42, 0x0a, 0x0f, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x69, 0x6e, 0x67, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x0e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x69, 0x6e, 0x67, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x60, 0x0a, + 0x15, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x45, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x1d, 0x45, 0x58, 0x50, 0x49, 0x52, 0x41, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, + 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x50, 0x52, 0x4f, + 0x4f, 0x46, 0x5f, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, + 0x50, 0x52, 0x4f, 0x4f, 0x46, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x02, 0x42, + 0xbc, 0x01, 0xd8, 0xe2, 0x1e, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x70, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x42, + 0x0a, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 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, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, + 0x69, 0x63, 0x73, 0xa2, 0x02, 0x03, 0x50, 0x54, 0x58, 0xaa, 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, + 0x72, 0x6f, 0x6c, 0x6c, 0x2e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xca, + 0x02, 0x13, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x6f, 0x6d, 0x69, 0x63, 0x73, 0xe2, 0x02, 0x1f, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, 0x6c, 0x6c, + 0x5c, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, 0x50, 0x6f, 0x6b, 0x74, 0x72, 0x6f, + 0x6c, 0x6c, 0x3a, 0x3a, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x6f, 0x6d, 0x69, 0x63, 0x73, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3127,10 +3125,10 @@ var file_poktroll_tokenomics_event_proto_goTypes = []interface{}{ var file_poktroll_tokenomics_event_proto_depIdxs = []int32{ 5, // 0: poktroll.tokenomics.EventClaimExpired.claim:type_name -> poktroll.proof.Claim 0, // 1: poktroll.tokenomics.EventClaimExpired.expiration_reason:type_name -> poktroll.tokenomics.ClaimExpirationReason - 6, // 2: poktroll.tokenomics.EventClaimExpired.claimed_amount_upokt:type_name -> cosmos.base.v1beta1.Coin + 6, // 2: poktroll.tokenomics.EventClaimExpired.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin 5, // 3: poktroll.tokenomics.EventClaimSettled.claim:type_name -> poktroll.proof.Claim 7, // 4: poktroll.tokenomics.EventClaimSettled.proof_requirement:type_name -> poktroll.proof.ProofRequirementReason - 6, // 5: poktroll.tokenomics.EventClaimSettled.claimed_amount_upokt:type_name -> cosmos.base.v1beta1.Coin + 6, // 5: poktroll.tokenomics.EventClaimSettled.claimed_upokt:type_name -> cosmos.base.v1beta1.Coin 6, // 6: poktroll.tokenomics.EventApplicationOverserviced.expected_burn:type_name -> cosmos.base.v1beta1.Coin 6, // 7: poktroll.tokenomics.EventApplicationOverserviced.effective_burn:type_name -> cosmos.base.v1beta1.Coin 6, // 8: poktroll.tokenomics.EventSupplierSlashed.slashing_amount:type_name -> cosmos.base.v1beta1.Coin diff --git a/docusaurus/docs/develop/developer_guide/adding_params.md b/docusaurus/docs/develop/developer_guide/adding_params.md index 37ff71d1f..0843a6d81 100644 --- a/docusaurus/docs/develop/developer_guide/adding_params.md +++ b/docusaurus/docs/develop/developer_guide/adding_params.md @@ -148,9 +148,19 @@ with the default value for the new parameter. "@type": "/poktroll.proof.MsgUpdateParams", "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", "params": { - "min_relay_difficulty_bits": "0", "proof_request_probability": "0.25", - "proof_requirement_threshold": "20", + "proof_requirement_threshold": { + "denom": "upokt", + "amount": "20000000" + }, + "proof_missing_penalty": { + "amount": "320000000", + "denom": "upokt" + }, + "proof_submission_fee": { + "amount": "1000000", + "denom": "upokt" + }, "new_parameter_name": "100" // Add this line } } diff --git a/makefiles/params.mk b/makefiles/params.mk index e2f736f10..3e577ab52 100644 --- a/makefiles/params.mk +++ b/makefiles/params.mk @@ -40,10 +40,6 @@ params_get_proof: ## Get the proof module params 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 min_relay_difficulty_bits param - poktrolld tx authz exec ./tools/scripts/params/proof_min_relay_difficulty_bits.json $(PARAM_FLAGS) - .PHONY: params_update_proof_proof_request_probability params_update_proof_proof_request_probability: ## Update the proof module proof_request_probability param poktrolld tx authz exec ./tools/scripts/params/proof_proof_request_probability.json $(PARAM_FLAGS) diff --git a/pkg/client/interface.go b/pkg/client/interface.go index fd294b8e8..ad963cbbe 100644 --- a/pkg/client/interface.go +++ b/pkg/client/interface.go @@ -356,7 +356,7 @@ type ProofQueryClient interface { type ServiceQueryClient interface { // GetService queries the chain for the details of the service provided GetService(ctx context.Context, serviceId string) (sharedtypes.Service, error) - GetServiceRelayDifficultyTargetHash(ctx context.Context, serviceId string) (servicetypes.RelayMiningDifficulty, error) + GetServiceRelayDifficulty(ctx context.Context, serviceId string) (servicetypes.RelayMiningDifficulty, error) } // BankQueryClient defines an interface that enables the querying of the diff --git a/pkg/client/query/servicequerier.go b/pkg/client/query/servicequerier.go index af0ec64e9..6b0dba20b 100644 --- a/pkg/client/query/servicequerier.go +++ b/pkg/client/query/servicequerier.go @@ -5,8 +5,11 @@ import ( "cosmossdk.io/depinject" "github.com/cosmos/gogoproto/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" "github.com/pokt-network/poktroll/pkg/client" + "github.com/pokt-network/poktroll/pkg/crypto/protocol" servicetypes "github.com/pokt-network/poktroll/x/service/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) @@ -61,9 +64,9 @@ func (servq *serviceQuerier) GetService( return res.Service, nil } -// GetServiceRelayDifficultyTargetHash queries the onchain data for +// GetServiceRelayDifficulty queries the onchain data for // the relay mining difficulty associated with the given service. -func (servq *serviceQuerier) GetServiceRelayDifficultyTargetHash( +func (servq *serviceQuerier) GetServiceRelayDifficulty( ctx context.Context, serviceId string, ) (servicetypes.RelayMiningDifficulty, error) { @@ -72,8 +75,19 @@ func (servq *serviceQuerier) GetServiceRelayDifficultyTargetHash( } res, err := servq.serviceQuerier.RelayMiningDifficulty(ctx, req) + if status.Code(err) == codes.NotFound { + newServiceDifficulty := servicetypes.RelayMiningDifficulty{ + ServiceId: serviceId, + BlockHeight: 0, + NumRelaysEma: 0, + TargetHash: protocol.BaseRelayDifficultyHashBz, + } + + return newServiceDifficulty, nil + } if err != nil { return servicetypes.RelayMiningDifficulty{}, err } + return res.RelayMiningDifficulty, nil } diff --git a/pkg/relayer/miner/gen/gen_fixtures.go b/pkg/relayer/miner/gen/gen_fixtures.go index 01c91392b..857049f5a 100644 --- a/pkg/relayer/miner/gen/gen_fixtures.go +++ b/pkg/relayer/miner/gen/gen_fixtures.go @@ -40,7 +40,6 @@ const ( defaultSvcID = "svc1" ) -// TODO_FOLLOWUP(@olshansk, #690): Do a global anycase grep for "DifficultyBits" and update/remove things appropriately. var ( // flagDifficultyThresholdHashStr is the difficulty threshold hash, as a hex string, that a // randomized, serialized relay must be greater than to be included in the diff --git a/pkg/relayer/miner/miner.go b/pkg/relayer/miner/miner.go index 8205ae5f7..b6ed55e0e 100644 --- a/pkg/relayer/miner/miner.go +++ b/pkg/relayer/miner/miner.go @@ -128,11 +128,9 @@ func (mnr *miner) getServiceRelayDifficultyTargetHash(ctx context.Context, req * return nil, fmt.Errorf("invalid session header: %w", err) } - serviceRelayDifficulty, err := mnr.serviceQueryClient.GetServiceRelayDifficultyTargetHash(ctx, sessionHeader.ServiceId) + serviceRelayDifficulty, err := mnr.serviceQueryClient.GetServiceRelayDifficulty(ctx, sessionHeader.ServiceId) if err != nil { - // TODO_IMPROVE: log the error and a message saying the default relay difficulty target hash - // is being used. - return protocol.BaseRelayDifficultyHashBz, nil + return nil, err } return serviceRelayDifficulty.GetTargetHash(), nil diff --git a/pkg/relayer/miner/miner_test.go b/pkg/relayer/miner/miner_test.go index fc0df6b6c..7afbf69d2 100644 --- a/pkg/relayer/miner/miner_test.go +++ b/pkg/relayer/miner/miner_test.go @@ -46,12 +46,10 @@ func TestMiner_MinedRelays(t *testing.T) { expectedMinedRelays = unmarshalHexMinedRelays(t, marshaledMinableRelaysHex) ) - proofQueryClientMock := testqueryclients.NewTestProofQueryClient(t) - testqueryclients.SetServiceRelayDifficultyTargetHash(t, testSvcId, testRelayMiningTargetHash) serviceQueryClientMock := testqueryclients.NewTestServiceQueryClient(t) - deps := depinject.Supply(proofQueryClientMock, serviceQueryClientMock) + deps := depinject.Supply(serviceQueryClientMock) mnr, err := miner.NewMiner(deps) require.NoError(t, err) diff --git a/pkg/relayer/session/claim.go b/pkg/relayer/session/claim.go index ef758c28d..7bf05924b 100644 --- a/pkg/relayer/session/claim.go +++ b/pkg/relayer/session/claim.go @@ -315,10 +315,12 @@ func (rs *relayerSessionsManager) payableProofsSessionTrees( ).Warn().Msg("supplier operator cannot afford to submit proof for claim, skipping") } - logger.Warn().Msgf( - "Supplier operator %q can only afford %d out of %d claims", - supplierOpeartorAddress, len(claimableSessionTrees), len(sessionTrees), - ) + if len(claimableSessionTrees) < len(sessionTrees) { + logger.Warn().Msgf( + "Supplier operator %q can only afford %d out of %d claims", + supplierOpeartorAddress, len(claimableSessionTrees), len(sessionTrees), + ) + } return claimableSessionTrees, nil } diff --git a/pkg/relayer/session/proof.go b/pkg/relayer/session/proof.go index 5bb965f34..05f6b4cbe 100644 --- a/pkg/relayer/session/proof.go +++ b/pkg/relayer/session/proof.go @@ -15,7 +15,6 @@ import ( "github.com/pokt-network/poktroll/x/proof/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" "github.com/pokt-network/poktroll/x/shared" - tokenomics "github.com/pokt-network/poktroll/x/tokenomics" ) // submitProofs maps over the given claimedSessions observable. @@ -277,24 +276,25 @@ func (rs *relayerSessionsManager) isProofRequired( // Create the claim object and use its methods to determine if a proof is required. claim := claimFromSessionTree(sessionTree) - // Get the number of compute units accumulated through the given session. - numClaimComputeUnits, err := claim.GetNumClaimedComputeUnits() + proofParams, err := rs.proofQueryClient.GetParams(ctx) if err != nil { return false, err } - proofParams, err := rs.proofQueryClient.GetParams(ctx) + sharedParams, err := rs.sharedQueryClient.GetParams(ctx) if err != nil { return false, err } - sharedParams, err := rs.sharedQueryClient.GetParams(ctx) + // Retrieving the relay mining difficulty for the service at hand + serviceId := claim.GetSessionHeader().GetServiceId() + relayMiningDifficulty, err := rs.serviceQueryClient.GetServiceRelayDifficulty(ctx, serviceId) if err != nil { return false, err } // The amount of uPOKT being claimed. - claimedAmount, err := tokenomics.NumComputeUnitsToCoin(*sharedParams, numClaimComputeUnits) + claimedAmount, err := claim.GetClaimeduPOKT(*sharedParams, relayMiningDifficulty) if err != nil { return false, err } diff --git a/pkg/relayer/session/session_test.go b/pkg/relayer/session/session_test.go index 5fccd391b..31e094a42 100644 --- a/pkg/relayer/session/session_test.go +++ b/pkg/relayer/session/session_test.go @@ -60,6 +60,8 @@ func requireProofCountEqualsExpectedValueFromProofParams(t *testing.T, proofPara Id: "svc", ComputeUnitsPerRelay: 2, } + + testqueryclients.SetServiceRelayDifficultyTargetHash(t, service.Id, protocol.BaseRelayDifficultyHashBz) // Add the service to the existing services. testqueryclients.AddToExistingServices(t, service) @@ -157,12 +159,14 @@ func TestRelayerSessionsManager_InsufficientBalanceForProofSubmission(t *testing ComputeUnitsPerRelay: 1, } testqueryclients.AddToExistingServices(t, lowCUPRService) + testqueryclients.SetServiceRelayDifficultyTargetHash(t, lowCUPRService.Id, protocol.BaseRelayDifficultyHashBz) highCUPRService := sharedtypes.Service{ Id: "highCUPRService", ComputeUnitsPerRelay: 2, } testqueryclients.AddToExistingServices(t, highCUPRService) + testqueryclients.SetServiceRelayDifficultyTargetHash(t, highCUPRService.Id, protocol.BaseRelayDifficultyHashBz) lowCUPRServiceActiveSession := &sessiontypes.Session{ Header: &sessiontypes.SessionHeader{ diff --git a/proto/poktroll/proof/event.proto b/proto/poktroll/proof/event.proto index 303e684a9..b4e99aad9 100644 --- a/proto/poktroll/proof/event.proto +++ b/proto/poktroll/proof/event.proto @@ -13,7 +13,7 @@ message EventClaimCreated { uint64 num_relays = 2 [(gogoproto.jsontag) = "num_relays"]; uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; - cosmos.base.v1beta1.Coin claimed_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_upokt"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // TODO_TEST: Add coverage for claim updates. @@ -22,7 +22,7 @@ message EventClaimUpdated { uint64 num_relays = 2 [(gogoproto.jsontag) = "num_relays"]; uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; - cosmos.base.v1beta1.Coin claimed_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_upokt"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } message EventProofSubmitted { @@ -31,7 +31,7 @@ message EventProofSubmitted { uint64 num_relays = 3 [(gogoproto.jsontag) = "num_relays"]; uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; - cosmos.base.v1beta1.Coin claimed_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_upokt"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // TODO_TEST: Add coverage for proof updates. @@ -41,5 +41,5 @@ message EventProofUpdated { uint64 num_relays = 3 [(gogoproto.jsontag) = "num_relays"]; uint64 num_claimed_compute_units = 4 [(gogoproto.jsontag) = "num_claimed_compute_units"]; uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; - cosmos.base.v1beta1.Coin claimed_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_upokt"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } diff --git a/proto/poktroll/service/relay_mining_difficulty.proto b/proto/poktroll/service/relay_mining_difficulty.proto index b994c5db5..aaade441a 100644 --- a/proto/poktroll/service/relay_mining_difficulty.proto +++ b/proto/poktroll/service/relay_mining_difficulty.proto @@ -8,6 +8,7 @@ import "gogoproto/gogo.proto"; // RelayMiningDifficulty is a message used to store the on-chain Relay Mining // difficulty associated with a specific service ID. +// TODO_TECHDEBT: Embed this message in the Service message. message RelayMiningDifficulty { // The service ID the relay mining difficulty is associated with. string service_id = 1; diff --git a/proto/poktroll/tokenomics/event.proto b/proto/poktroll/tokenomics/event.proto index 18dc68ea2..fb807d121 100644 --- a/proto/poktroll/tokenomics/event.proto +++ b/proto/poktroll/tokenomics/event.proto @@ -29,9 +29,9 @@ message EventClaimExpired { // Number of estimated compute units claimed as a function of the number of claimed // compute units and the relay difficulty multiplier for the particular service. uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; - // The amount of uPOKT claimed to be rewarded for the work done as a function of + // The uPOKT coin claimed to be rewarded for the work done as a function of // the number of estimated compute units and the compute uints to token multiplier. - cosmos.base.v1beta1.Coin claimed_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_upokt"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // EventClaimSettled is an event emitted whenever a claim is settled. @@ -48,9 +48,9 @@ message EventClaimSettled { // Number of estimated compute units claimed as a function of the number of claimed // compute units and the relay difficulty multiplier for the particular service. uint64 num_estimated_compute_units = 5 [(gogoproto.jsontag) = "num_estimated_compute_units"]; - // The amount of uPOKT claimed to be rewarded for the work done as a function of + // The uPOKT coin claimed to be rewarded for the work done as a function of // the number of estimated compute units and the compute uints to token multiplier. - cosmos.base.v1beta1.Coin claimed_amount_upokt = 6 [(gogoproto.jsontag) = "claimed_amount_upokt"]; + cosmos.base.v1beta1.Coin claimed_upokt = 6 [(gogoproto.jsontag) = "claimed_upokt"]; } // EventApplicationOverserviced is emitted when an application has less stake than diff --git a/tests/integration/service/relay_mining_difficulty_test.go b/tests/integration/service/relay_mining_difficulty_test.go index f3048fed4..7b34bd71e 100644 --- a/tests/integration/service/relay_mining_difficulty_test.go +++ b/tests/integration/service/relay_mining_difficulty_test.go @@ -2,12 +2,15 @@ package integration_test import ( "context" + "math" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/cmd/poktrolld/cmd" "github.com/pokt-network/poktroll/pkg/crypto/protocol" testutilevents "github.com/pokt-network/poktroll/testutil/events" @@ -38,6 +41,20 @@ func TestUpdateRelayMiningDifficulty_NewServiceSeenForTheFirstTime(t *testing.T) // Get the current session and shared params session := getSession(t, integrationApp) sharedParams := getSharedParams(t, integrationApp) + proofParams := getProofParams(t, integrationApp) + + // Update the proof parameters to never require a proof, since this test is not + // submitting any proofs. + maxProofRequirementThreshold := sdk.NewInt64Coin(volatile.DenomuPOKT, math.MaxInt64) + proofParams.ProofRequirementThreshold = &maxProofRequirementThreshold + proofParams.ProofRequestProbability = 0 + + msgProofParams := prooftypes.MsgUpdateParams{ + Authority: integrationApp.GetAuthority(), + Params: proofParams, + } + _, err := integrationApp.RunMsg(t, &msgProofParams) + require.NoError(t, err) // Prepare the trie with several mined relays expectedNumRelays := uint64(100) @@ -138,6 +155,21 @@ func getSharedParams(t *testing.T, integrationApp *testutil.App) sharedtypes.Par return sharedQueryRes.Params } +// getProofParams returns the proof parameters for the current block height. +func getProofParams(t *testing.T, integrationApp *testutil.App) prooftypes.Params { + t.Helper() + + sdkCtx := integrationApp.GetSdkCtx() + + proofQueryClient := prooftypes.NewQueryClient(integrationApp.QueryHelper()) + proofParamsReq := prooftypes.QueryParamsRequest{} + + proofQueryRes, err := proofQueryClient.Params(sdkCtx, &proofParamsReq) + require.NoError(t, err) + + return proofQueryRes.Params +} + // getSession returns the current session for the default application and service. func getSession(t *testing.T, integrationApp *testutil.App) *sessiontypes.Session { t.Helper() diff --git a/tests/integration/tokenomics/relay_mining_integration_test.go b/tests/integration/tokenomics/relay_mining_integration_test.go index 3b296b298..2beeb2196 100644 --- a/tests/integration/tokenomics/relay_mining_integration_test.go +++ b/tests/integration/tokenomics/relay_mining_integration_test.go @@ -1,143 +1,215 @@ package integration_test import ( - "context" + "math" + "math/big" "testing" + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" "github.com/pokt-network/smt/kvstore/pebble" "github.com/stretchr/testify/require" - "github.com/stretchr/testify/suite" + "github.com/pokt-network/poktroll/app/volatile" "github.com/pokt-network/poktroll/pkg/crypto/protocol" - "github.com/pokt-network/poktroll/testutil/integration" - "github.com/pokt-network/poktroll/testutil/integration/suites" + testutils "github.com/pokt-network/poktroll/testutil/keeper" + "github.com/pokt-network/poktroll/testutil/sample" "github.com/pokt-network/poktroll/testutil/testrelayer" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) -var ( -// TODO_BETA(#826): Uncomment these -// Test params. -// computeUnitsToTokensMultiplier = uint64(1) // keeping the math simple -// proofRequirementThreshold = sdk.NewInt64Coin(volatile.DenomuPOKT, 1e18) +const ( + initialNumRelays = uint64(1e3) + // DEV_NOTE: Max numRelays is set so that the test doesn't timeout. + maxNumRelays = uint64(1024e3) ) -type RelayMiningIntegrationTestSuite struct { - suites.ParamsSuite -} +func TestComputeNewDifficultyHash_RewardsReflectWorkCompleted(t *testing.T) { + // Update the target number of relays to a value that suits the test. + // A too high number would make the difficulty stay at BaseRelayDifficultyHash + initialTargetRelays := servicekeeper.TargetNumRelays + servicekeeper.TargetNumRelays = 1000 + t.Cleanup(func() { + // Reset the target number of relays to its initial value. + servicekeeper.TargetNumRelays = initialTargetRelays + }) + + // Prepare the test service. + service := sharedtypes.Service{ + Id: "svc1", + Name: "svcName1", + ComputeUnitsPerRelay: 1, + OwnerAddress: sample.AccAddress(), + } -func (s *RelayMiningIntegrationTestSuite) SetupTest() { - // Construct a fresh integration app for each test. - s.NewApp(s.T()) - s.SetupTestAuthzAccounts(s.T()) - s.SetupTestAuthzGrants(s.T()) -} + // Prepare the test application. + appAddress := sample.AccAddress() + appStake := apptypes.DefaultMinStake.Add(apptypes.DefaultMinStake) + application := apptypes.Application{ + Address: appAddress, + Stake: &appStake, + ServiceConfigs: []*sharedtypes.ApplicationServiceConfig{ + {ServiceId: service.Id}, + }, + } + + // Prepare the test supplier. + supplierAddress := sample.AccAddress() + // TODO(#850): Update supplier stake to be min stake + supplierStake := sdk.NewInt64Coin(volatile.DenomuPOKT, 1000) + supplier := sharedtypes.Supplier{ + OperatorAddress: supplierAddress, + OwnerAddress: supplierAddress, + Stake: &supplierStake, + Services: []*sharedtypes.SupplierServiceConfig{ + { + ServiceId: service.Id, + RevShare: []*sharedtypes.ServiceRevenueShare{ + { + Address: supplierAddress, + RevSharePercentage: 100, + }, + }, + }, + }, + } + + keepers, ctx := testutils.NewTokenomicsModuleKeepers(t, nil, + testutils.WithService(service), + testutils.WithApplication(application), + testutils.WithSupplier(supplier), + ) + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx = sdkCtx.WithBlockHeight(1) + + // Set the CUTTM to 1 to simplify the math + sharedParams := keepers.SharedKeeper.GetParams(sdkCtx) + sharedParams.ComputeUnitsToTokensMultiplier = uint64(1) + err := keepers.SharedKeeper.SetParams(sdkCtx, sharedParams) + require.NoError(t, err) + + // Set the global proof params so we never need a proof (for simplicity of this test) + err = keepers.ProofKeeper.SetParams(sdkCtx, prooftypes.Params{ + ProofRequestProbability: 0, // we never need a proof randomly + ProofRequirementThreshold: &sdk.Coin{Denom: volatile.DenomuPOKT, Amount: sdkmath.NewInt(math.MaxInt64)}, // a VERY high threshold + }) + require.NoError(t, err) + + // Update the relay mining difficulty so there's always a difficulty to retrieve + // for the test service. + _, err = keepers.ServiceKeeper.UpdateRelayMiningDifficulty(sdkCtx, map[string]uint64{service.Id: 1}) + require.NoError(t, err) + + // Set the previous relays and rewards to be used to calculate the increase ratio. + previousNumRelays := uint64(0) + previousRewardsAmount := sdkmath.NewInt(0) + + // Set the initial difficulty multiplier to later check that it has increased. + difficultyMultiplier := big.NewRat(1, 1) + + // Monotonically increase the number of relays from a very small number + // to a very large number. + for numRelays := initialNumRelays; numRelays <= maxNumRelays; numRelays *= 2 { + getSessionReq := sessiontypes.QueryGetSessionRequest{ + ApplicationAddress: appAddress, + ServiceId: service.Id, + BlockHeight: sdkCtx.BlockHeight(), + } + sessionRes, err := keepers.SessionKeeper.GetSession(sdkCtx, &getSessionReq) + require.NoError(t, err) + + session := sessionRes.Session -func (s *RelayMiningIntegrationTestSuite) TestComputeNewDifficultyHash_RewardsReflectWorkCompleted() { - // Set the shared module param compute_units_to_tokens_multiplier. - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // _, err := s.RunUpdateParam(s.T(), - // sharedtypes.ModuleName, - // sharedtypes.ParamComputeUnitsToTokensMultiplier, - // computeUnitsToTokensMultiplier, - // ) - // require.NoError(s.T(), err) - - // Set the proof params so we never need a proof (for simplicity of this test) - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // _, err = s.RunUpdateParam(s.T(), - // prooftypes.ModuleName, - // prooftypes.ParamProofRequestProbability, - // float32(0), - // ) - // require.NoError(s.T(), err) - - // Set the proof requirement threshold to be VERY high. - // TODO_BETA(#826): wait for integration app & suites refactor to be merged. - // _, err = s.RunUpdateParam(s.T(), - // prooftypes.ModuleName, - // prooftypes.ParamProofRequirementThreshold, - // &proofRequirementThreshold, - // ) - // require.NoError(s.T(), err) - - // TODO(@red-0ne, #781): Implement this test after the business logic is done. - - /* // Determine the height at which the claim will expire. - sharedParams := sharedtypes.DefaultParams() - claimWindowSizeBlocks := int64(sharedParams.GetClaimWindowOpenOffsetBlocks() + sharedParams.GetClaimWindowCloseOffsetBlocks()) - proofWindowSizeBlocks := int64(sharedParams.GetProofWindowOpenOffsetBlocks() + sharedParams.GetProofWindowCloseOffsetBlocks()) + sessionEndToProofWindowCloseBlocks := sharedtypes.GetSessionEndToProofWindowCloseBlocks(&sharedParams) + sessionEndHeight := session.GetHeader().GetSessionEndBlockHeight() + claimExpirationHeight := sessionEndHeight + int64(sessionEndToProofWindowCloseBlocks) + 1 - app := integrationApp.DefaultApplication - supplier := integrationApp.DefaultSupplier - service := integrationApp.DefaultService + sdkCtx = sdkCtx.WithBlockHeight(claimExpirationHeight) - // Monotonically increase the number of relays from a very small number - // to a very large number - for numRelays := uint64(1e3); numRelays <= 1e16; numRelays *= 10 { - session := getSession(t, integrationApp) + // Get the relay mining difficulty that will be used when settling the pending claims. + relayMiningDifficulty, ok := keepers.ServiceKeeper.GetRelayMiningDifficulty(sdkCtx, service.Id) + require.True(t, ok) - sessionEndHeight := session.GetHeader().GetSessionEndBlockHeight() - claimExpirationHeight := int64(sessionEndHeight + claimWindowSizeBlocks + proofWindowSizeBlocks + 1) + // Prepare a claim with the given number of relays. + claim := prepareRealClaim(t, numRelays, supplierAddress, session, &service, &relayMiningDifficulty) - ctxAtHeight := sdkCtx.WithBlockHeight(claimExpirationHeight) + // Get the claim's expected reward. + claimedRewards, err := claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) + require.NoError(t, err) - relayMiningDifficulty, ok := keepers.TokenomicsKeeper.GetRelayMiningDifficulty(ctxAtHeight, service.Id) - require.True(t, ok) + // Get the number of claimed mined relays. + claimNumRelays, err := claim.GetNumRelays() + require.NoError(t, err) - // Prepare a claim with the given number of relays and store it - claim := prepareRealClaim(t, ctxAtHeight, integrationApp, numRelays, app, supplier, session, service, &relayMiningDifficulty) - keepers.ProofKeeper.UpsertClaim(ctxAtHeight, *claim) + // Store the claim before settling it. + keepers.ProofKeeper.UpsertClaim(sdkCtx, *claim) - // Calling SettlePendingClaims calls ProcessTokenLogicModules behind the scenes - settledResult, expiredResult, err := keepers.TokenomicsKeeper.SettlePendingClaims(ctxAtHeight) - require.NoError(t, err) - require.Equal(t, 1, int(settledResult.NumClaims)) - require.Equal(t, 0, int(expiredResult.NumClaims)) + // Calling SettlePendingClaims calls ProcessTokenLogicModules behind the scenes + settledResult, expiredResult, err := keepers.Keeper.SettlePendingClaims(sdkCtx) + require.NoError(t, err) + require.Equal(t, 1, int(settledResult.NumClaims)) + require.Equal(t, 0, int(expiredResult.NumClaims)) - // Update the relay mining difficulty - _, err = keepers.TokenomicsKeeper.UpdateRelayMiningDifficulty(ctxAtHeight, map[string]uint64{service.Id: numRelays}) - require.NoError(t, err) + // Update the relay mining difficulty + _, err = keepers.Keeper.UpdateRelayMiningDifficulty(sdkCtx, map[string]uint64{service.Id: claimNumRelays}) + require.NoError(t, err) - // Compute the expected reward - expectedReward := numRelays * serviceComputeUnitsPerRelay * computeUnitsToTokensMultiplier - fmt.Println("Expected reward:", expectedReward) + // Get the updated relay mining difficulty + updatedRelayMiningDifficulty, ok := keepers.ServiceKeeper.GetRelayMiningDifficulty(sdkCtx, service.Id) + require.True(t, ok) - // Compute the new difficulty hash - newDifficultyHash := protocol.ComputeNewDifficultyHash(ctx, numRelays) + // Compute the new difficulty hash based on the updated relay mining difficulty. + newDifficultyHash := protocol.ComputeNewDifficultyTargetHash( + protocol.BaseRelayDifficultyHashBz, + servicekeeper.TargetNumRelays, + updatedRelayMiningDifficulty.NumRelaysEma, + ) + + // Check that the updated difficulty hash is correct. + require.Equal(t, newDifficultyHash, updatedRelayMiningDifficulty.TargetHash) - // // Check that the new difficulty hash is correct - require.Equal(t, expectedReward, newDifficultyHash.Reward) + // Check that the new relays EMA has increased. + require.Greater(t, + updatedRelayMiningDifficulty.NumRelaysEma, + relayMiningDifficulty.NumRelaysEma, + ) - // Update the relay mining difficulty and - // - Check that EMA is changing - // - Check that the difficulty is changing + prevDifficultyMultiplier := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.TargetHash) + newDifficultyMultiplier := protocol.GetRelayDifficultyMultiplier(updatedRelayMiningDifficulty.TargetHash) + // Check that the new difficulty has increased when it's no longer the base difficulty. + if newDifficultyMultiplier.Cmp(big.NewRat(1, 1)) == 1 { + require.True(t, newDifficultyMultiplier.Cmp(prevDifficultyMultiplier) == 1) + } - // Maintain a map of {num_relays -> num_rewards} - // Then compute, for everything we have in the map (double list) - // - Ratio of curr_relays to prev_relays - // - Ratio of curr_rewards to prev_rewards - // - Ensure the above are the same + // Make sure that the rewards reflect the work completed and that it increases + // proportionally to the number of relays mined. + if previousNumRelays > 0 { + numRelaysRatio := float64(numRelays) / float64(previousNumRelays) + rewardsRatio, _ := new(big.Rat).SetFrac(claimedRewards.Amount.BigInt(), previousRewardsAmount.BigInt()).Float64() + require.InDelta(t, numRelaysRatio, rewardsRatio, 0.1) } - */ + + previousNumRelays = numRelays + previousRewardsAmount = claimedRewards.Amount + difficultyMultiplier = newDifficultyMultiplier + } + + require.Equal(t, difficultyMultiplier.Cmp(big.NewRat(1, 1)), 1) } // prepareRealClaim prepares a claim by creating a real SMST with the given number // of mined relays that adhere to the actual on-chain difficulty of the test service. -// -//nolint:unused // Will be used once the test above is implemented. func prepareRealClaim( - t *testing.T, ctx context.Context, - integrationApp *integration.App, + t *testing.T, numRelays uint64, - app *apptypes.Application, - supplier *sharedtypes.Supplier, + supplierAddress string, session *sessiontypes.Session, service *sharedtypes.Service, relayMiningDifficulty *servicetypes.RelayMiningDifficulty, @@ -153,30 +225,20 @@ func prepareRealClaim( // Insert the mined relays into the SMST for i := uint64(0); i < numRelays; i++ { - // Mine a real relay - minedRelay := testrelayer.NewSignedMinedRelay(t, ctx, - session, - app.Address, - supplier.OperatorAddress, - integrationApp.DefaultSupplierKeyringKeyringUid, - integrationApp.GetKeyRing(), - integrationApp.GetRingClient(), - ) + // DEV_NOTE: Unsigned relays are mined instead of signed relays to avoid calling + // the application querier and signature logic which make the test very slow + // given the large number of iterations involved. + minedRelay := testrelayer.NewUnsignedMinedRelay(t, session, supplierAddress) // Ensure that the relay is applicable to the relay mining difficulty if protocol.IsRelayVolumeApplicable(minedRelay.Hash, relayMiningDifficulty.TargetHash) { err = trie.Update(minedRelay.Hash, minedRelay.Bytes, service.ComputeUnitsPerRelay) require.NoError(t, err) } } - // Return the applicable claim return &prooftypes.Claim{ - SupplierOperatorAddress: integrationApp.DefaultSupplier.GetOperatorAddress(), + SupplierOperatorAddress: supplierAddress, SessionHeader: session.GetHeader(), RootHash: trie.Root(), } } - -func TestRelayMiningIntegrationSuite(t *testing.T) { - suite.Run(t, new(RelayMiningIntegrationTestSuite)) -} diff --git a/testutil/keeper/tokenomics.go b/testutil/keeper/tokenomics.go index d6a50ed25..f9df12788 100644 --- a/testutil/keeper/tokenomics.go +++ b/testutil/keeper/tokenomics.go @@ -470,6 +470,7 @@ func NewTokenomicsModuleKeepers( return keepers, ctx } +// WithService is an option to set the service in the tokenomics module keepers. func WithService(service sharedtypes.Service) TokenomicsModuleKeepersOpt { return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { keepers.SetService(ctx, service) @@ -477,6 +478,24 @@ func WithService(service sharedtypes.Service) TokenomicsModuleKeepersOpt { } } +// WithApplication is an option to set the application in the tokenomics module keepers. +func WithApplication(applicaion apptypes.Application) TokenomicsModuleKeepersOpt { + return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { + keepers.SetApplication(ctx, applicaion) + return ctx + } +} + +// WithSupplier is an option to set the supplier in the tokenomics module keepers. +func WithSupplier(supplier sharedtypes.Supplier) TokenomicsModuleKeepersOpt { + return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { + keepers.SetSupplier(ctx, supplier) + return ctx + } +} + +// WithProposerAddr is an option to set the proposer address in the context used +// by the tokenomics module keepers. func WithProposerAddr(addr string) TokenomicsModuleKeepersOpt { return func(ctx context.Context, keepers *TokenomicsModuleKeepers) context.Context { valAddr, err := cosmostypes.ValAddressFromBech32(addr) diff --git a/testutil/testclient/testqueryclients/servicequerier.go b/testutil/testclient/testqueryclients/servicequerier.go index d68c2ea3c..58f88c2f8 100644 --- a/testutil/testclient/testqueryclients/servicequerier.go +++ b/testutil/testclient/testqueryclients/servicequerier.go @@ -50,7 +50,7 @@ func NewTestServiceQueryClient( }). AnyTimes() - serviceQuerier.EXPECT().GetServiceRelayDifficultyTargetHash(gomock.Any(), gomock.Any()). + serviceQuerier.EXPECT().GetServiceRelayDifficulty(gomock.Any(), gomock.Any()). DoAndReturn(func( _ context.Context, serviceId string, diff --git a/testutil/testrelayer/relays.go b/testutil/testrelayer/relays.go index 01223f7a5..3b1ac2f91 100644 --- a/testutil/testrelayer/relays.go +++ b/testutil/testrelayer/relays.go @@ -45,13 +45,13 @@ func NewUnsignedMinedRelay( SessionHeader: session.Header, SupplierOperatorAddress: supplierOperatorAddress, }, - Payload: []byte("request_payload"), + Payload: randomPayload(), }, Res: &servicetypes.RelayResponse{ Meta: servicetypes.RelayResponseMetadata{ SessionHeader: session.Header, }, - Payload: []byte("response_payload"), + Payload: randomPayload(), }, } diff --git a/tools/scripts/params/proof_all.json b/tools/scripts/params/proof_all.json index 182ce6316..73e080cd9 100644 --- a/tools/scripts/params/proof_all.json +++ b/tools/scripts/params/proof_all.json @@ -5,7 +5,6 @@ "@type": "/poktroll.proof.MsgUpdateParams", "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", "params": { - "min_relay_difficulty_bits": "0", "proof_request_probability": "0.25", "proof_requirement_threshold": { "denom": "upokt", diff --git a/tools/scripts/params/proof_min_relay_difficulty_bits.json b/tools/scripts/params/proof_min_relay_difficulty_bits.json deleted file mode 100644 index 72c14a1d5..000000000 --- a/tools/scripts/params/proof_min_relay_difficulty_bits.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "body": { - "messages": [ - { - "@type": "/poktroll.proof.MsgUpdateParam", - "authority": "pokt10d07y265gmmuvt4z0w9aw880jnsr700j8yv32t", - "name": "min_relay_difficulty_bits", - "as_int64": "0" - } - ] - } -} diff --git a/x/proof/keeper/msg_server_submit_proof.go b/x/proof/keeper/msg_server_submit_proof.go index b7f90fa36..4101cbfed 100644 --- a/x/proof/keeper/msg_server_submit_proof.go +++ b/x/proof/keeper/msg_server_submit_proof.go @@ -15,9 +15,9 @@ import ( "github.com/pokt-network/poktroll/telemetry" "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - "github.com/pokt-network/poktroll/x/tokenomics" ) // SubmitProof is the server handler to submit and store a proof on-chain. @@ -120,11 +120,12 @@ func (k msgServer) SubmitProof( if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } + // DEV_NOTE: It is assumed that numClaimComputeUnits = numRelays * serviceComputeUnitsPerRelay + // has been checked during the claim creation process. numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() if err != nil { return nil, status.Error(codes.Internal, types.ErrProofInvalidClaimRootHash.Wrap(err.Error()).Error()) } - // DEV_NOTE: It is assumed that numComputeUnits = numRelays * serviceComputeUnitsPerRelay // Check if a prior proof already exists. _, isExistingProof = k.GetProof(ctx, proof.SessionHeader.SessionId, proof.SupplierOperatorAddress) @@ -223,22 +224,19 @@ func (k Keeper) ProofRequirementForClaim(ctx context.Context, claim *types.Claim telemetry.ProofRequirementCounter(requirementReason, err) }() - // 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. - // TODO(@red-0ne, #781): Ensure we're using the scaled/estimated compute units here. - var numClaimComputeUnits uint64 - numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() - if err != nil { - return requirementReason, err - } - proofParams := k.GetParams(ctx) sharedParams := k.sharedKeeper.GetParams(ctx) + serviceId := claim.GetSessionHeader().GetServiceId() + relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, serviceId) + if !found { + relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, serviceId, servicekeeper.TargetNumRelays) + } + // Retrieve the number of tokens claimed to compare against the threshold. // Different services have varying compute_unit -> token multipliers, so the // threshold value is done in a common unit denomination. - claimeduPOKT, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits) + claimeduPOKT, err := claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) if err != nil { return requirementReason, err } diff --git a/x/proof/types/claim.go b/x/proof/types/claim.go index 37b144d6d..08b3dc406 100644 --- a/x/proof/types/claim.go +++ b/x/proof/types/claim.go @@ -1,10 +1,18 @@ package types import ( + "math/big" + + "cosmossdk.io/math" "github.com/cometbft/cometbft/crypto" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/pokt-network/smt" + "github.com/pokt-network/poktroll/app/volatile" + "github.com/pokt-network/poktroll/pkg/crypto/protocol" poktrand "github.com/pokt-network/poktroll/pkg/crypto/rand" + servicetypes "github.com/pokt-network/poktroll/x/service/types" + sharedtypes "github.com/pokt-network/poktroll/x/shared/types" ) // GetNumClaimedComputeUnits returns the number of compute units for a given claim @@ -19,6 +27,79 @@ func (claim *Claim) GetNumRelays() (numRelays uint64, err error) { return smt.MerkleSumRoot(claim.GetRootHash()).Count() } +// GetNumEstimatedComputeUnits returns the claim's estimated number of compute units. +func (claim *Claim) GetNumEstimatedComputeUnits( + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) (numEstimatedComputeUnits uint64, err error) { + numEstimatedComputeUnitsRat, err := claim.getNumEstimatedComputeUnitsRat(relayMiningDifficulty) + if err != nil { + return 0, err + } + + numerator := numEstimatedComputeUnitsRat.Num() + denominator := numEstimatedComputeUnitsRat.Denom() + + return new(big.Int).Div(numerator, denominator).Uint64(), nil +} + +// GetClaimeduPOKT returns the claim's reward based on the relay mining difficulty +// and global network parameters. +func (claim *Claim) GetClaimeduPOKT( + sharedParams sharedtypes.Params, + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) (sdk.Coin, error) { + // Get the estimated number of compute units as a ratio to calculate the reward + // to avoid precision loss. + numEstimatedComputeUnitsRat, err := claim.getNumEstimatedComputeUnitsRat(relayMiningDifficulty) + if err != nil { + return sdk.Coin{}, err + } + + computeUnitsToTokenMultiplierRat := new(big.Rat).SetUint64(sharedParams.GetComputeUnitsToTokensMultiplier()) + + // CUTTM is a GLOBAL network wide parameter. + upoktAmountRat := new(big.Rat).Mul(numEstimatedComputeUnitsRat, computeUnitsToTokenMultiplierRat) + + // Perform the division as late as possible to minimize precision loss. + upoktAmount := new(big.Int).Div(upoktAmountRat.Num(), upoktAmountRat.Denom()) + if upoktAmount.Sign() < 0 { + return sdk.Coin{}, ErrProofInvalidClaimedAmount.Wrapf( + "num estimated compute units (%s) * CUTTM (%d) resulted in a negative amount: %s", + numEstimatedComputeUnitsRat.RatString(), + sharedParams.GetComputeUnitsToTokensMultiplier(), + upoktAmountRat, + ) + } + + return sdk.NewCoin(volatile.DenomuPOKT, math.NewIntFromBigInt(upoktAmount)), nil +} + +// getNumEstimatedComputeUnitsRat returns the estimated claim's number of compute units +// as a ratio. +func (claim *Claim) getNumEstimatedComputeUnitsRat( + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) (numEstimatedComputeUnits *big.Rat, err error) { + // Ensure the claim's service ID matches the relay mining difficulty service ID. + if claim.GetSessionHeader().GetServiceId() != relayMiningDifficulty.GetServiceId() { + return nil, ErrProofInvalidRelayDifficulty.Wrapf( + "claim service ID (%s) does not match the service relay mining difficulty service ID (%s)", + claim.GetSessionHeader().GetServiceId(), + relayMiningDifficulty.GetServiceId(), + ) + } + + numComputeUnits, err := claim.GetNumClaimedComputeUnits() + if err != nil { + return nil, err + } + + numComputeUnitsRat := new(big.Rat).SetUint64(numComputeUnits) + difficultyMultiplier := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.GetTargetHash()) + numEstimatedComputeUnitsRat := new(big.Rat).Mul(difficultyMultiplier, numComputeUnitsRat) + + return numEstimatedComputeUnitsRat, nil +} + // GetHash returns the SHA-256 hash of the serialized claim. func (claim *Claim) GetHash() ([]byte, error) { claimBz, err := claim.Marshal() diff --git a/x/proof/types/errors.go b/x/proof/types/errors.go index d388b06c9..9a97711b7 100644 --- a/x/proof/types/errors.go +++ b/x/proof/types/errors.go @@ -39,4 +39,5 @@ var ( ErrProofFailedToDeductFee = sdkerrors.Register(ModuleName, 1128, "failed to deduct proof submission fee") ErrProofNotRequired = sdkerrors.Register(ModuleName, 1129, "proof not required") ErrProofInvalidRelayDifficulty = sdkerrors.Register(ModuleName, 1130, "invalid relay difficulty") + ErrProofInvalidClaimedAmount = sdkerrors.Register(ModuleName, 1131, "invalid claimed amount") ) diff --git a/x/proof/types/event.pb.go b/x/proof/types/event.pb.go index 6660aa44e..8e467c0c5 100644 --- a/x/proof/types/event.pb.go +++ b/x/proof/types/event.pb.go @@ -29,7 +29,7 @@ type EventClaimCreated struct { NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` - ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimCreated) Reset() { *m = EventClaimCreated{} } @@ -89,9 +89,9 @@ func (m *EventClaimCreated) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (m *EventClaimCreated) GetClaimedAmountUpokt() *types.Coin { +func (m *EventClaimCreated) GetClaimedUpokt() *types.Coin { if m != nil { - return m.ClaimedAmountUpokt + return m.ClaimedUpokt } return nil } @@ -102,7 +102,7 @@ type EventClaimUpdated struct { NumRelays uint64 `protobuf:"varint,2,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` - ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimUpdated) Reset() { *m = EventClaimUpdated{} } @@ -162,9 +162,9 @@ func (m *EventClaimUpdated) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (m *EventClaimUpdated) GetClaimedAmountUpokt() *types.Coin { +func (m *EventClaimUpdated) GetClaimedUpokt() *types.Coin { if m != nil { - return m.ClaimedAmountUpokt + return m.ClaimedUpokt } return nil } @@ -175,7 +175,7 @@ type EventProofSubmitted struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` - ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventProofSubmitted) Reset() { *m = EventProofSubmitted{} } @@ -242,9 +242,9 @@ func (m *EventProofSubmitted) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (m *EventProofSubmitted) GetClaimedAmountUpokt() *types.Coin { +func (m *EventProofSubmitted) GetClaimedUpokt() *types.Coin { if m != nil { - return m.ClaimedAmountUpokt + return m.ClaimedUpokt } return nil } @@ -256,7 +256,7 @@ type EventProofUpdated struct { NumRelays uint64 `protobuf:"varint,3,opt,name=num_relays,json=numRelays,proto3" json:"num_relays"` NumClaimedComputeUnits uint64 `protobuf:"varint,4,opt,name=num_claimed_compute_units,json=numClaimedComputeUnits,proto3" json:"num_claimed_compute_units"` NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` - ClaimedAmountUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt"` + ClaimedUpokt *types.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventProofUpdated) Reset() { *m = EventProofUpdated{} } @@ -323,9 +323,9 @@ func (m *EventProofUpdated) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (m *EventProofUpdated) GetClaimedAmountUpokt() *types.Coin { +func (m *EventProofUpdated) GetClaimedUpokt() *types.Coin { if m != nil { - return m.ClaimedAmountUpokt + return m.ClaimedUpokt } return nil } @@ -340,36 +340,36 @@ func init() { func init() { proto.RegisterFile("poktroll/proof/event.proto", fileDescriptor_dd4c19e04487fbec) } var fileDescriptor_dd4c19e04487fbec = []byte{ - // 456 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x41, 0x6b, 0xdb, 0x30, - 0x14, 0xc7, 0xe3, 0xa5, 0x29, 0x54, 0x83, 0xc2, 0xbc, 0x6e, 0xb8, 0x19, 0x93, 0xcb, 0x4e, 0xbd, - 0x54, 0xa2, 0x1b, 0xf4, 0xbe, 0x98, 0xde, 0x76, 0x18, 0x1e, 0x81, 0xb1, 0xc3, 0x82, 0xed, 0x68, - 0x99, 0x69, 0xa4, 0x67, 0x6c, 0xa9, 0x5b, 0xbf, 0xc5, 0xee, 0xfb, 0x42, 0x3b, 0x16, 0xc6, 0xa0, - 0x27, 0x33, 0x92, 0x9b, 0x3f, 0xc5, 0xd0, 0x53, 0x3c, 0x5a, 0xd3, 0xed, 0x92, 0x4b, 0x0e, 0x39, - 0x49, 0xfe, 0xff, 0xff, 0x4f, 0x92, 0xdf, 0x0f, 0x21, 0x32, 0x2c, 0xe0, 0x42, 0x97, 0x30, 0x9f, - 0xf3, 0xa2, 0x04, 0xf8, 0xc4, 0xc5, 0xa5, 0x50, 0x9a, 0x15, 0x25, 0x68, 0xf0, 0xf7, 0x5b, 0x8f, - 0xa1, 0x37, 0xa4, 0x19, 0x54, 0x12, 0x2a, 0x9e, 0x26, 0x95, 0xe0, 0x97, 0xa7, 0xa9, 0xd0, 0xc9, - 0x29, 0xcf, 0x20, 0x57, 0x2e, 0x3f, 0x3c, 0x98, 0xc1, 0x0c, 0x70, 0xca, 0xed, 0x6c, 0xa5, 0x76, - 0x77, 0xd0, 0x57, 0x85, 0xa8, 0x9c, 0xf7, 0xe2, 0x7b, 0x9f, 0x3c, 0x3a, 0xb7, 0x3b, 0x46, 0xf3, - 0x24, 0x97, 0x51, 0x29, 0x12, 0x2d, 0xa6, 0xfe, 0x19, 0x19, 0x64, 0xf6, 0x3b, 0xf0, 0x8e, 0xbc, - 0xe3, 0x87, 0x2f, 0x9f, 0xb0, 0xbb, 0xe7, 0x60, 0x18, 0x1e, 0xed, 0x35, 0x75, 0xe8, 0x72, 0xb1, - 0x1b, 0xfc, 0x13, 0x42, 0x94, 0x91, 0x93, 0x52, 0xcc, 0x93, 0xab, 0x2a, 0x78, 0x70, 0xe4, 0x1d, - 0xef, 0x8c, 0xf6, 0x9b, 0x3a, 0xbc, 0xa5, 0xc6, 0x7b, 0xca, 0xc8, 0x18, 0xa7, 0xfe, 0x7b, 0x72, - 0x68, 0x0d, 0xac, 0x15, 0xd3, 0x49, 0x06, 0xb2, 0x30, 0x5a, 0x4c, 0x8c, 0xca, 0x75, 0x15, 0xec, - 0x60, 0xf5, 0xf3, 0xa6, 0x0e, 0xff, 0x1d, 0x8a, 0x9f, 0x2a, 0x23, 0x23, 0xe7, 0x44, 0xce, 0x18, - 0x5b, 0xdd, 0xff, 0x48, 0x9e, 0xd9, 0x22, 0x51, 0xe9, 0x5c, 0xda, 0x3f, 0xea, 0xac, 0x3d, 0xc0, - 0xb5, 0xc3, 0xa6, 0x0e, 0xff, 0x17, 0x8b, 0x03, 0x65, 0xe4, 0x79, 0xeb, 0xdd, 0x59, 0x5f, 0x90, - 0x83, 0xf6, 0x40, 0x89, 0x04, 0xa3, 0xf4, 0xc4, 0xd8, 0x16, 0x05, 0xbb, 0xd8, 0xaf, 0x43, 0xe6, - 0x38, 0x31, 0xcb, 0x89, 0xad, 0x38, 0xb1, 0x08, 0x72, 0x35, 0x0a, 0x9a, 0x3a, 0xbc, 0xb7, 0x34, - 0xf6, 0x57, 0xea, 0x6b, 0x14, 0xc7, 0x56, 0xeb, 0xd0, 0x19, 0x17, 0xd3, 0x2d, 0x9d, 0x0d, 0xa2, - 0xf3, 0xab, 0x4f, 0x1e, 0x23, 0x9d, 0xb7, 0xb6, 0xed, 0xef, 0x4c, 0x2a, 0x73, 0xbd, 0x0e, 0x9f, - 0x33, 0x32, 0xc0, 0x00, 0xa2, 0xb9, 0xa7, 0x0e, 0xb7, 0x71, 0x75, 0x28, 0xc4, 0x6e, 0xe8, 0x70, - 0xed, 0x6f, 0xb9, 0xae, 0xc9, 0xf5, 0x67, 0x7b, 0xeb, 0xb0, 0xe1, 0xeb, 0xde, 0xba, 0x2d, 0xd5, - 0x8d, 0xa0, 0x3a, 0x7a, 0xf3, 0x63, 0x41, 0xbd, 0xeb, 0x05, 0xf5, 0x6e, 0x16, 0xd4, 0xfb, 0xbd, - 0xa0, 0xde, 0xb7, 0x25, 0xed, 0x5d, 0x2f, 0x69, 0xef, 0x66, 0x49, 0x7b, 0x1f, 0xd8, 0x2c, 0xd7, - 0x9f, 0x4d, 0xca, 0x32, 0x90, 0xdc, 0xc6, 0x4f, 0x94, 0xd0, 0x5f, 0xa0, 0xbc, 0xe0, 0x7f, 0xdf, - 0xce, 0xaf, 0xb7, 0x5f, 0xcf, 0x74, 0x17, 0x9f, 0xcf, 0x57, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x9b, 0x4e, 0x00, 0x80, 0xbe, 0x07, 0x00, 0x00, + // 451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x95, 0x3f, 0x8f, 0xd3, 0x30, + 0x18, 0xc6, 0x1b, 0x7a, 0x3d, 0xe9, 0x0c, 0x9c, 0x74, 0xe1, 0x8f, 0x72, 0x45, 0x38, 0x27, 0xa6, + 0x5b, 0xce, 0x56, 0x41, 0xea, 0x07, 0x48, 0xd4, 0x8d, 0x01, 0x82, 0x2a, 0x21, 0x06, 0xaa, 0x24, + 0x35, 0x25, 0x6a, 0x6c, 0x47, 0x89, 0x5d, 0xe8, 0x27, 0x60, 0xe5, 0x1b, 0x21, 0x36, 0xc6, 0x8e, + 0x9d, 0x22, 0x94, 0x6e, 0xf9, 0x14, 0xc8, 0x76, 0x83, 0xda, 0x08, 0x90, 0x50, 0x25, 0x58, 0x3a, + 0xc5, 0x7e, 0x9f, 0xe7, 0xb1, 0x9d, 0xf7, 0x27, 0xcb, 0xa0, 0x9f, 0xf1, 0xb9, 0xc8, 0x79, 0x9a, + 0xe2, 0x2c, 0xe7, 0xfc, 0x1d, 0x26, 0x0b, 0xc2, 0x04, 0xca, 0x72, 0x2e, 0xb8, 0x7d, 0xde, 0x68, + 0x48, 0x6b, 0x7d, 0x18, 0xf3, 0x82, 0xf2, 0x02, 0x47, 0x61, 0x41, 0xf0, 0x62, 0x10, 0x11, 0x11, + 0x0e, 0x70, 0xcc, 0x13, 0x66, 0xfc, 0xfd, 0xfb, 0x33, 0x3e, 0xe3, 0x7a, 0x88, 0xd5, 0x68, 0x5b, + 0x6d, 0xef, 0x20, 0x96, 0x19, 0x29, 0x8c, 0xf6, 0xe4, 0x53, 0x17, 0x5c, 0x8c, 0xd4, 0x8e, 0x7e, + 0x1a, 0x26, 0xd4, 0xcf, 0x49, 0x28, 0xc8, 0xd4, 0x1e, 0x82, 0x5e, 0xac, 0xe6, 0x8e, 0x75, 0x65, + 0x5d, 0xdf, 0x7e, 0xfa, 0x00, 0xed, 0x9f, 0x03, 0x69, 0xb3, 0x77, 0x56, 0x97, 0xae, 0xf1, 0x05, + 0xe6, 0x63, 0xdf, 0x00, 0xc0, 0x24, 0x9d, 0xe4, 0x24, 0x0d, 0x97, 0x85, 0x73, 0xeb, 0xca, 0xba, + 0x3e, 0xf1, 0xce, 0xeb, 0xd2, 0xdd, 0xa9, 0x06, 0x67, 0x4c, 0xd2, 0x40, 0x0f, 0xed, 0xd7, 0xe0, + 0x52, 0x09, 0x3a, 0x4b, 0xa6, 0x93, 0x98, 0xd3, 0x4c, 0x0a, 0x32, 0x91, 0x2c, 0x11, 0x85, 0x73, + 0xa2, 0xd3, 0x8f, 0xeb, 0xd2, 0xfd, 0xbd, 0x29, 0x78, 0xc8, 0x24, 0xf5, 0x8d, 0xe2, 0x1b, 0x61, + 0xac, 0xea, 0xf6, 0x5b, 0xf0, 0x48, 0x85, 0x48, 0x21, 0x12, 0xaa, 0xfe, 0xa8, 0xb5, 0x76, 0x4f, + 0xaf, 0xed, 0xd6, 0xa5, 0xfb, 0x27, 0x5b, 0xe0, 0x30, 0x49, 0x47, 0x8d, 0xb6, 0xb7, 0xfe, 0x4b, + 0x70, 0xb7, 0x39, 0x90, 0x54, 0xbd, 0x71, 0x4e, 0x75, 0xa3, 0x2e, 0x91, 0x01, 0x84, 0x14, 0x20, + 0xb4, 0x05, 0x84, 0x7c, 0x9e, 0x30, 0xef, 0xa2, 0x2e, 0xdd, 0xfd, 0x4c, 0x70, 0x67, 0x3b, 0x1d, + 0xab, 0x59, 0x8b, 0xc4, 0x38, 0x9b, 0x1e, 0x49, 0xfc, 0x27, 0x12, 0x5f, 0xbb, 0xe0, 0x9e, 0x26, + 0xf1, 0x42, 0xb5, 0xf8, 0x95, 0x8c, 0x68, 0x22, 0x0e, 0x61, 0x31, 0x04, 0x3d, 0x6d, 0xd0, 0x18, + 0x7e, 0x91, 0xd3, 0xdb, 0x98, 0x9c, 0x2e, 0x04, 0xe6, 0xd3, 0x62, 0xd8, 0x3d, 0x32, 0xfc, 0x0b, + 0x86, 0x5f, 0x9a, 0xdb, 0xa4, 0x9b, 0x7b, 0xe8, 0x6d, 0x3a, 0x12, 0xfc, 0xe7, 0x04, 0xbd, 0xe7, + 0xdf, 0x2a, 0x68, 0xad, 0x2a, 0x68, 0xad, 0x2b, 0x68, 0x7d, 0xaf, 0xa0, 0xf5, 0x79, 0x03, 0x3b, + 0xab, 0x0d, 0xec, 0xac, 0x37, 0xb0, 0xf3, 0x06, 0xcd, 0x12, 0xf1, 0x5e, 0x46, 0x28, 0xe6, 0x14, + 0x2b, 0xfb, 0x0d, 0x23, 0xe2, 0x03, 0xcf, 0xe7, 0xf8, 0xe7, 0x5b, 0xf7, 0x71, 0xf7, 0xb5, 0x8b, + 0x4e, 0xf5, 0x73, 0xf7, 0xec, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0x12, 0xa3, 0x30, 0x6e, + 0x07, 0x00, 0x00, } func (m *EventClaimCreated) Marshal() (dAtA []byte, err error) { @@ -392,9 +392,9 @@ func (m *EventClaimCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ClaimedAmountUpokt != nil { + if m.ClaimedUpokt != nil { { - size, err := m.ClaimedAmountUpokt.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -454,9 +454,9 @@ func (m *EventClaimUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ClaimedAmountUpokt != nil { + if m.ClaimedUpokt != nil { { - size, err := m.ClaimedAmountUpokt.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -516,9 +516,9 @@ func (m *EventProofSubmitted) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ClaimedAmountUpokt != nil { + if m.ClaimedUpokt != nil { { - size, err := m.ClaimedAmountUpokt.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -590,9 +590,9 @@ func (m *EventProofUpdated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ClaimedAmountUpokt != nil { + if m.ClaimedUpokt != nil { { - size, err := m.ClaimedAmountUpokt.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -674,8 +674,8 @@ func (m *EventClaimCreated) Size() (n int) { if m.NumEstimatedComputeUnits != 0 { n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) } - if m.ClaimedAmountUpokt != nil { - l = m.ClaimedAmountUpokt.Size() + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() n += 1 + l + sovEvent(uint64(l)) } return n @@ -700,8 +700,8 @@ func (m *EventClaimUpdated) Size() (n int) { if m.NumEstimatedComputeUnits != 0 { n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) } - if m.ClaimedAmountUpokt != nil { - l = m.ClaimedAmountUpokt.Size() + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() n += 1 + l + sovEvent(uint64(l)) } return n @@ -730,8 +730,8 @@ func (m *EventProofSubmitted) Size() (n int) { if m.NumEstimatedComputeUnits != 0 { n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) } - if m.ClaimedAmountUpokt != nil { - l = m.ClaimedAmountUpokt.Size() + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() n += 1 + l + sovEvent(uint64(l)) } return n @@ -760,8 +760,8 @@ func (m *EventProofUpdated) Size() (n int) { if m.NumEstimatedComputeUnits != 0 { n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) } - if m.ClaimedAmountUpokt != nil { - l = m.ClaimedAmountUpokt.Size() + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() n += 1 + l + sovEvent(uint64(l)) } return n @@ -897,7 +897,7 @@ func (m *EventClaimCreated) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -924,10 +924,10 @@ func (m *EventClaimCreated) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClaimedAmountUpokt == nil { - m.ClaimedAmountUpokt = &types.Coin{} + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} } - if err := m.ClaimedAmountUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1076,7 +1076,7 @@ func (m *EventClaimUpdated) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1103,10 +1103,10 @@ func (m *EventClaimUpdated) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClaimedAmountUpokt == nil { - m.ClaimedAmountUpokt = &types.Coin{} + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} } - if err := m.ClaimedAmountUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1291,7 +1291,7 @@ func (m *EventProofSubmitted) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1318,10 +1318,10 @@ func (m *EventProofSubmitted) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClaimedAmountUpokt == nil { - m.ClaimedAmountUpokt = &types.Coin{} + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} } - if err := m.ClaimedAmountUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1506,7 +1506,7 @@ func (m *EventProofUpdated) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1533,10 +1533,10 @@ func (m *EventProofUpdated) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClaimedAmountUpokt == nil { - m.ClaimedAmountUpokt = &types.Coin{} + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types.Coin{} } - if err := m.ClaimedAmountUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/service/keeper/update_relay_mining_difficulty.go b/x/service/keeper/update_relay_mining_difficulty.go index f4aaf2a4e..0a3ac6fc8 100644 --- a/x/service/keeper/update_relay_mining_difficulty.go +++ b/x/service/keeper/update_relay_mining_difficulty.go @@ -6,6 +6,7 @@ import ( "encoding/hex" "fmt" "math/big" + "sort" "cosmossdk.io/log" sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,27 +15,29 @@ import ( "github.com/pokt-network/poktroll/x/service/types" ) -// TargetNumRelays is the target number of relays we want the network to mine for -// a specific service across all applications & suppliers per session. -// This number determines the total number of leafs to be created across in -// 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_MAINNET(#542): Make this a governance parameter and figure out the correct value. -const TargetNumRelays = uint64(10e4) - -// Exponential moving average (ema) smoothing factor, commonly known as alpha. -// Usually, alpha = 2 / (N+1), where N is the number of periods. -// Large alpha -> more weight on recent data; less smoothing and fast response. -// Small alpha -> more weight on past data; more smoothing and slow response. -// -// TODO_MAINNET: Use a language agnostic float implementation or arithmetic library -// to ensure deterministic results across different language implementations of the -// protocol. -// -// TODO_MAINNET(@olshansk, @rawthil): Play around with the value N for EMA to -// capture what the memory should be. -var emaSmoothingFactor = new(big.Float).SetFloat64(0.1) +var ( + // TargetNumRelays is the target number of relays we want the network to mine for + // a specific service across all applications & suppliers per session. + // This number determines the total number of leafs to be created across in + // 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_MAINNET(#542): Make this a governance parameter and figure out the correct value. + TargetNumRelays = uint64(10e4) + + // Exponential moving average (ema) smoothing factor, commonly known as alpha. + // Usually, alpha = 2 / (N+1), where N is the number of periods. + // Large alpha -> more weight on recent data; less smoothing and fast response. + // Small alpha -> more weight on past data; more smoothing and slow response. + // + // TODO_MAINNET: Use a language agnostic float implementation or arithmetic library + // to ensure deterministic results across different language implementations of the + // protocol. + // + // TODO_MAINNET(@olshansk, @rawthil): Play around with the value N for EMA to + // capture what the memory should be. + emaSmoothingFactor = new(big.Float).SetFloat64(0.1) +) // UpdateRelayMiningDifficulty updates the on-chain relay mining difficulty // based on the amount of on-chain relays for each service, given a map of serviceId->numRelays. @@ -46,7 +49,13 @@ func (k Keeper) UpdateRelayMiningDifficulty( sdkCtx := sdk.UnwrapSDKContext(ctx) difficultyPerServiceMap = make(map[string]types.RelayMiningDifficulty, len(relaysPerServiceMap)) - for serviceId, numRelays := range relaysPerServiceMap { + + // Iterate over the relaysPerServiceMap deterministically by sorting the keys. + // This ensures that the order of the keys is consistent across different nodes. + // See comment: https://github.com/pokt-network/poktroll/pull/840#discussion_r1796663285 + sortedRelayPerServiceMapKeys := getSortedMapKeys(relaysPerServiceMap) + for _, serviceId := range sortedRelayPerServiceMapKeys { + numRelays := relaysPerServiceMap[serviceId] prevDifficulty, found := k.GetRelayMiningDifficulty(ctx, serviceId) if !found { prevDifficulty = NewDefaultRelayMiningDifficulty(ctx, logger, serviceId, numRelays) @@ -163,3 +172,14 @@ func NewDefaultRelayMiningDifficulty( } } + +// getSortedMapKeys returns the keys of a map lexicographically sorted. +func getSortedMapKeys(m map[string]uint64) []string { + keys := make([]string, 0, len(m)) + for k := range m { + keys = append(keys, k) + } + + sort.Strings(keys) + return keys +} diff --git a/x/service/types/relay_mining_difficulty.pb.go b/x/service/types/relay_mining_difficulty.pb.go index bb0b0d17b..751c4b433 100644 --- a/x/service/types/relay_mining_difficulty.pb.go +++ b/x/service/types/relay_mining_difficulty.pb.go @@ -25,6 +25,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // RelayMiningDifficulty is a message used to store the on-chain Relay Mining // difficulty associated with a specific service ID. +// TODO_TECHDEBT: Embed this message in the Service message. type RelayMiningDifficulty struct { // The service ID the relay mining difficulty is associated with. ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` diff --git a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go index f2870c114..87a90d2ad 100644 --- a/x/tokenomics/keeper/keeper_settle_pending_claims_test.go +++ b/x/tokenomics/keeper/keeper_settle_pending_claims_test.go @@ -2,6 +2,7 @@ package keeper_test import ( "context" + "math/big" "testing" "cosmossdk.io/depinject" @@ -26,10 +27,11 @@ import ( "github.com/pokt-network/poktroll/testutil/testtree" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" + servicetypes "github.com/pokt-network/poktroll/x/service/types" sessiontypes "github.com/pokt-network/poktroll/x/session/types" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - "github.com/pokt-network/poktroll/x/tokenomics" tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) @@ -51,7 +53,11 @@ type TestSuite struct { claim prooftypes.Claim proof prooftypes.Proof - numRelays uint64 + numRelays uint64 + numClaimedComputeUnits uint64 + numEstimatedComputeUnits uint64 + claimedUpokt sdk.Coin + relayMiningDifficulty servicetypes.RelayMiningDifficulty } // SetupTest creates the following and stores them in the suite: @@ -157,11 +163,22 @@ func (s *TestSuite) SetupTest() { ringClient, ) + // Calculate the number of claimed compute units. + s.numClaimedComputeUnits = s.numRelays * service.ComputeUnitsPerRelay + + s.relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(sdkCtx, s.keepers.Logger(), testServiceId, servicekeeper.TargetNumRelays) + + // Calculate the number of estimated compute units. + s.numEstimatedComputeUnits = getEstimatedComputeUnits(s.numClaimedComputeUnits, s.relayMiningDifficulty) + + // Calculate the claimed amount in uPOKT. + sharedParams := s.keepers.SharedKeeper.GetParams(sdkCtx) + s.claimedUpokt = getClaimedUpokt(sharedParams, s.numEstimatedComputeUnits, s.relayMiningDifficulty) + blockHeaderHash := make([]byte, 0) expectedMerkleProofPath := protocol.GetPathForProof(blockHeaderHash, sessionHeader.SessionId) // Advance the block height to the earliest claim commit height. - sharedParams := s.keepers.SharedKeeper.GetParams(sdkCtx) claimMsgHeight := shared.GetEarliestSupplierClaimCommitHeight( &sharedParams, sessionHeader.GetSessionEndBlockHeight(), @@ -240,13 +257,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequiredAndNotProv ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits-1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Sub(uPOKTCoin(1)) // Set the proof missing penalty to half the supplier's stake so it is not // unstaked when being slashed. @@ -302,8 +317,9 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequiredAndNotProv expectedClaimExpiredEvent := expectedClaimExpiredEvents[0] require.Equal(t, tokenomicstypes.ClaimExpirationReason_PROOF_MISSING, expectedClaimExpiredEvent.GetExpirationReason()) require.Equal(t, s.numRelays, expectedClaimExpiredEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added - // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt + require.Equal(t, s.numClaimedComputeUnits, expectedClaimExpiredEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedClaimExpiredEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedClaimExpiredEvent.GetClaimedUpokt()) // Confirm that a slashing event was emitted expectedSlashingEvents := testutilevents.FilterEvents[*tokenomicstypes.EventSupplierSlashed](t, events, "poktroll.tokenomics.EventSupplierSlashed") @@ -322,13 +338,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimSettled_ProofRequiredAndProvide ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits-1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Sub(uPOKTCoin(1)) // Set the proof parameters such that s.claim requires a proof because: // - proof_request_probability is 0% @@ -369,7 +383,9 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimSettled_ProofRequiredAndProvide expectedEvent := expectedEvents[0] require.Equal(t, prooftypes.ProofRequirementReason_THRESHOLD, expectedEvent.GetProofRequirement()) require.Equal(t, s.numRelays, expectedEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedEvent.GetClaimedUpokt()) } func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequired_InvalidOneProvided() { @@ -434,7 +450,9 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_ProofRequired_InvalidOn expectedClaimExpiredEvent := expectedClaimExpiredEvents[0] require.Equal(t, tokenomicstypes.ClaimExpirationReason_PROOF_INVALID, expectedClaimExpiredEvent.GetExpirationReason()) require.Equal(t, s.numRelays, expectedClaimExpiredEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedClaimExpiredEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedClaimExpiredEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedClaimExpiredEvent.GetClaimedUpokt()) // Confirm that a slashing event was emitted expectedSlashingEvents := testutilevents.FilterEvents[*tokenomicstypes.EventSupplierSlashed](t, events, "poktroll.tokenomics.EventSupplierSlashed") @@ -453,13 +471,11 @@ func (s *TestSuite) TestClaimSettlement_ClaimSettled_ProofRequiredAndProvided_Vi ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) - // +1 so its not required via probability - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits+1) - require.NoError(t, err) + // +1 so it's not required via probability + proofRequirementThreshold = proofRequirementThreshold.Add(uPOKTCoin(1)) // Set the proof parameters such that s.claim requires a proof because: // - proof_request_probability is 100% @@ -500,8 +516,9 @@ func (s *TestSuite) TestClaimSettlement_ClaimSettled_ProofRequiredAndProvided_Vi expectedEvent := expectedEvents[0] require.Equal(t, prooftypes.ProofRequirementReason_PROBABILISTIC, expectedEvent.GetProofRequirement()) require.Equal(t, s.numRelays, expectedEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added - // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt + require.Equal(t, s.numClaimedComputeUnits, expectedEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedEvent.GetClaimedUpokt()) } func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { @@ -510,13 +527,11 @@ func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // +1 to push threshold above s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits+1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Add(uPOKTCoin(1)) // Set the proof parameters such that s.claim DOES NOT require a proof because: // - proof_request_probability is 0% AND @@ -556,7 +571,9 @@ func (s *TestSuite) TestSettlePendingClaims_Settles_WhenAProofIsNotRequired() { expectedEvent := expectedEvents[0] require.Equal(t, prooftypes.ProofRequirementReason_NOT_REQUIRED.String(), expectedEvent.GetProofRequirement().String()) require.Equal(t, s.numRelays, expectedEvent.GetNumRelays()) - // TODO(@red-0ne, #781): Ensure other claim expiration event fields are validated once added + require.Equal(t, s.numClaimedComputeUnits, expectedEvent.GetNumClaimedComputeUnits()) + require.Equal(t, s.numEstimatedComputeUnits, expectedEvent.GetNumEstimatedComputeUnits()) + require.Equal(t, s.claimedUpokt, *expectedEvent.GetClaimedUpokt()) } func (s *TestSuite) TestSettlePendingClaims_DoesNotSettle_BeforeProofWindowCloses() { @@ -582,13 +599,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimPendingAfterSettlement() { sdkCtx := cosmostypes.UnwrapSDKContext(ctx) sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // +1 to push threshold above s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits+1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Add(uPOKTCoin(1)) // Set the proof parameters such that s.claim DOES NOT require a proof // because the proof_request_probability is 0% and the proof_request_threshold @@ -670,13 +685,11 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_SupplierUnstaked() { ctx := s.ctx sharedParams := s.keepers.SharedKeeper.GetParams(ctx) - // Retrieve the number of compute units in the claim - numClaimComputeUnits, err := s.claim.GetNumClaimedComputeUnits() + proofRequirementThreshold, err := s.claim.GetClaimeduPOKT(sharedParams, s.relayMiningDifficulty) require.NoError(t, err) // -1 to push threshold below s.claim's compute units - proofRequirementThreshold, err := tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits-1) - require.NoError(t, err) + proofRequirementThreshold = proofRequirementThreshold.Sub(uPOKTCoin(1)) // Set the proof parameters such that s.claim requires a proof because: // - proof_request_probability is 0% @@ -723,3 +736,41 @@ func (s *TestSuite) TestSettlePendingClaims_ClaimExpired_SupplierUnstaked() { require.Equal(t, uint64(1), expectedSlashingEvent.GetNumExpiredClaims()) require.Equal(t, proofParams.ProofMissingPenalty, expectedSlashingEvent.GetSlashingAmount()) } + +// getEstimatedComputeUnits returns the estimated number of compute units given +// the number of claimed compute units and the relay mining difficulty. +func getEstimatedComputeUnits( + numClaimedComputeUnits uint64, + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) uint64 { + difficultyMultiplierRat := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.GetTargetHash()) + numClaimedComputeUnitsRat := new(big.Rat).SetUint64(numClaimedComputeUnits) + numEstimatedComputeUnitsRat := new(big.Rat).Mul(difficultyMultiplierRat, numClaimedComputeUnitsRat) + + return new(big.Int).Div(numEstimatedComputeUnitsRat.Num(), numEstimatedComputeUnitsRat.Denom()).Uint64() +} + +// getClaimedUpokt returns the claimed amount in uPOKT. +func getClaimedUpokt( + sharedParams sharedtypes.Params, + numClaimedComputeUnits uint64, + relayMiningDifficulty servicetypes.RelayMiningDifficulty, +) sdk.Coin { + // Calculate the number of estimated compute units ratio instead of directly using + // the integer value to avoid precision loss. + difficultyMultiplierRat := protocol.GetRelayDifficultyMultiplier(relayMiningDifficulty.GetTargetHash()) + numClaimedComputeUnitsRat := new(big.Rat).SetUint64(numClaimedComputeUnits) + numEstimatedComputeUnitsRat := new(big.Rat).Mul(difficultyMultiplierRat, numClaimedComputeUnitsRat) + + computeUnitsToTokenMultiplierRat := new(big.Rat).SetUint64(sharedParams.GetComputeUnitsToTokensMultiplier()) + + claimedUpoktRat := new(big.Rat).Mul(numEstimatedComputeUnitsRat, computeUnitsToTokenMultiplierRat) + claimedUpoktInt := new(big.Int).Div(claimedUpoktRat.Num(), claimedUpoktRat.Denom()) + + return sdk.NewCoin(volatile.DenomuPOKT, math.NewIntFromBigInt(claimedUpoktInt)) +} + +// uPOKTCoin returns a uPOKT coin with the given amount. +func uPOKTCoin(amount int64) sdk.Coin { + return sdk.NewCoin(volatile.DenomuPOKT, math.NewInt(amount)) +} diff --git a/x/tokenomics/keeper/settle_pending_claims.go b/x/tokenomics/keeper/settle_pending_claims.go index 04d8b1fc5..3045a304f 100644 --- a/x/tokenomics/keeper/settle_pending_claims.go +++ b/x/tokenomics/keeper/settle_pending_claims.go @@ -11,6 +11,7 @@ import ( "github.com/pokt-network/poktroll/app/volatile" apptypes "github.com/pokt-network/poktroll/x/application/types" prooftypes "github.com/pokt-network/poktroll/x/proof/types" + servicekeeper "github.com/pokt-network/poktroll/x/service/keeper" "github.com/pokt-network/poktroll/x/shared" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" @@ -61,21 +62,41 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( // NB: Not every (Req, Res) pair in the session is inserted into the tree due // to the relay mining difficulty. This is the count of non-empty leaves that - // matched the necessary difficulty and is therefore an estimation of the total - // number of relays serviced and work done. + // matched the necessary difficulty. numClaimRelays, err = claim.GetNumRelays() if err != nil { return settledResult, expiredResult, err } - // DEV_NOTE: We are assuming that (numClaimComputeUnits := numComputeUnits * service.ComputeUnitsPerRelay) + // DEV_NOTE: We are assuming that (numClaimComputeUnits := numClaimRelays * service.ComputeUnitsPerRelay) // because this code path is only reached if that has already been validated. numClaimComputeUnits, err = claim.GetNumClaimedComputeUnits() if err != nil { return settledResult, expiredResult, err } - // TODO(@red-0ne, #781): Convert numClaimedComputeUnits to numEstimatedComputeUnits to reflect reward/payment based on real usage. + // Get the relay mining difficulty for the service that this claim is for. + serviceId := claim.GetSessionHeader().GetServiceId() + relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, serviceId) + if !found { + relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, serviceId, servicekeeper.TargetNumRelays) + } + // numEstimatedComputeUnits is the probabilistic estimation of the off-chain + // work done by the relay miner in this session. It is derived from the claimed + // work and the relay mining difficulty. + numEstimatedComputeUnits, err := claim.GetNumEstimatedComputeUnits(relayMiningDifficulty) + if err != nil { + return settledResult, expiredResult, err + } + + sharedParams := k.sharedKeeper.GetParams(ctx) + // claimeduPOKT is the amount of uPOKT that the supplier would receive if the + // claim is settled. It is derived from the claimed number of relays, the current + // service mining difficulty and the global network parameters. + claimeduPOKT, err := claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) + if err != nil { + return settledResult, expiredResult, err + } proof, isProofFound := k.proofKeeper.GetProof(ctx, sessionId, claim.SupplierOperatorAddress) // Using the probabilistic proofs approach, determine if this expiring @@ -90,6 +111,8 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( "supplier_operator_address", claim.SupplierOperatorAddress, "num_claim_compute_units", numClaimComputeUnits, "num_relays_in_session_tree", numClaimRelays, + "num_estimated_compute_units", numEstimatedComputeUnits, + "claimed_upokt", claimeduPOKT, "proof_requirement", proofRequirement, ) @@ -115,11 +138,12 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( // Proof was required but is invalid or not found. // Emit an event that a claim has expired and being removed without being settled. claimExpiredEvent := tokenomicstypes.EventClaimExpired{ - Claim: &claim, - ExpirationReason: expirationReason, - NumRelays: numClaimRelays, - NumClaimedComputeUnits: numClaimComputeUnits, - // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt + Claim: &claim, + ExpirationReason: expirationReason, + NumRelays: numClaimRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + NumEstimatedComputeUnits: numEstimatedComputeUnits, + ClaimedUpokt: &claimeduPOKT, } if err = ctx.EventManager().EmitTypedEvent(&claimExpiredEvent); err != nil { return settledResult, expiredResult, err @@ -162,11 +186,12 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( } claimSettledEvent := tokenomicstypes.EventClaimSettled{ - Claim: &claim, - NumRelays: numClaimRelays, - NumClaimedComputeUnits: numClaimComputeUnits, - // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt - ProofRequirement: proofRequirement, + Claim: &claim, + NumRelays: numClaimRelays, + NumClaimedComputeUnits: numClaimComputeUnits, + NumEstimatedComputeUnits: numEstimatedComputeUnits, + ClaimedUpokt: &claimeduPOKT, + ProofRequirement: proofRequirement, } if err = ctx.EventManager().EmitTypedEvent(&claimSettledEvent); err != nil { @@ -174,11 +199,12 @@ func (k Keeper) SettlePendingClaims(ctx sdk.Context) ( } if err = ctx.EventManager().EmitTypedEvent(&prooftypes.EventProofUpdated{ - Claim: &claim, - Proof: nil, - NumRelays: 0, - NumClaimedComputeUnits: 0, - // TODO_FOLLOWUP: Add NumEstimatedComputeUnits and ClaimedAmountUpokt + Claim: &claim, + Proof: nil, + NumRelays: 0, + NumClaimedComputeUnits: 0, + NumEstimatedComputeUnits: numEstimatedComputeUnits, + ClaimedUpokt: &claimeduPOKT, }); err != nil { return settledResult, expiredResult, err } diff --git a/x/tokenomics/keeper/token_logic_modules.go b/x/tokenomics/keeper/token_logic_modules.go index fac928341..da686f4bf 100644 --- a/x/tokenomics/keeper/token_logic_modules.go +++ b/x/tokenomics/keeper/token_logic_modules.go @@ -22,7 +22,6 @@ import ( sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/pokt-network/poktroll/x/tokenomics" tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" ) @@ -146,7 +145,10 @@ func (k Keeper) ProcessTokenLogicModules( if claimSettlementCoin.Amount.BigInt() == nil { return 0 } - return float32(claimSettlementCoin.Amount.Int64()) + + // Avoid out of range errors by converting to float64 first + claimSettlementFloat64, _ := claimSettlementCoin.Amount.BigInt().Float64() + return float32(claimSettlementFloat64) }, func() bool { return isSuccessful }, ) @@ -235,12 +237,28 @@ func (k Keeper) ProcessTokenLogicModules( return tokenomicstypes.ErrTokenomicsServiceNotFound.Wrapf("service with ID %q not found", sessionHeader.ServiceId) } + // Ensure the number of compute units claimed is equal to the number of relays * CUPR + expectedClaimComputeUnits := numRelays * service.ComputeUnitsPerRelay + if numClaimComputeUnits != expectedClaimComputeUnits { + return tokenomicstypes.ErrTokenomicsRootHashInvalid.Wrapf( + "mismatch: claim compute units (%d) != number of relays (%d) * service compute units per relay (%d)", + numClaimComputeUnits, + numRelays, + service.ComputeUnitsPerRelay, + ) + } + + // Retrieving the relay mining difficulty for service. + relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, service.Id) + if !found { + relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, service.Id, servicekeeper.TargetNumRelays) + } sharedParams := k.sharedKeeper.GetParams(ctx) // Determine the total number of tokens being claimed (i.e. for the work completed) // by the supplier for the amount of work they did to service the application // in the session. - claimSettlementCoin, err = tokenomics.NumComputeUnitsToCoin(sharedParams, numClaimComputeUnits) + claimSettlementCoin, err = claim.GetClaimeduPOKT(sharedParams, relayMiningDifficulty) if err != nil { return err } @@ -265,16 +283,10 @@ func (k Keeper) ProcessTokenLogicModules( logger = logger.With("actual_settlement_upokt", actualSettlementCoin) logger.Info(fmt.Sprintf("About to start processing TLMs for (%d) compute units, equal to (%s) claimed", numClaimComputeUnits, actualSettlementCoin)) - // Retrieving the relay mining difficulty for the service at hand - relayMiningDifficulty, found := k.serviceKeeper.GetRelayMiningDifficulty(ctx, service.Id) - if !found { - relayMiningDifficulty = servicekeeper.NewDefaultRelayMiningDifficulty(ctx, logger, service.Id, servicekeeper.TargetNumRelays) - } - // Execute all the token logic modules processors for tlm, tlmProcessor := range tokenLogicModuleProcessorMap { logger.Info(fmt.Sprintf("Starting TLM processing: %q", tlm)) - if err = tlmProcessor(k, ctx, &service, claim.GetSessionHeader(), &application, &supplier, actualSettlementCoin, &relayMiningDifficulty); err != nil { + if err := tlmProcessor(k, ctx, &service, claim.GetSessionHeader(), &application, &supplier, actualSettlementCoin, &relayMiningDifficulty); err != nil { return tokenomicstypes.ErrTokenomicsTLMError.Wrapf("TLM %q: %v", tlm, err) } logger.Info(fmt.Sprintf("Finished TLM processing: %q", tlm)) diff --git a/x/tokenomics/keeper/token_logic_modules_test.go b/x/tokenomics/keeper/token_logic_modules_test.go index 812090ae7..913179e8d 100644 --- a/x/tokenomics/keeper/token_logic_modules_test.go +++ b/x/tokenomics/keeper/token_logic_modules_test.go @@ -509,7 +509,13 @@ func TestProcessTokenLogicModules_InvalidRoot(t *testing.T) { { desc: "correct size but invalid value", root: func() []byte { - return bytes.Repeat([]byte("a"), protocol.TrieRootSize) + // A root with all 'a's is a valid value since each of the hash, sum and size + // will be []byte{0x61, 0x61, ...} with their respective sizes. + // The current test suite sets the CUPR to 1, making sum == count * CUPR + // valid. So, we can change the last byte to 'b' to make it invalid. + root := bytes.Repeat([]byte("a"), protocol.TrieRootSize) + root = append(root[:len(root)-1], 'b') + return root }(), errExpected: true, }, diff --git a/x/tokenomics/tokenomics.go b/x/tokenomics/tokenomics.go deleted file mode 100644 index 4811023a2..000000000 --- a/x/tokenomics/tokenomics.go +++ /dev/null @@ -1,28 +0,0 @@ -package tokenomics - -import ( - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/pokt-network/poktroll/app/volatile" - sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - tokenomicstypes "github.com/pokt-network/poktroll/x/tokenomics/types" -) - -// NumComputeUnitsToCoin converts compute units to uPOKT to mint based on global -// network parameters. -func NumComputeUnitsToCoin(params sharedtypes.Params, numClaimComputeUnits uint64) (sdk.Coin, error) { - // CUTTM is a GLOBAL network wide parameter. - // TODO(@red-0ne, #781): Convert numClaimComputeUnits to numEstimatedComputeUnits to reflect reward/payment based on real usage. - upoktAmount := math.NewInt(int64(numClaimComputeUnits * params.GetComputeUnitsToTokensMultiplier())) - if upoktAmount.IsNegative() { - return sdk.Coin{}, tokenomicstypes.ErrTokenomicsCalculation.Wrapf( - "num compute units to coin (%d) * CUTTM (%d) resulted in a negative amount: %d", - numClaimComputeUnits, - params.GetComputeUnitsToTokensMultiplier(), - upoktAmount, - ) - } - - return sdk.NewCoin(volatile.DenomuPOKT, upoktAmount), nil -} diff --git a/x/tokenomics/types/event.pb.go b/x/tokenomics/types/event.pb.go index 24a5b1e9d..6f4278908 100644 --- a/x/tokenomics/types/event.pb.go +++ b/x/tokenomics/types/event.pb.go @@ -68,9 +68,9 @@ type EventClaimExpired struct { // Number of estimated compute units claimed as a function of the number of claimed // compute units and the relay difficulty multiplier for the particular service. NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` - // The amount of uPOKT claimed to be rewarded for the work done as a function of + // The uPOKT coin claimed to be rewarded for the work done as a function of // the number of estimated compute units and the compute uints to token multiplier. - ClaimedAmountUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt"` + ClaimedUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimExpired) Reset() { *m = EventClaimExpired{} } @@ -137,9 +137,9 @@ func (m *EventClaimExpired) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (m *EventClaimExpired) GetClaimedAmountUpokt() *types1.Coin { +func (m *EventClaimExpired) GetClaimedUpokt() *types1.Coin { if m != nil { - return m.ClaimedAmountUpokt + return m.ClaimedUpokt } return nil } @@ -158,9 +158,9 @@ type EventClaimSettled struct { // Number of estimated compute units claimed as a function of the number of claimed // compute units and the relay difficulty multiplier for the particular service. NumEstimatedComputeUnits uint64 `protobuf:"varint,5,opt,name=num_estimated_compute_units,json=numEstimatedComputeUnits,proto3" json:"num_estimated_compute_units"` - // The amount of uPOKT claimed to be rewarded for the work done as a function of + // The uPOKT coin claimed to be rewarded for the work done as a function of // the number of estimated compute units and the compute uints to token multiplier. - ClaimedAmountUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_amount_upokt,json=claimedAmountUpokt,proto3" json:"claimed_amount_upokt"` + ClaimedUpokt *types1.Coin `protobuf:"bytes,6,opt,name=claimed_upokt,json=claimedUpokt,proto3" json:"claimed_upokt"` } func (m *EventClaimSettled) Reset() { *m = EventClaimSettled{} } @@ -227,9 +227,9 @@ func (m *EventClaimSettled) GetNumEstimatedComputeUnits() uint64 { return 0 } -func (m *EventClaimSettled) GetClaimedAmountUpokt() *types1.Coin { +func (m *EventClaimSettled) GetClaimedUpokt() *types1.Coin { if m != nil { - return m.ClaimedAmountUpokt + return m.ClaimedUpokt } return nil } @@ -380,54 +380,54 @@ func init() { func init() { proto.RegisterFile("poktroll/tokenomics/event.proto", fileDescriptor_a78874bbf91a58c7) } var fileDescriptor_a78874bbf91a58c7 = []byte{ - // 744 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xcd, 0x53, 0xdb, 0x46, - 0x14, 0xb7, 0x5c, 0xc3, 0x0c, 0xdb, 0x62, 0x6c, 0xd5, 0x30, 0x86, 0x16, 0x89, 0x72, 0xe8, 0x50, - 0xa6, 0x48, 0x03, 0x74, 0x7a, 0xec, 0xd4, 0x36, 0xa6, 0xa3, 0x99, 0xc6, 0x76, 0xd6, 0x21, 0xc3, - 0xe4, 0x10, 0x45, 0x96, 0x1e, 0x46, 0xc1, 0xda, 0x55, 0x56, 0x2b, 0x07, 0x8e, 0x39, 0xe5, 0x90, - 0x4b, 0xfe, 0xa2, 0x9c, 0x73, 0xe4, 0xc8, 0xc9, 0x93, 0x31, 0x37, 0xff, 0x15, 0x99, 0x5d, 0xf9, - 0x8b, 0x8f, 0x98, 0x43, 0x72, 0xcc, 0xc5, 0x96, 0xdf, 0xef, 0x63, 0x77, 0xdf, 0xfb, 0x59, 0x8b, - 0xf4, 0x90, 0x9e, 0x71, 0x46, 0x3b, 0x1d, 0x93, 0xd3, 0x33, 0x20, 0x34, 0xf0, 0xdd, 0xc8, 0x84, - 0x2e, 0x10, 0x6e, 0x84, 0x8c, 0x72, 0xaa, 0xfe, 0x3c, 0x22, 0x18, 0x13, 0xc2, 0x9a, 0xe6, 0xd2, - 0x28, 0xa0, 0x91, 0xd9, 0x72, 0x22, 0x30, 0xbb, 0xbb, 0x2d, 0xe0, 0xce, 0xae, 0xe9, 0x52, 0x9f, - 0x24, 0xa2, 0xb5, 0x42, 0x9b, 0xb6, 0xa9, 0x7c, 0x34, 0xc5, 0xd3, 0xb0, 0xba, 0x36, 0x5e, 0x2b, - 0x64, 0x94, 0x9e, 0x98, 0xfc, 0x22, 0x84, 0x28, 0xc1, 0x36, 0xdf, 0x65, 0x50, 0xbe, 0x2a, 0x96, - 0xad, 0x74, 0x1c, 0x3f, 0xa8, 0x9e, 0x87, 0x3e, 0x03, 0x4f, 0xfd, 0x1b, 0xcd, 0xb9, 0xe2, 0x77, - 0x51, 0xd9, 0x50, 0xb6, 0x7e, 0xdc, 0x5b, 0x36, 0xc6, 0x9b, 0x91, 0x0e, 0x86, 0x24, 0x97, 0x17, - 0x06, 0x3d, 0x3d, 0xe1, 0xe1, 0xe4, 0x4b, 0x25, 0x28, 0x0f, 0xc2, 0xc2, 0xe1, 0x3e, 0x25, 0x36, - 0x03, 0x27, 0xa2, 0xa4, 0x98, 0xde, 0x50, 0xb6, 0xb2, 0x7b, 0xdb, 0xc6, 0x3d, 0x07, 0x32, 0x26, - 0xab, 0x4a, 0x09, 0x96, 0x8a, 0xf2, 0xf2, 0xa0, 0xa7, 0xdf, 0x35, 0xc2, 0x39, 0xb8, 0x45, 0x54, - 0x77, 0x10, 0x22, 0x71, 0x60, 0x33, 0xe8, 0x38, 0x17, 0x51, 0xf1, 0x87, 0x0d, 0x65, 0x2b, 0x53, - 0xce, 0x0e, 0x7a, 0xfa, 0x54, 0x15, 0x2f, 0x90, 0x38, 0xc0, 0xf2, 0x51, 0x3d, 0x46, 0xab, 0x02, - 0x90, 0x7b, 0x05, 0xcf, 0x76, 0x69, 0x10, 0xc6, 0x1c, 0xec, 0x98, 0xf8, 0x3c, 0x2a, 0x66, 0xa4, - 0x7a, 0x7d, 0xd0, 0xd3, 0xbf, 0x4c, 0xc2, 0x2b, 0x24, 0x0e, 0x2a, 0x09, 0x52, 0x49, 0x80, 0x23, - 0x51, 0x57, 0x9f, 0xa3, 0x5f, 0x84, 0x08, 0x22, 0xee, 0x07, 0x0e, 0xbf, 0xe3, 0x3d, 0x27, 0xbd, - 0xf5, 0x41, 0x4f, 0x9f, 0x45, 0xc3, 0x45, 0x12, 0x07, 0xd5, 0x11, 0x76, 0xc3, 0x1f, 0x50, 0x61, - 0xb4, 0x21, 0x27, 0xa0, 0x31, 0xe1, 0x76, 0x2c, 0xda, 0x59, 0x9c, 0x97, 0xf3, 0x59, 0x35, 0x92, - 0x5c, 0x18, 0x22, 0x17, 0xc6, 0x30, 0x17, 0x46, 0x85, 0xfa, 0xa4, 0x5c, 0x1c, 0xf4, 0xf4, 0x7b, - 0xa5, 0x58, 0x1d, 0x56, 0x4b, 0xb2, 0x78, 0x24, 0x6a, 0x9b, 0x6f, 0x6f, 0xa4, 0xa1, 0x09, 0x9c, - 0x77, 0xbe, 0x22, 0x0d, 0x2f, 0x51, 0x5e, 0x12, 0x6c, 0x06, 0xaf, 0x62, 0x9f, 0x41, 0x00, 0x84, - 0x0f, 0xd3, 0xf0, 0xfb, 0x6d, 0x8f, 0x86, 0xf8, 0xc4, 0x13, 0xde, 0x74, 0x12, 0xee, 0x98, 0xe0, - 0x5c, 0x78, 0x8b, 0xfe, 0x3d, 0x09, 0xdf, 0x38, 0x09, 0x6f, 0xd2, 0xe8, 0x57, 0x99, 0x84, 0x52, - 0x18, 0x76, 0x7c, 0x57, 0xfe, 0xe9, 0xea, 0x5d, 0x60, 0x11, 0xb0, 0xae, 0xef, 0x82, 0xa7, 0xfe, - 0x81, 0x72, 0xce, 0x04, 0xb2, 0x1d, 0xcf, 0x63, 0x32, 0x1f, 0x0b, 0x78, 0x69, 0xaa, 0x5e, 0xf2, - 0x3c, 0xa6, 0xfe, 0x85, 0x56, 0xa2, 0x58, 0xd4, 0x80, 0xd9, 0x34, 0x04, 0xe6, 0x70, 0xca, 0x12, - 0x41, 0x5a, 0x0a, 0x0a, 0x23, 0xb4, 0x3e, 0x04, 0xa5, 0xea, 0x1f, 0xb4, 0x08, 0xe7, 0x21, 0xb8, - 0xa2, 0x39, 0xad, 0x98, 0x11, 0x39, 0xd4, 0x59, 0x27, 0xc4, 0x3f, 0x8d, 0xf8, 0xe5, 0x98, 0x11, - 0xf5, 0x5f, 0x94, 0x85, 0x93, 0x13, 0x70, 0xb9, 0xdf, 0x85, 0xc4, 0x20, 0xf3, 0x90, 0xc1, 0xe2, - 0x58, 0x20, 0x1c, 0x36, 0x3f, 0x28, 0xa8, 0x20, 0x7b, 0xd0, 0x1c, 0xee, 0xaf, 0xd9, 0x71, 0xa2, - 0x53, 0xf0, 0x66, 0x1c, 0x48, 0x99, 0x71, 0xa0, 0x3f, 0x91, 0x2a, 0x47, 0x9e, 0xbc, 0x63, 0x93, - 0x58, 0x45, 0xb2, 0x05, 0x19, 0x9c, 0x13, 0xf3, 0x4e, 0x00, 0x19, 0xaa, 0x48, 0x2d, 0xa3, 0xa5, - 0x48, 0x2c, 0xe7, 0x93, 0xf6, 0x70, 0x5a, 0x0f, 0x37, 0x20, 0x3b, 0x52, 0x24, 0x93, 0xdc, 0x7e, - 0x81, 0x96, 0xef, 0x7d, 0xc1, 0xaa, 0xbf, 0xa1, 0xf5, 0xea, 0x71, 0xc3, 0xc2, 0xa5, 0x27, 0x56, - 0xbd, 0x66, 0xe3, 0x6a, 0xa9, 0x59, 0xaf, 0xd9, 0x47, 0xb5, 0x66, 0xa3, 0x5a, 0xb1, 0x0e, 0xad, - 0xea, 0x41, 0x2e, 0xa5, 0xe6, 0xd1, 0x62, 0x03, 0xd7, 0xeb, 0x87, 0xf6, 0x23, 0xab, 0xd9, 0xb4, - 0x6a, 0xff, 0xe5, 0x94, 0x49, 0xc9, 0xaa, 0x3d, 0x2d, 0xfd, 0x6f, 0x1d, 0xe4, 0xd2, 0xe5, 0xc7, - 0x1f, 0xfb, 0x9a, 0x72, 0xd9, 0xd7, 0x94, 0xab, 0xbe, 0xa6, 0x7c, 0xea, 0x6b, 0xca, 0xfb, 0x6b, - 0x2d, 0x75, 0x79, 0xad, 0xa5, 0xae, 0xae, 0xb5, 0xd4, 0xb3, 0xfd, 0xb6, 0xcf, 0x4f, 0xe3, 0x96, - 0xe1, 0xd2, 0xc0, 0x14, 0xa9, 0xda, 0x21, 0xc0, 0x5f, 0x53, 0x76, 0x66, 0x8e, 0x2f, 0xa4, 0xf3, - 0xe9, 0xeb, 0x4f, 0xde, 0x4b, 0xad, 0x79, 0x79, 0x31, 0xed, 0x7f, 0x0e, 0x00, 0x00, 0xff, 0xff, - 0x3e, 0x16, 0x9d, 0x3a, 0x22, 0x07, 0x00, 0x00, + // 739 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0x4d, 0x53, 0xdb, 0x3a, + 0x14, 0x8d, 0x43, 0x60, 0x06, 0x3d, 0x12, 0x12, 0x3f, 0x60, 0x02, 0xef, 0x61, 0xf3, 0x58, 0xbc, + 0xa1, 0x4c, 0xb1, 0x07, 0xe8, 0x74, 0xd9, 0x69, 0x12, 0x42, 0xc7, 0x33, 0x6d, 0x12, 0x94, 0xd2, + 0x61, 0xba, 0xa8, 0xeb, 0xd8, 0x22, 0xb8, 0xc4, 0x92, 0x2b, 0xc9, 0x29, 0x2c, 0xfb, 0x0f, 0xfa, + 0x8b, 0xba, 0xee, 0x92, 0x25, 0xab, 0x4c, 0x27, 0xec, 0xb2, 0xed, 0xa2, 0xdb, 0x8e, 0xe4, 0x7c, + 0xf1, 0xd1, 0xb0, 0x60, 0xdb, 0x4d, 0x22, 0xdd, 0x7b, 0xce, 0x91, 0x74, 0xcf, 0xb5, 0x04, 0xf4, + 0x90, 0x9c, 0x72, 0x4a, 0x5a, 0x2d, 0x93, 0x93, 0x53, 0x84, 0x49, 0xe0, 0xbb, 0xcc, 0x44, 0x6d, + 0x84, 0xb9, 0x11, 0x52, 0xc2, 0x89, 0xfa, 0xf7, 0x00, 0x60, 0x8c, 0x00, 0x2b, 0x9a, 0x4b, 0x58, + 0x40, 0x98, 0xd9, 0x70, 0x18, 0x32, 0xdb, 0xdb, 0x0d, 0xc4, 0x9d, 0x6d, 0xd3, 0x25, 0x3e, 0x8e, + 0x49, 0x2b, 0x0b, 0x4d, 0xd2, 0x24, 0x72, 0x68, 0x8a, 0x51, 0x3f, 0xba, 0x32, 0x5c, 0x2b, 0xa4, + 0x84, 0x1c, 0x9b, 0xfc, 0x3c, 0x44, 0x2c, 0xce, 0xad, 0xff, 0x9c, 0x02, 0xb9, 0xb2, 0x58, 0xb6, + 0xd4, 0x72, 0xfc, 0xa0, 0x7c, 0x16, 0xfa, 0x14, 0x79, 0xea, 0x53, 0x30, 0xed, 0x8a, 0x79, 0x5e, + 0x59, 0x53, 0x36, 0xfe, 0xda, 0x59, 0x34, 0x86, 0x9b, 0x91, 0x0a, 0x86, 0x04, 0x17, 0x67, 0x7b, + 0x1d, 0x3d, 0xc6, 0xc1, 0xf8, 0x4f, 0xc5, 0x20, 0x87, 0x84, 0x84, 0xc3, 0x7d, 0x82, 0x6d, 0x8a, + 0x1c, 0x46, 0x70, 0x3e, 0xb9, 0xa6, 0x6c, 0x64, 0x76, 0x36, 0x8d, 0x3b, 0x0e, 0x64, 0x8c, 0x56, + 0x95, 0x14, 0x28, 0x19, 0xc5, 0xc5, 0x5e, 0x47, 0xbf, 0x2d, 0x04, 0xb3, 0xe8, 0x06, 0x50, 0xdd, + 0x02, 0x00, 0x47, 0x81, 0x4d, 0x51, 0xcb, 0x39, 0x67, 0xf9, 0xa9, 0x35, 0x65, 0x23, 0x55, 0xcc, + 0xf4, 0x3a, 0xfa, 0x58, 0x14, 0xce, 0xe2, 0x28, 0x80, 0x72, 0xa8, 0x1e, 0x81, 0x65, 0x91, 0x90, + 0x7b, 0x45, 0x9e, 0xed, 0x92, 0x20, 0x8c, 0x38, 0xb2, 0x23, 0xec, 0x73, 0x96, 0x4f, 0x49, 0xf6, + 0x6a, 0xaf, 0xa3, 0xff, 0x1e, 0x04, 0x97, 0x70, 0x14, 0x94, 0xe2, 0x4c, 0x29, 0x4e, 0x1c, 0x8a, + 0xb8, 0xfa, 0x0e, 0xfc, 0x23, 0x48, 0x88, 0x71, 0x3f, 0x70, 0xf8, 0x2d, 0xed, 0x69, 0xa9, 0xad, + 0xf7, 0x3a, 0xfa, 0x24, 0x18, 0xcc, 0xe3, 0x28, 0x28, 0x0f, 0x72, 0xd7, 0xf4, 0x0f, 0x40, 0x7a, + 0xb0, 0xa1, 0x48, 0xd4, 0x31, 0x3f, 0x23, 0x8d, 0x59, 0x36, 0xe2, 0x86, 0x30, 0x44, 0x43, 0x18, + 0xfd, 0x86, 0x30, 0x4a, 0xc4, 0xc7, 0xc5, 0x5c, 0xaf, 0xa3, 0x5f, 0xe7, 0xc0, 0xb9, 0xfe, 0xf4, + 0x50, 0xcc, 0xd6, 0x7f, 0x5c, 0x73, 0xbe, 0x8e, 0x38, 0x6f, 0x3d, 0xc0, 0xf9, 0x0f, 0x20, 0x27, + 0x01, 0x36, 0x45, 0x1f, 0x23, 0x9f, 0xa2, 0x00, 0x61, 0xde, 0x77, 0xfe, 0xff, 0x9b, 0x1a, 0x35, + 0xf1, 0x0b, 0x47, 0xb8, 0x71, 0xd7, 0x6f, 0x89, 0xc0, 0x6c, 0x78, 0x03, 0xfe, 0xc7, 0xf5, 0x07, + 0xb8, 0xfe, 0x39, 0x09, 0xfe, 0x95, 0xae, 0x17, 0xc2, 0xb0, 0xe5, 0xbb, 0xf2, 0x63, 0xaa, 0xb6, + 0x11, 0x65, 0x88, 0xb6, 0x7d, 0x17, 0x79, 0xea, 0x23, 0x90, 0x75, 0x46, 0x29, 0xdb, 0xf1, 0x3c, + 0x2a, 0x7b, 0x61, 0x16, 0xce, 0x8f, 0xc5, 0x0b, 0x9e, 0x47, 0xd5, 0x27, 0x60, 0x89, 0x45, 0x22, + 0x86, 0xa8, 0x4d, 0x42, 0x44, 0x1d, 0x4e, 0x68, 0x4c, 0x48, 0x4a, 0xc2, 0xc2, 0x20, 0x5b, 0xed, + 0x27, 0x25, 0xeb, 0x19, 0x48, 0xa3, 0xb3, 0x10, 0xb9, 0xa2, 0x10, 0x8d, 0x88, 0x62, 0x69, 0xe0, + 0xa4, 0x43, 0xc1, 0xb9, 0x01, 0xbe, 0x18, 0x51, 0xac, 0x3e, 0x07, 0x19, 0x74, 0x7c, 0x8c, 0x5c, + 0xee, 0xb7, 0x51, 0x2c, 0x90, 0xba, 0x4f, 0x20, 0x3d, 0x24, 0x08, 0x85, 0xf5, 0xaf, 0x0a, 0x58, + 0x90, 0x35, 0xa8, 0xf7, 0xf7, 0x57, 0x6f, 0x39, 0xec, 0x04, 0x79, 0x13, 0x0e, 0xa4, 0x4c, 0x38, + 0xd0, 0x63, 0xa0, 0x4a, 0x7b, 0xe3, 0xbb, 0x33, 0x6e, 0x21, 0x26, 0x4b, 0x90, 0x82, 0x59, 0xe1, + 0x6d, 0x9c, 0x90, 0x0d, 0xc4, 0xd4, 0x22, 0x98, 0x67, 0x62, 0x39, 0x1f, 0x37, 0x6d, 0x27, 0x20, + 0x11, 0xe6, 0xf7, 0x17, 0x20, 0x33, 0x60, 0x14, 0x24, 0x61, 0xf3, 0x3d, 0x58, 0xbc, 0xf3, 0xe2, + 0x54, 0xff, 0x03, 0xab, 0xe5, 0xa3, 0x9a, 0x05, 0x0b, 0xaf, 0xad, 0x6a, 0xc5, 0x86, 0xe5, 0x42, + 0xbd, 0x5a, 0xb1, 0x0f, 0x2b, 0xf5, 0x5a, 0xb9, 0x64, 0xed, 0x5b, 0xe5, 0xbd, 0x6c, 0x42, 0xcd, + 0x81, 0x74, 0x0d, 0x56, 0xab, 0xfb, 0xf6, 0x2b, 0xab, 0x5e, 0xb7, 0x2a, 0x2f, 0xb2, 0xca, 0x28, + 0x64, 0x55, 0xde, 0x14, 0x5e, 0x5a, 0x7b, 0xd9, 0x64, 0xf1, 0xe0, 0x5b, 0x57, 0x53, 0x2e, 0xba, + 0x9a, 0x72, 0xd9, 0xd5, 0x94, 0xef, 0x5d, 0x4d, 0xf9, 0x72, 0xa5, 0x25, 0x2e, 0xae, 0xb4, 0xc4, + 0xe5, 0x95, 0x96, 0x78, 0xbb, 0xdb, 0xf4, 0xf9, 0x49, 0xd4, 0x30, 0x5c, 0x12, 0x98, 0xa2, 0xab, + 0xb6, 0x30, 0xe2, 0x9f, 0x08, 0x3d, 0x35, 0x87, 0x0f, 0xcd, 0xd9, 0xf8, 0xb3, 0x26, 0xdf, 0x9b, + 0xc6, 0x8c, 0x7c, 0x70, 0x76, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x71, 0x30, 0x08, 0xfa, + 0x06, 0x00, 0x00, } func (m *EventClaimExpired) Marshal() (dAtA []byte, err error) { @@ -450,9 +450,9 @@ func (m *EventClaimExpired) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ClaimedAmountUpokt != nil { + if m.ClaimedUpokt != nil { { - size, err := m.ClaimedAmountUpokt.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -517,9 +517,9 @@ func (m *EventClaimSettled) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.ClaimedAmountUpokt != nil { + if m.ClaimedUpokt != nil { { - size, err := m.ClaimedAmountUpokt.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.ClaimedUpokt.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -705,8 +705,8 @@ func (m *EventClaimExpired) Size() (n int) { if m.NumEstimatedComputeUnits != 0 { n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) } - if m.ClaimedAmountUpokt != nil { - l = m.ClaimedAmountUpokt.Size() + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() n += 1 + l + sovEvent(uint64(l)) } return n @@ -734,8 +734,8 @@ func (m *EventClaimSettled) Size() (n int) { if m.NumEstimatedComputeUnits != 0 { n += 1 + sovEvent(uint64(m.NumEstimatedComputeUnits)) } - if m.ClaimedAmountUpokt != nil { - l = m.ClaimedAmountUpokt.Size() + if m.ClaimedUpokt != nil { + l = m.ClaimedUpokt.Size() n += 1 + l + sovEvent(uint64(l)) } return n @@ -935,7 +935,7 @@ func (m *EventClaimExpired) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -962,10 +962,10 @@ func (m *EventClaimExpired) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClaimedAmountUpokt == nil { - m.ClaimedAmountUpokt = &types1.Coin{} + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types1.Coin{} } - if err := m.ClaimedAmountUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1133,7 +1133,7 @@ func (m *EventClaimSettled) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmountUpokt", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedUpokt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1160,10 +1160,10 @@ func (m *EventClaimSettled) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.ClaimedAmountUpokt == nil { - m.ClaimedAmountUpokt = &types1.Coin{} + if m.ClaimedUpokt == nil { + m.ClaimedUpokt = &types1.Coin{} } - if err := m.ClaimedAmountUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ClaimedUpokt.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex