From eb93505e52637db12c64163a6a79ca1c688ea995 Mon Sep 17 00:00:00 2001 From: Liver-23 Date: Tue, 7 Jan 2025 12:59:16 +0200 Subject: [PATCH 01/13] chore(migration-proofs): LiveRaveN (#222) --- app/upgrades/v2_0/validator-proofs/mainnet/LiveRaveN.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/LiveRaveN.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/LiveRaveN.json b/app/upgrades/v2_0/validator-proofs/mainnet/LiveRaveN.json new file mode 100644 index 00000000..43d233ef --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/LiveRaveN.json @@ -0,0 +1,7 @@ +{ + "name": "LiveRaveN", + "consensus_address": "kyvevaloper13eduhc6ds4fvcatt8vj472rwkr5vvup79wnz2y", + "protocol_address": "kyve13eduhc6ds4fvcatt8vj472rwkr5vvup7h7nzyx", + "proof_1": "CFFE09093C83A3525E9BC3A3BF76DCACD2EA034B19EED3043AE0ABA52559B3D9", + "proof_2": "CFFE09093C83A3525E9BC3A3BF76DCACD2EA034B19EED3043AE0ABA52559B3D9" +} From 5b8b8f89de814d3b9dab8a7cb7b6ac823d24c733 Mon Sep 17 00:00:00 2001 From: NodesHub <149433919+NodesHub@users.noreply.github.com> Date: Wed, 8 Jan 2025 14:40:49 +0530 Subject: [PATCH 02/13] chore(migration-proofs): NodesHub (#223) --- app/upgrades/v2_0/validator-proofs/mainnet/NodesHub.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/NodesHub.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/NodesHub.json b/app/upgrades/v2_0/validator-proofs/mainnet/NodesHub.json new file mode 100644 index 00000000..ddcd70f3 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/NodesHub.json @@ -0,0 +1,7 @@ +{ + "name": "Nodes Hub 🛡️ 100% Slash Protected 🛡️", + "consensus_address": "kyvevaloper1hvlarv7f2cyjd8y82f6dd6ue0v6xexsskdsxzn", + "protocol_address": "kyve1hvlarv7f2cyjd8y82f6dd6ue0v6xexssyasxv3", + "proof_1": "2D095EE9FFA025D97442B67C3758A479875A95C93EFBF70473AD00FB3F525522", + "proof_2": "8FA9DCABA4310126505C0A7E0A82F4017341343F1D3989F93A6FA180A01D85BE" +} From 7e7d4bd63eca08b647403ea30115f3a145fc03cc Mon Sep 17 00:00:00 2001 From: alexandrglaznyov <63500326+alexandrglaznyov@users.noreply.github.com> Date: Wed, 8 Jan 2025 11:12:53 +0200 Subject: [PATCH 03/13] chore(migration-proofs): MELLIFERA (#225) --- app/upgrades/v2_0/validator-proofs/mainnet/MELLIFERA.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/MELLIFERA.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/MELLIFERA.json b/app/upgrades/v2_0/validator-proofs/mainnet/MELLIFERA.json new file mode 100644 index 00000000..93d0969a --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/MELLIFERA.json @@ -0,0 +1,7 @@ +{ + "name": "MELLIFERA", + "consensus_address": "kyvevaloper13am3qms82sevhv9nv7z9jwfuffjsfqfum2dc2h", + "protocol_address": "kyve1dsk7wfy6n2ylwj8x2el6txgsyff8av6wa5yl28", + "proof_1": "9F636AD173DBB92C911E7E4230E43995F3E12A43FC20131EF7D9B64FB16B76E9", + "proof_2": "5837D0555B087E4BBBCCBBC9B53323555891C3ABA232E8CBB6E969715026FC51" +} From 0f60c1e372182a817e1123bbd64107734f857015 Mon Sep 17 00:00:00 2001 From: Liver-23 Date: Wed, 8 Jan 2025 11:17:37 +0200 Subject: [PATCH 04/13] chore(migration-proofs): LiveRaveN (Kaon) (#224) --- app/upgrades/v2_0/validator-proofs/kaon/LiveRaveN.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/kaon/LiveRaveN.json diff --git a/app/upgrades/v2_0/validator-proofs/kaon/LiveRaveN.json b/app/upgrades/v2_0/validator-proofs/kaon/LiveRaveN.json new file mode 100644 index 00000000..b6510855 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/kaon/LiveRaveN.json @@ -0,0 +1,7 @@ +{ + "name": "LiveRaveN", + "consensus_address": "kyvevaloper13eduhc6ds4fvcatt8vj472rwkr5vvup79wnz2y", + "protocol_address": "kyve13eduhc6ds4fvcatt8vj472rwkr5vvup7h7nzyx", + "proof_1": "03A0651F91A42BCCEB31C1752B037C240C3CDB652FDD4B8C4217D0BCA3ACFE31", + "proof_2": "03A0651F91A42BCCEB31C1752B037C240C3CDB652FDD4B8C4217D0BCA3ACFE31" +} From 59413973d76609de1023ab0b8aef880a73094d82 Mon Sep 17 00:00:00 2001 From: Maximilian Breithecker <72022235+mbreithecker@users.noreply.github.com> Date: Wed, 8 Jan 2025 10:43:04 +0100 Subject: [PATCH 05/13] chore: add verify-script for checking validator migration proofs (#218) --- .github/workflows/all.yml | 3 + .github/workflows/migration.yml | 17 +++++ app/upgrades/v2_0/validator-proofs/Readme.md | 8 ++- .../kaon/example-validator.json | 7 -- .../mainnet/example-validator.json | 7 -- app/upgrades/v2_0/validator-proofs/verify.py | 69 +++++++++++++++++++ 6 files changed, 94 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/migration.yml delete mode 100644 app/upgrades/v2_0/validator-proofs/kaon/example-validator.json delete mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/example-validator.json create mode 100644 app/upgrades/v2_0/validator-proofs/verify.py diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index c126f513..090e9fd3 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -2,6 +2,9 @@ name: run all jobs on: push jobs: + verify-migration-proofs: + uses: ./.github/workflows/migration.yml + lint: uses: ./.github/workflows/lint.yml diff --git a/.github/workflows/migration.yml b/.github/workflows/migration.yml new file mode 100644 index 00000000..25c3f089 --- /dev/null +++ b/.github/workflows/migration.yml @@ -0,0 +1,17 @@ +name: migration +on: + workflow_call: + +jobs: + test: + runs-on: ubuntu-latest + steps: + # Checkout the repository + - name: Check out repository code + uses: actions/checkout@v4 + # Setup Python + - name: Install dependencies + run: pip3 install bech32 requests + - name: Verify migration proofs + working-directory: ./app/upgrades/v2_0/validator-proofs + run: python3 verify.py \ No newline at end of file diff --git a/app/upgrades/v2_0/validator-proofs/Readme.md b/app/upgrades/v2_0/validator-proofs/Readme.md index 24418ed9..40ebc33e 100644 --- a/app/upgrades/v2_0/validator-proofs/Readme.md +++ b/app/upgrades/v2_0/validator-proofs/Readme.md @@ -11,19 +11,21 @@ all stake is returned to the original delegators during the migration. ### Steps -1. Enter the `mainnet`-directory and copy the `example-validator.json` config file and name it after your validator. +1. Enter the `mainnet`-directory and copy an existing config file and name it after your validator. 2. Fill out the `name`, `protocol_address` and `consensus_address` 3. Send 1 $KYVE from the protocol-address to the consensus-validator-operator address using the memo "Shared-Staking" and put the tx-hash in proof_1. -4. Send 1 $KYVE from the consensus-validator-operator address to the protocol address using the memo "Shared-Staking" +4. Send 1 $KYVE from the consensus-validator-operator address to the protocol-address using the memo "Shared-Staking" and put the tx-hash in proof_2. 5. Submit a Pull-Request to https://github.com/KYVENetwork/chain -6. (Optional) Perform the same steps for the `kaon` directory with your Kaon validators. +6. (Optional) Perform the same steps for the `kaon` directory with your Kaon validators. (Transactions must be submitted on the Kaon network.) + +7. Check if the GitHub action (verify-migration-proofs) is passing. You can also run `python3 verify.py` locally to check if everything is correct. ## General Upgrade Procedure diff --git a/app/upgrades/v2_0/validator-proofs/kaon/example-validator.json b/app/upgrades/v2_0/validator-proofs/kaon/example-validator.json deleted file mode 100644 index 7a533ce9..00000000 --- a/app/upgrades/v2_0/validator-proofs/kaon/example-validator.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "My example Kaon validator name - this is just for human-readability", - "consensus_address": "kyvevaloper...", - "protocol_address": "kyve...", - "proof_1": "89644D8598D007F7B744E91BA4490C11513860046C257F29CFAF41EAE37FAE9C", - "proof_2": "36A1110532EC28C4BEDA610720CA31DD1B14D4A49772F8890EB5C62B417D253B" -} \ No newline at end of file diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/example-validator.json b/app/upgrades/v2_0/validator-proofs/mainnet/example-validator.json deleted file mode 100644 index 6d2d84ce..00000000 --- a/app/upgrades/v2_0/validator-proofs/mainnet/example-validator.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "My example validator name - this is just for human-readability", - "consensus_address": "kyvevaloper...", - "protocol_address": "kyve...", - "proof_1": "EEA08DDDA94434BBE1FA25AB941B58D85FC5EE48E866B602549CA194CAB41B11", - "proof_2": "21771F8B4B2F72D0F292F3517051FD6D8CAA5BB9EC83B906F2BF38684F1E624E" -} \ No newline at end of file diff --git a/app/upgrades/v2_0/validator-proofs/verify.py b/app/upgrades/v2_0/validator-proofs/verify.py new file mode 100644 index 00000000..41aacaa1 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/verify.py @@ -0,0 +1,69 @@ +import os +import json +import sys + +import requests +import bech32 + + +def verify_tx(api_endpoint, tx_hash, expect_from_address, expect_to_address): + x = requests.get(api_endpoint + "/cosmos/tx/v1beta1/txs/" + tx_hash) + if x.status_code != 200: + raise Exception("transaction does not exist: ", tx_hash) + + tx = x.json() + if tx["tx"]["body"]["memo"] != "Shared-Staking": + raise Exception("incorrect memo for transaction: ", tx_hash) + + if tx["tx"]["body"]["messages"][0]["from_address"] != expect_from_address: + raise Exception("Incorrect from_address. Expected: {}, got: {}" + .format(expect_from_address, tx["tx"]["body"]["messages"][0]["from_address"])) + + if tx["tx"]["body"]["messages"][0]["to_address"] != expect_to_address: + raise Exception("Incorrect to_address. Expected: {}, got: {}" + .format(expect_to_address, tx["tx"]["body"]["messages"][0]["to_address"])) + + +def verify_proof(api_endpoint, entry): + x = requests.get(api_endpoint + "/cosmos/staking/v1beta1/validators/" + entry["consensus_address"]) + if x.status_code != 200: + raise Exception("Consensus validator does not exist: ", entry["consensus_address"]) + + x = requests.get(api_endpoint + "/kyve/query/v1beta1/staker/" + entry["protocol_address"]) + if x.status_code != 200: + raise Exception("Protocol validator does not exist: ", entry["protocol_address"]) + + prefix, address_bytes = bech32.bech32_decode(entry["consensus_address"]) + validator_acc_address = bech32.bech32_encode("kyve", address_bytes) + + verify_tx(api_endpoint, entry["proof_1"], entry["protocol_address"], validator_acc_address) + verify_tx(api_endpoint, entry["proof_2"], validator_acc_address, entry["protocol_address"]) + + +def verify_network(name, api_endpoint): + status = {"correct": 0, "error": 0} + for file in os.listdir("./" + name): + try: + proof = json.load(open("./{}/{}".format(name, file))) + verify_proof(api_endpoint, proof) + print("[{}]".format(name.title()), file, "✅") + status["correct"] += 1 + + except Exception as e: + print("[{}]".format(name.title()), file, "❌") + print(e) + status["error"] += 1 + + return status + + +status_kaon = verify_network("kaon", "https://api.kaon.kyve.network") +print("\n[Kaon] Correct: {}, Error: {}".format(status_kaon["correct"], status_kaon["error"])) + +print("\n") + +status_mainnet = verify_network("mainnet", "https://api.kyve.network") +print("\n[Mainnet] Correct: {}, Error: {}".format(status_mainnet["correct"], status_mainnet["error"])) + +if status_kaon["error"] != 0 or status_mainnet["error"] != 0: + sys.exit(1) From d70a9db9cce9d89fa10edd0b5d8cc7c5813c7b25 Mon Sep 17 00:00:00 2001 From: svv28 <81138535+svv28@users.noreply.github.com> Date: Thu, 9 Jan 2025 09:13:47 +0000 Subject: [PATCH 06/13] chore(migration-proofs): Pro-Nodes75 (#227) --- .../v2_0/validator-proofs/mainnet/Pro-Nodes75.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/Pro-Nodes75.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/Pro-Nodes75.json b/app/upgrades/v2_0/validator-proofs/mainnet/Pro-Nodes75.json new file mode 100644 index 00000000..cb52a170 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/Pro-Nodes75.json @@ -0,0 +1,7 @@ +{ + "name": "Pro-Nodes75", + "consensus_address": "kyvevaloper18y8xcyecmuffkhexvqdpnqc3y7urh02u83ctx4", + "protocol_address": "kyve129y2x3m9muxmg42ua5wjzquadclk2j3yy6ztkw", + "proof_1": "152C4D15BD1941B4EF359487391C7210F6BE001E9C64C98102293434862B9A9B", + "proof_2": "86C105E630D6C9F65960E3401A2B54AA38374FB21A407D2A4FDC71CE10FA78F2" +} From 8a11d6b47bea0ee56e31137225cd317abd5c592d Mon Sep 17 00:00:00 2001 From: Aleksey <33575324+Lefey@users.noreply.github.com> Date: Fri, 10 Jan 2025 20:21:18 +1000 Subject: [PATCH 07/13] chore(migration-proofs): Lefey (#228) --- app/upgrades/v2_0/validator-proofs/mainnet/Lefey.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/Lefey.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/Lefey.json b/app/upgrades/v2_0/validator-proofs/mainnet/Lefey.json new file mode 100644 index 00000000..72a2d9c3 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/Lefey.json @@ -0,0 +1,7 @@ +{ + "name": "Lefey", + "consensus_address": "kyvevaloper1w3etlejq78tn4vwmqhepzcl2a6zyth0wg4ae02", + "protocol_address": "kyve1xccnldlwmgpq4hc855f3nzvshfl5nw7493c9l9", + "proof_1": "B62F9BDC97739110624A170F953C4345888D8590A69EDDCA78E7CA33BF2D177F", + "proof_2": "9E44B457568470274020E59A91D09E84BDC8222BDAFB5C1B84548BFE8BB5A844" +} From aaef66a31c1e4ca52afc1da5bf468b37cc2aa11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=94=A5STAVR=F0=9F=94=A5?= <77785195+111STAVR111@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:22:25 +0200 Subject: [PATCH 08/13] chore(migration-proofs): STAVR (#229) --- app/upgrades/v2_0/validator-proofs/mainnet/STAVR.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/STAVR.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/STAVR.json b/app/upgrades/v2_0/validator-proofs/mainnet/STAVR.json new file mode 100644 index 00000000..e62ed523 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/STAVR.json @@ -0,0 +1,7 @@ +{ + "name": "STAVR", + "consensus_address": "kyvevaloper16qwtkeadppy3u9z6pu9tuy8zq02u3vecun3s0d", + "protocol_address": "kyve162ydfdt3j34cx9ndrajfsjxcf5e2hfuxqt49d0", + "proof_1": "519B03D2F88CA680B395EC7D0DA306DAE816B92BAD0487DE76CA4363BAA5846E", + "proof_2": "6CEC9CAE20E2BD131C59CCA5673CB836FB84F534F855FA3983C08F5E921F1B1A" +} From 697aa7132b1317ff1381d48dfc20a4a3475720be Mon Sep 17 00:00:00 2001 From: IONodeOnline <91251550+IONodeOnline@users.noreply.github.com> Date: Thu, 16 Jan 2025 14:42:55 +0700 Subject: [PATCH 09/13] chore(migration-proofs): IONode (#230) --- app/upgrades/v2_0/validator-proofs/mainnet/IONode.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/IONode.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/IONode.json b/app/upgrades/v2_0/validator-proofs/mainnet/IONode.json new file mode 100644 index 00000000..9fc351c5 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/IONode.json @@ -0,0 +1,7 @@ +{ + "name": "IONode Online", + "consensus_address": "kyvevaloper186n5up4j80j02vpfrr9tq8cml3h2ju5uara3ye", + "protocol_address": "kyve186n5up4j80j02vpfrr9tq8cml3h2ju5u0na32m", + "proof_1": "6D33A0FE5544B73AED2492E5C4AB93CDF7418B021F52410736DE4FE12194F1E3", + "proof_2": "DD7CE5C254297E57EFB89083CC345FAED20B992BD12AF2A613EA40DC9772BFF0" +} From 2767e7b53b14ea18149931f4fcaef3eb32c51dec Mon Sep 17 00:00:00 2001 From: MrZigha Date: Tue, 21 Jan 2025 11:54:49 +0100 Subject: [PATCH 10/13] chore(migration-proofs): Meria (#231) Co-authored-by: Azeuh <45301173+Azeuh@users.noreply.github.com> --- app/upgrades/v2_0/validator-proofs/mainnet/Meria.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/Meria.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/Meria.json b/app/upgrades/v2_0/validator-proofs/mainnet/Meria.json new file mode 100644 index 00000000..1d56da77 --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/Meria.json @@ -0,0 +1,7 @@ +{ + "name": "Meria", + "consensus_address": "kyvevaloper1hy44ra3hv8vf294fs49zqzykt9hpzegrse4epk", + "protocol_address": "kyve1gqg64xv8uh8zvnym5qkavd882d67ks4ewhhrdf", + "proof_1": "6DA7C83F1B18FE90268C79D414B1871BDD96FCC9720BDDF0333DA3A9E3B29DAC", + "proof_2": "29DB08AAD05EF660BD75FE4EBDC869AB3A1686D2B2DFCC39B9F4EBE7CCEE22CE" +} From 26420cc4a733fedfc352192911955e91146d1e57 Mon Sep 17 00:00:00 2001 From: Vladimir Understanding <38581319+Antropocosmist@users.noreply.github.com> Date: Wed, 22 Jan 2025 13:29:50 +0100 Subject: [PATCH 11/13] chore(migration-proofs): POSTHUMAN (#233) --- app/upgrades/v2_0/validator-proofs/mainnet/POSTHUMAN.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/POSTHUMAN.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/POSTHUMAN.json b/app/upgrades/v2_0/validator-proofs/mainnet/POSTHUMAN.json new file mode 100644 index 00000000..e28656ae --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/POSTHUMAN.json @@ -0,0 +1,7 @@ +{ + "name": "POSTHUMAN", + "consensus_address": "kyvevaloper16hnse4c852xg4vxjnqhx648e02z32n72l66nv7", + "protocol_address": "kyve16hnse4c852xg4vxjnqhx648e02z32n72d26nzu", + "proof_1": "030342E61AFF1A24277936BE32EB8ECCAD364A4296DBC5CDE8270FCC7CAFC80F", + "proof_2": "030342E61AFF1A24277936BE32EB8ECCAD364A4296DBC5CDE8270FCC7CAFC80F" +} From 5826686e184876956e58b96fc8eb6703a704944d Mon Sep 17 00:00:00 2001 From: Troy Kessler <43882936+troykessler@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:45:34 +0100 Subject: [PATCH 12/13] chore: stakers queries (#232) --- config.yml | 4 +- docs/static/openapi.yml | 225 ++++++++++++- proto/kyve/query/v1beta1/account.proto | 16 +- proto/kyve/query/v1beta1/query.proto | 24 +- testutil/integration/checks.go | 6 +- util/expected_keepers.go | 4 + x/query/keeper/grpc_account_assets.go | 6 +- x/query/keeper/grpc_query_staker.go | 12 +- x/query/keeper/grpc_query_stakers_by_pool.go | 7 +- .../grpc_query_stakers_by_pool_count.go | 7 +- x/query/keeper/helper.go | 63 +++- x/query/types/account.pb.go | 206 ++++++++---- x/query/types/query.pb.go | 311 ++++++++++++++---- x/stakers/keeper/exported_functions.go | 2 +- 14 files changed, 713 insertions(+), 180 deletions(-) diff --git a/config.yml b/config.yml index 1924c39d..fd0f22a1 100644 --- a/config.yml +++ b/config.yml @@ -157,7 +157,7 @@ genesis: total_bundles: "0" upload_interval: "60" protocol: - version: "1.1.6" + version: "1.2.8" binaries: "{\"kyve-linux-arm64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.1.6/kyve-linux-arm64.zip\",\"kyve-linux-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.1.6/kyve-linux-x64.zip\",\"kyve-macos-x64\":\"https://github.com/KYVENetwork/kyvejs/releases/download/%40kyvejs%2Ftendermint%401.1.6/kyve-macos-x64.zip\"}" last_upgrade: "0" upgrade_plan: @@ -226,4 +226,4 @@ validators: config: consensus: timeout_commit: "2s" - timeout_propose: "2s" \ No newline at end of file + timeout_propose: "2s" diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 6062ba36..a7a08b8d 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -191,12 +191,36 @@ paths: delegation: type: string format: uint64 - description: protocol_staking ... + description: >- + delegation is the amount in $KYVE this account has in total + delegated ... delegation_unbonding: type: string format: uint64 - description: protocol_staking_unbonding ... - outstanding_rewards: + description: >- + delegation_unbonding is the amount in $KYVE this account has + in total currently unbonding ... + delegation_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. + title: >- + delegation_rewards are the current unclaimed delegation + rewards + commission_rewards: type: array items: type: object @@ -213,7 +237,9 @@ paths: method signatures required by gogoproto. - description: protocol_rewards ... + title: >- + commission_rewards are the current unclaimed commission + rewards protocol_funding: type: array items: @@ -4427,14 +4453,55 @@ paths: bonded shares multiplied by exchange rate. - total_pool_stake: + validator_delegators: type: string format: uint64 title: >- - total_pool_stake returns the amount the validator has in - total + validator_delegators returns the amount of delegators + which have delegated + + into this validator + validator_self_delegation: + type: string + format: uint64 + title: >- + validator_self_delegation returns the amount in $KYVE the + validator has + + personally delegated + validator_unbonding: + type: string + format: uint64 + title: >- + validator_unbonding returns the amount in $KYVE the + validator is currently + + unbonding from his validator + validator_total_pool_stake: + type: string + format: uint64 + title: >- + validator_total_pool_stake returns the amount the + validator has in total staked in all his pools + validator_commission_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. pools: type: array items: @@ -5089,14 +5156,56 @@ paths: bonded shares multiplied by exchange rate. - total_pool_stake: + validator_delegators: + type: string + format: uint64 + title: >- + validator_delegators returns the amount of delegators + which have delegated + + into this validator + validator_self_delegation: + type: string + format: uint64 + title: >- + validator_self_delegation returns the amount in $KYVE + the validator has + + personally delegated + validator_unbonding: + type: string + format: uint64 + title: >- + validator_unbonding returns the amount in $KYVE the + validator is currently + + unbonding from his validator + validator_total_pool_stake: type: string format: uint64 title: >- - total_pool_stake returns the amount the validator has in - total + validator_total_pool_stake returns the amount the + validator has in total staked in all his pools + validator_commission_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. pools: type: array items: @@ -5855,14 +5964,56 @@ paths: bonded shares multiplied by exchange rate. - total_pool_stake: + validator_delegators: + type: string + format: uint64 + title: >- + validator_delegators returns the amount of delegators + which have delegated + + into this validator + validator_self_delegation: + type: string + format: uint64 + title: >- + validator_self_delegation returns the amount in $KYVE + the validator has + + personally delegated + validator_unbonding: type: string format: uint64 title: >- - total_pool_stake returns the amount the validator has in - total + validator_unbonding returns the amount in $KYVE the + validator is currently + + unbonding from his validator + validator_total_pool_stake: + type: string + format: uint64 + title: >- + validator_total_pool_stake returns the amount the + validator has in total staked in all his pools + validator_commission_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. pools: type: array items: @@ -6530,14 +6681,56 @@ paths: bonded shares multiplied by exchange rate. - total_pool_stake: + validator_delegators: type: string format: uint64 title: >- - total_pool_stake returns the amount the validator has in - total + validator_delegators returns the amount of delegators + which have delegated + + into this validator + validator_self_delegation: + type: string + format: uint64 + title: >- + validator_self_delegation returns the amount in $KYVE + the validator has + + personally delegated + validator_unbonding: + type: string + format: uint64 + title: >- + validator_unbonding returns the amount in $KYVE the + validator is currently + + unbonding from his validator + validator_total_pool_stake: + type: string + format: uint64 + title: >- + validator_total_pool_stake returns the amount the + validator has in total staked in all his pools + validator_commission_rewards: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an + amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. pools: type: array items: diff --git a/proto/kyve/query/v1beta1/account.proto b/proto/kyve/query/v1beta1/account.proto index 770b07b4..a480e1aa 100644 --- a/proto/kyve/query/v1beta1/account.proto +++ b/proto/kyve/query/v1beta1/account.proto @@ -38,18 +38,24 @@ message QueryAccountAssetsRequest { message QueryAccountAssetsResponse { // balance ... uint64 balance = 1; - // protocol_staking ... + // delegation is the amount in $KYVE this account has in total delegated ... uint64 delegation = 2; - // protocol_staking_unbonding ... + // delegation_unbonding is the amount in $KYVE this account has in total currently unbonding ... uint64 delegation_unbonding = 3; - // protocol_rewards ... - repeated cosmos.base.v1beta1.Coin outstanding_rewards = 6 [ + // delegation_rewards are the current unclaimed delegation rewards + repeated cosmos.base.v1beta1.Coin delegation_rewards = 6 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + // commission_rewards are the current unclaimed commission rewards + repeated cosmos.base.v1beta1.Coin commission_rewards = 7 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; // protocol_funding ... - repeated cosmos.base.v1beta1.Coin protocol_funding = 7 [ + repeated cosmos.base.v1beta1.Coin protocol_funding = 8 [ (gogoproto.nullable) = false, (amino.dont_omitempty) = true, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" diff --git a/proto/kyve/query/v1beta1/query.proto b/proto/kyve/query/v1beta1/query.proto index c1e9d51f..f6eee90f 100644 --- a/proto/kyve/query/v1beta1/query.proto +++ b/proto/kyve/query/v1beta1/query.proto @@ -75,13 +75,31 @@ message FullStaker { cosmos.staking.v1beta1.Validator validator = 2; - // total_pool_stake returns the amount the validator has in total + // validator_delegators returns the amount of delegators which have delegated + // into this validator + uint64 validator_delegators = 3; + + // validator_self_delegation returns the amount in $KYVE the validator has + // personally delegated + uint64 validator_self_delegation = 4; + + // validator_unbonding returns the amount in $KYVE the validator is currently + // unbonding from his validator + uint64 validator_unbonding = 5; + + // validator_total_pool_stake returns the amount the validator has in total // staked in all his pools - uint64 total_pool_stake = 3; + uint64 validator_total_pool_stake = 6; + + repeated cosmos.base.v1beta1.Coin validator_commission_rewards = 7 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; // pools is a list of all pools the staker is currently // participating, i.e. allowed to vote and upload data. - repeated PoolMembership pools = 4; + repeated PoolMembership pools = 8; } // CommissionChangeEntry shows when the old commission diff --git a/testutil/integration/checks.go b/testutil/integration/checks.go index c1fb42ce..2cf5cd3b 100644 --- a/testutil/integration/checks.go +++ b/testutil/integration/checks.go @@ -123,7 +123,10 @@ func (suite *KeeperTestSuite) VerifyPoolQueries() { for _, poolAccount := range poolAccounts { if _, stakerFound := suite.App().StakersKeeper.GetValidator(suite.Ctx(), poolAccount.Staker); stakerFound { - stakersByPoolState = append(stakersByPoolState, *suite.App().QueryKeeper.GetFullStaker(suite.Ctx(), poolAccount.Staker)) + fullStaker, err := suite.App().QueryKeeper.GetFullStaker(suite.Ctx(), poolAccount.Staker) + if err == nil { + stakersByPoolState = append(stakersByPoolState, *fullStaker) + } } } @@ -183,6 +186,7 @@ func (suite *KeeperTestSuite) VerifyPoolTotalStake() { func (suite *KeeperTestSuite) VerifyStakersQueries() { validators, _ := suite.App().StakingKeeper.GetBondedValidatorsByPower(suite.Ctx()) stakersQuery, stakersQueryErr := suite.App().QueryKeeper.Stakers(suite.Ctx(), &querytypes.QueryStakersRequest{ + Status: querytypes.STAKER_STATUS_CHAIN_ACTIVE, Pagination: &query.PageRequest{ Limit: 1000, }, diff --git a/util/expected_keepers.go b/util/expected_keepers.go index c33381e2..367e7e1d 100644 --- a/util/expected_keepers.go +++ b/util/expected_keepers.go @@ -40,6 +40,7 @@ type StakingKeeper interface { Slash(ctx context.Context, consAddr sdk.ConsAddress, infractionHeight, power int64, slashFactor math.LegacyDec) (math.Int, error) GetValidator(ctx context.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, err error) GetBondedValidatorsByPower(ctx context.Context) ([]stakingtypes.Validator, error) + GetValidators(ctx context.Context, maxRetrieve uint32) (validators []stakingtypes.Validator, err error) PowerReduction(ctx context.Context) math.Int SetHooks(sh stakingtypes.StakingHooks) Delegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.DelegationI, error) @@ -47,6 +48,9 @@ type StakingKeeper interface { GetDelegatorBonded(ctx context.Context, delegator sdk.AccAddress) (math.Int, error) GetDelegatorValidators(ctx context.Context, delegatorAddr sdk.AccAddress, maxRetrieve uint32) (stakingtypes.Validators, error) GetDelegatorUnbonding(ctx context.Context, delegator sdk.AccAddress) (math.Int, error) + IterateDelegatorUnbondingDelegations(ctx context.Context, delegator sdk.AccAddress, cb func(ubd stakingtypes.UnbondingDelegation) (stop bool)) error + GetValidatorDelegations(ctx context.Context, valAddr sdk.ValAddress) (delegations []stakingtypes.Delegation, err error) + GetDelegation(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) (stakingtypes.Delegation, error) } type UpgradeKeeper interface { diff --git a/x/query/keeper/grpc_account_assets.go b/x/query/keeper/grpc_account_assets.go index 36c83b54..d04658f2 100644 --- a/x/query/keeper/grpc_account_assets.go +++ b/x/query/keeper/grpc_account_assets.go @@ -39,17 +39,19 @@ func (k Keeper) AccountAssets(goCtx context.Context, req *types.QueryAccountAsse return nil, status.Error(codes.InvalidArgument, err.Error()) } - validators, err := k.stakingKeeper.GetDelegatorValidators(ctx, delegatorAddr, ^uint32(0)) + validators, err := k.stakingKeeper.GetDelegatorValidators(ctx, delegatorAddr, 1000) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) } for _, validator := range validators.Validators { - response.OutstandingRewards = response.OutstandingRewards.Add( + response.DelegationRewards = response.DelegationRewards.Add( k.stakerKeeper.GetOutstandingRewards(ctx, util.MustAccountAddressFromValAddress(validator.OperatorAddress), req.Address)..., ) } + response.CommissionRewards = k.stakerKeeper.GetOutstandingCommissionRewards(ctx, util.MustAccountAddressFromValAddress(util.MustValaddressFromOperatorAddress(req.Address))) + delegatorBonded, err := k.stakingKeeper.GetDelegatorBonded(ctx, delegatorAddr) if err != nil { return nil, status.Error(codes.InvalidArgument, err.Error()) diff --git a/x/query/keeper/grpc_query_staker.go b/x/query/keeper/grpc_query_staker.go index a72689ca..4bc5f38b 100644 --- a/x/query/keeper/grpc_query_staker.go +++ b/x/query/keeper/grpc_query_staker.go @@ -23,7 +23,10 @@ func (k Keeper) Stakers(c context.Context, req *types.QueryStakersRequest) (*typ req.Search = strings.ToLower(req.Search) accumulator := func(address string, accumulate bool) bool { - fullStaker := k.GetFullStaker(ctx, address) + fullStaker, err := k.GetFullStaker(ctx, address) + if err != nil { + return false + } searchAddress := strings.ToLower(fullStaker.Address) searchMoniker := strings.ToLower(fullStaker.Validator.GetMoniker()) @@ -61,5 +64,10 @@ func (k Keeper) Staker(c context.Context, req *types.QueryStakerRequest) (*types return nil, sdkerrors.ErrKeyNotFound } - return &types.QueryStakerResponse{Staker: *k.GetFullStaker(ctx, req.Address)}, nil + fullStaker, err := k.GetFullStaker(ctx, req.Address) + if err != nil { + return nil, err + } + + return &types.QueryStakerResponse{Staker: *fullStaker}, nil } diff --git a/x/query/keeper/grpc_query_stakers_by_pool.go b/x/query/keeper/grpc_query_stakers_by_pool.go index 88b2e662..ce57d2f4 100644 --- a/x/query/keeper/grpc_query_stakers_by_pool.go +++ b/x/query/keeper/grpc_query_stakers_by_pool.go @@ -25,7 +25,12 @@ func (k Keeper) StakersByPool(c context.Context, req *types.QueryStakersByPoolRe stakers := make([]types.FullStaker, 0) for _, poolAccount := range k.stakerKeeper.GetAllPoolAccountsOfPool(ctx, req.PoolId) { - stakers = append(stakers, *k.GetFullStaker(ctx, poolAccount.Staker)) + fullStaker, err := k.GetFullStaker(ctx, poolAccount.Staker) + if err != nil { + return nil, err + } + + stakers = append(stakers, *fullStaker) } stakes := k.stakerKeeper.GetValidatorPoolStakes(ctx, req.PoolId) diff --git a/x/query/keeper/grpc_query_stakers_by_pool_count.go b/x/query/keeper/grpc_query_stakers_by_pool_count.go index 868fbe1a..bc45d535 100644 --- a/x/query/keeper/grpc_query_stakers_by_pool_count.go +++ b/x/query/keeper/grpc_query_stakers_by_pool_count.go @@ -20,8 +20,13 @@ func (k Keeper) StakersByPoolCount(c context.Context, req *types.QueryStakersByP data := make([]types.FullStaker, 0) accumulator := func(address string, accumulate bool) bool { + fullStaker, err := k.GetFullStaker(ctx, address) + if err != nil { + return false + } + if accumulate { - data = append(data, *k.GetFullStaker(ctx, address)) + data = append(data, *fullStaker) } return true } diff --git a/x/query/keeper/helper.go b/x/query/keeper/helper.go index a52e3620..f8993056 100644 --- a/x/query/keeper/helper.go +++ b/x/query/keeper/helper.go @@ -1,17 +1,58 @@ package keeper import ( + "cosmossdk.io/math" + + "github.com/KYVENetwork/chain/util" globalTypes "github.com/KYVENetwork/chain/x/global/types" pooltypes "github.com/KYVENetwork/chain/x/pool/types" "github.com/KYVENetwork/chain/x/query/types" sdk "github.com/cosmos/cosmos-sdk/types" + stakingTypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) -func (k Keeper) GetFullStaker(ctx sdk.Context, stakerAddress string) *types.FullStaker { - validator, _ := k.stakerKeeper.GetValidator(ctx, stakerAddress) +func (k Keeper) GetFullStaker(ctx sdk.Context, stakerAddress string) (*types.FullStaker, error) { + valAddress, err := sdk.ValAddressFromBech32(util.MustValaddressFromOperatorAddress(stakerAddress)) + if err != nil { + return nil, err + } + validator, err := k.stakingKeeper.GetValidator(ctx, valAddress) + if err != nil { + return nil, err + } + + validatorAccAddress, _ := sdk.AccAddressFromBech32(stakerAddress) + validatorUnbonding := math.ZeroInt() + err = k.stakingKeeper.IterateDelegatorUnbondingDelegations(ctx, validatorAccAddress, func(ubd stakingTypes.UnbondingDelegation) bool { + if ubd.ValidatorAddress == validator.OperatorAddress { + for _, entry := range ubd.Entries { + validatorUnbonding = validatorUnbonding.Add(entry.Balance) + } + } + return false + }) + if err != nil { + return nil, err + } + + validatorDelegations, err := k.stakingKeeper.GetValidatorDelegations(ctx, valAddress) + if err != nil { + return nil, err + } + + validatorSelfDelegation := uint64(0) + + if d, err := k.stakingKeeper.GetDelegation(ctx, validatorAccAddress, valAddress); err == nil { + validatorSelfDelegation = uint64(validator.TokensFromSharesTruncated(d.Shares).TruncateInt64()) + } + + validatorCommissionRewards, err := k.distrkeeper.GetValidatorAccumulatedCommission(ctx, valAddress) + if err != nil { + return nil, err + } var poolMemberships []*types.PoolMembership - totalPoolStake := uint64(0) + validatorTotalPoolStake := uint64(0) for _, poolAccount := range k.stakerKeeper.GetPoolAccountsFromStaker(ctx, stakerAddress) { pool, _ := k.poolKeeper.GetPool(ctx, poolAccount.PoolId) @@ -38,7 +79,7 @@ func (k Keeper) GetFullStaker(ctx sdk.Context, stakerAddress string) *types.Full } poolStake := k.stakerKeeper.GetValidatorPoolStake(ctx, stakerAddress, pool.Id) - totalPoolStake += poolStake + validatorTotalPoolStake += poolStake poolMemberships = append( poolMemberships, &types.PoolMembership{ @@ -67,11 +108,15 @@ func (k Keeper) GetFullStaker(ctx sdk.Context, stakerAddress string) *types.Full } return &types.FullStaker{ - Address: stakerAddress, - Validator: &validator, - TotalPoolStake: totalPoolStake, - Pools: poolMemberships, - } + Address: stakerAddress, + Validator: &validator, + ValidatorDelegators: uint64(len(validatorDelegations)), + ValidatorUnbonding: validatorUnbonding.Uint64(), + ValidatorSelfDelegation: validatorSelfDelegation, + ValidatorTotalPoolStake: validatorTotalPoolStake, + ValidatorCommissionRewards: util.TruncateDecCoins(validatorCommissionRewards.Commission), + Pools: poolMemberships, + }, nil } func (k Keeper) GetPoolStatus(ctx sdk.Context, pool *pooltypes.Pool) pooltypes.PoolStatus { diff --git a/x/query/types/account.pb.go b/x/query/types/account.pb.go index 24c1bd5b..2e0e4cb2 100644 --- a/x/query/types/account.pb.go +++ b/x/query/types/account.pb.go @@ -83,14 +83,16 @@ func (m *QueryAccountAssetsRequest) GetAddress() string { type QueryAccountAssetsResponse struct { // balance ... Balance uint64 `protobuf:"varint,1,opt,name=balance,proto3" json:"balance,omitempty"` - // protocol_staking ... + // delegation is the amount in $KYVE this account has in total delegated ... Delegation uint64 `protobuf:"varint,2,opt,name=delegation,proto3" json:"delegation,omitempty"` - // protocol_staking_unbonding ... + // delegation_unbonding is the amount in $KYVE this account has in total currently unbonding ... DelegationUnbonding uint64 `protobuf:"varint,3,opt,name=delegation_unbonding,json=delegationUnbonding,proto3" json:"delegation_unbonding,omitempty"` - // protocol_rewards ... - OutstandingRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=outstanding_rewards,json=outstandingRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"outstanding_rewards"` + // delegation_rewards are the current unclaimed delegation rewards + DelegationRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=delegation_rewards,json=delegationRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"delegation_rewards"` + // commission_rewards are the current unclaimed commission rewards + CommissionRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=commission_rewards,json=commissionRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"commission_rewards"` // protocol_funding ... - ProtocolFunding github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=protocol_funding,json=protocolFunding,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"protocol_funding"` + ProtocolFunding github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=protocol_funding,json=protocolFunding,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"protocol_funding"` } func (m *QueryAccountAssetsResponse) Reset() { *m = QueryAccountAssetsResponse{} } @@ -147,9 +149,16 @@ func (m *QueryAccountAssetsResponse) GetDelegationUnbonding() uint64 { return 0 } -func (m *QueryAccountAssetsResponse) GetOutstandingRewards() github_com_cosmos_cosmos_sdk_types.Coins { +func (m *QueryAccountAssetsResponse) GetDelegationRewards() github_com_cosmos_cosmos_sdk_types.Coins { if m != nil { - return m.OutstandingRewards + return m.DelegationRewards + } + return nil +} + +func (m *QueryAccountAssetsResponse) GetCommissionRewards() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.CommissionRewards } return nil } @@ -659,62 +668,63 @@ func init() { func init() { proto.RegisterFile("kyve/query/v1beta1/account.proto", fileDescriptor_51ca316755261aec) } var fileDescriptor_51ca316755261aec = []byte{ - // 878 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x3a, 0x91, 0x23, 0x5e, 0x5a, 0x4a, 0x26, 0x15, 0x72, 0x0d, 0xd9, 0x44, 0x8b, 0xc0, - 0x56, 0x44, 0x77, 0x65, 0x97, 0x22, 0x2a, 0x4e, 0x75, 0x93, 0x70, 0xe0, 0x87, 0xca, 0x16, 0x90, - 0xda, 0xcb, 0x6a, 0xbc, 0x3b, 0xd9, 0x0c, 0x5e, 0xcf, 0xb8, 0x3b, 0xb3, 0x09, 0x56, 0xc5, 0x01, - 0x8e, 0xe5, 0x82, 0xc4, 0xbf, 0x80, 0x04, 0xe2, 0xc4, 0x85, 0x1b, 0x27, 0x4e, 0x3d, 0x56, 0xe2, - 0xc2, 0x09, 0x50, 0x82, 0xc4, 0x89, 0xff, 0x01, 0xed, 0xcc, 0xac, 0xbd, 0xc6, 0x6b, 0x0c, 0x87, - 0x5c, 0x12, 0xcf, 0x9b, 0xef, 0xfd, 0xfa, 0xde, 0xf7, 0x76, 0x60,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b, 0x6f, 0xdf, 0xff, 0xe8, 0xe0, 0x3d, 0x22, 0x4f, 0x79, 0x3a, - 0xf0, 0xc2, 0x63, 0x4c, 0x99, 0xf7, 0x89, 0xc9, 0xa2, 0x76, 0xaa, 0x5f, 0x57, 0xcf, 0xc7, 0x8d, - 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x00, 0x1d, 0xe2, 0xe3, 0x08, 0x00, 0x00, + // 893 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0x3a, 0x91, 0x03, 0x2f, 0x2d, 0x25, 0xd3, 0x0a, 0xb9, 0x86, 0x6c, 0xa2, 0x45, 0x90, + 0x28, 0xa2, 0xbb, 0xb2, 0x4b, 0x11, 0x15, 0xa7, 0xba, 0x49, 0x38, 0xf0, 0x43, 0x65, 0x0b, 0x48, + 0xed, 0xc5, 0x1a, 0xef, 0x4e, 0x36, 0x83, 0x77, 0x67, 0xdc, 0x9d, 0x71, 0x82, 0x55, 0x21, 0x24, + 0x4e, 0x08, 0x2e, 0x48, 0xfc, 0x0b, 0x48, 0x20, 0x4e, 0x5c, 0xb8, 0x71, 0xe2, 0xd4, 0x63, 0x25, + 0x2e, 0x9c, 0x00, 0x25, 0x48, 0x9c, 0xf8, 0x1f, 0xd0, 0xce, 0xcc, 0xda, 0x63, 0xbc, 0xc6, 0xf4, + 0x90, 0x4b, 0xe2, 0x79, 0xf3, 0xbd, 0xf7, 0xbe, 0xf7, 0xde, 0xf7, 0x3c, 0x86, 0xad, 0xfe, 0xe8, + 0x98, 0x04, 0x0f, 0x86, 0x24, 0x1f, 0x05, 0xc7, 0xad, 0x1e, 0x91, 0xb8, 0x15, 0xe0, 0x28, 0xe2, + 0x43, 0x26, 0xfd, 0x41, 0xce, 0x25, 0x47, 0xa8, 0x40, 0xf8, 0x0a, 0xe1, 0x1b, 0x44, 0x73, 0x1d, + 0x67, 0x94, 0xf1, 0x40, 0xfd, 0xd5, 0xb0, 0xe6, 0x6e, 0xc4, 0x45, 0xc6, 0x45, 0xd0, 0xc3, 0xe2, + 0xdf, 0xf1, 0x06, 0x38, 0xa1, 0x0c, 0x4b, 0xca, 0x99, 0xc1, 0xba, 0x36, 0xb6, 0x44, 0x45, 0x9c, + 0x96, 0xf7, 0x57, 0x12, 0x9e, 0x70, 0xf5, 0x31, 0x28, 0x3e, 0x19, 0xeb, 0x0b, 0x09, 0xe7, 0x49, + 0x4a, 0x02, 0x3c, 0xa0, 0x01, 0x66, 0x8c, 0x4b, 0x15, 0x52, 0x94, 0x31, 0x2b, 0x0a, 0xd1, 0xa4, + 0xd5, 0xbd, 0x77, 0x03, 0xae, 0xbe, 0x57, 0x1c, 0x6f, 0xe9, 0xe2, 0x6e, 0x09, 0x41, 0xa4, 0x08, + 0xc9, 0x83, 0x21, 0x11, 0x12, 0x35, 0x60, 0x15, 0xc7, 0x71, 0x4e, 0x84, 0x68, 0x38, 0x5b, 0xce, + 0xce, 0xd3, 0x61, 0x79, 0xf4, 0x3e, 0x5f, 0x81, 0x66, 0x95, 0x9f, 0x18, 0x70, 0x26, 0x48, 0xe1, + 0xd8, 0xc3, 0x29, 0x66, 0x11, 0x51, 0x8e, 0x2b, 0x61, 0x79, 0x44, 0x2e, 0x40, 0x4c, 0x52, 0x92, + 0x28, 0x92, 0x8d, 0x9a, 0xba, 0xb4, 0x2c, 0xa8, 0x05, 0x57, 0x26, 0xa7, 0xee, 0x90, 0xf5, 0x38, + 0x8b, 0x29, 0x4b, 0x1a, 0xcb, 0x0a, 0x79, 0x79, 0x72, 0xf7, 0x41, 0x79, 0x85, 0x3e, 0x05, 0x64, + 0xb9, 0xe4, 0xe4, 0x04, 0xe7, 0xb1, 0x68, 0xd4, 0xb7, 0x96, 0x77, 0xd6, 0xda, 0x57, 0x7d, 0xdd, + 0x53, 0xbf, 0xe8, 0x69, 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0, 0x63, 0x93, 0x45, 0xed, 0x54, 0xaf, 0xae, 0x9e, 0x8f, 0xeb, 0xff, + 0x04, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x94, 0x42, 0xa6, 0x61, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -899,13 +909,27 @@ func (m *QueryAccountAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, err i = encodeVarintAccount(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x42 + } + } + if len(m.CommissionRewards) > 0 { + for iNdEx := len(m.CommissionRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CommissionRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccount(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x3a } } - if len(m.OutstandingRewards) > 0 { - for iNdEx := len(m.OutstandingRewards) - 1; iNdEx >= 0; iNdEx-- { + if len(m.DelegationRewards) > 0 { + for iNdEx := len(m.DelegationRewards) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.OutstandingRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.DelegationRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1330,8 +1354,14 @@ func (m *QueryAccountAssetsResponse) Size() (n int) { if m.DelegationUnbonding != 0 { n += 1 + sovAccount(uint64(m.DelegationUnbonding)) } - if len(m.OutstandingRewards) > 0 { - for _, e := range m.OutstandingRewards { + if len(m.DelegationRewards) > 0 { + for _, e := range m.DelegationRewards { + l = e.Size() + n += 1 + l + sovAccount(uint64(l)) + } + } + if len(m.CommissionRewards) > 0 { + for _, e := range m.CommissionRewards { l = e.Size() n += 1 + l + sovAccount(uint64(l)) } @@ -1669,7 +1699,7 @@ func (m *QueryAccountAssetsResponse) Unmarshal(dAtA []byte) error { } case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OutstandingRewards", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field DelegationRewards", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1696,12 +1726,46 @@ func (m *QueryAccountAssetsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.OutstandingRewards = append(m.OutstandingRewards, types.Coin{}) - if err := m.OutstandingRewards[len(m.OutstandingRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.DelegationRewards = append(m.DelegationRewards, types.Coin{}) + if err := m.DelegationRewards[len(m.DelegationRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommissionRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccount + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccount + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccount + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommissionRewards = append(m.CommissionRewards, types.Coin{}) + if err := m.CommissionRewards[len(m.CommissionRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ProtocolFunding", wireType) } diff --git a/x/query/types/query.pb.go b/x/query/types/query.pb.go index cbc2597a..a53a6ab8 100644 --- a/x/query/types/query.pb.go +++ b/x/query/types/query.pb.go @@ -151,12 +151,22 @@ type FullStaker struct { // address of the staker Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Validator *types2.Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` - // total_pool_stake returns the amount the validator has in total + // validator_delegators returns the amount of delegators which have delegated + // into this validator + ValidatorDelegators uint64 `protobuf:"varint,3,opt,name=validator_delegators,json=validatorDelegators,proto3" json:"validator_delegators,omitempty"` + // validator_self_delegation returns the amount in $KYVE the validator has + // personally delegated + ValidatorSelfDelegation uint64 `protobuf:"varint,4,opt,name=validator_self_delegation,json=validatorSelfDelegation,proto3" json:"validator_self_delegation,omitempty"` + // validator_unbonding returns the amount in $KYVE the validator is currently + // unbonding from his validator + ValidatorUnbonding uint64 `protobuf:"varint,5,opt,name=validator_unbonding,json=validatorUnbonding,proto3" json:"validator_unbonding,omitempty"` + // validator_total_pool_stake returns the amount the validator has in total // staked in all his pools - TotalPoolStake uint64 `protobuf:"varint,3,opt,name=total_pool_stake,json=totalPoolStake,proto3" json:"total_pool_stake,omitempty"` + ValidatorTotalPoolStake uint64 `protobuf:"varint,6,opt,name=validator_total_pool_stake,json=validatorTotalPoolStake,proto3" json:"validator_total_pool_stake,omitempty"` + ValidatorCommissionRewards github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=validator_commission_rewards,json=validatorCommissionRewards,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"validator_commission_rewards"` // pools is a list of all pools the staker is currently // participating, i.e. allowed to vote and upload data. - Pools []*PoolMembership `protobuf:"bytes,4,rep,name=pools,proto3" json:"pools,omitempty"` + Pools []*PoolMembership `protobuf:"bytes,8,rep,name=pools,proto3" json:"pools,omitempty"` } func (m *FullStaker) Reset() { *m = FullStaker{} } @@ -206,13 +216,41 @@ func (m *FullStaker) GetValidator() *types2.Validator { return nil } -func (m *FullStaker) GetTotalPoolStake() uint64 { +func (m *FullStaker) GetValidatorDelegators() uint64 { if m != nil { - return m.TotalPoolStake + return m.ValidatorDelegators } return 0 } +func (m *FullStaker) GetValidatorSelfDelegation() uint64 { + if m != nil { + return m.ValidatorSelfDelegation + } + return 0 +} + +func (m *FullStaker) GetValidatorUnbonding() uint64 { + if m != nil { + return m.ValidatorUnbonding + } + return 0 +} + +func (m *FullStaker) GetValidatorTotalPoolStake() uint64 { + if m != nil { + return m.ValidatorTotalPoolStake + } + return 0 +} + +func (m *FullStaker) GetValidatorCommissionRewards() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.ValidatorCommissionRewards + } + return nil +} + func (m *FullStaker) GetPools() []*PoolMembership { if m != nil { return m.Pools @@ -469,59 +507,65 @@ func init() { func init() { proto.RegisterFile("kyve/query/v1beta1/query.proto", fileDescriptor_6b41255feae93a15) } var fileDescriptor_6b41255feae93a15 = []byte{ - // 831 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0x41, 0x6f, 0xdc, 0x44, - 0x14, 0x8e, 0xb3, 0xee, 0x26, 0x9e, 0x6d, 0x17, 0x18, 0x95, 0xe2, 0x06, 0xe2, 0xa4, 0x5b, 0x24, - 0x96, 0x0a, 0x6c, 0x25, 0xa8, 0x12, 0x37, 0x44, 0x92, 0x46, 0x02, 0x0a, 0x42, 0x8e, 0x54, 0x54, - 0x2e, 0xd6, 0xac, 0x3d, 0xf1, 0x8e, 0xd6, 0x9e, 0x71, 0x3d, 0xb3, 0x5b, 0xf6, 0xc8, 0x99, 0x0b, - 0x3f, 0x03, 0x21, 0x0e, 0xfc, 0x03, 0xae, 0x95, 0xb8, 0xf4, 0x88, 0x38, 0x14, 0x94, 0x1c, 0xf8, - 0x1b, 0x68, 0xde, 0xcc, 0x6c, 0x37, 0x61, 0x91, 0xda, 0x5e, 0x92, 0x79, 0xef, 0x7d, 0xf3, 0xde, - 0xf7, 0xde, 0xf7, 0x66, 0x8d, 0xa2, 0xc9, 0x7c, 0x46, 0x93, 0x47, 0x53, 0xda, 0xce, 0x93, 0xd9, - 0xde, 0x88, 0x2a, 0xb2, 0x67, 0xac, 0xb8, 0x69, 0x85, 0x12, 0x18, 0xeb, 0x78, 0x6c, 0x3c, 0x36, - 0xbe, 0xf5, 0x06, 0xa9, 0x19,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xe1, 0xfd, 0xfa, 0xa9, 0x33, 0x2f, 0x29, 0xd6, - 0x7d, 0x35, 0xc5, 0x28, 0xba, 0xd9, 0x50, 0x5e, 0x30, 0x5e, 0x66, 0xcf, 0xbd, 0x59, 0x0e, 0x8a, - 0x84, 0x1b, 0x30, 0x80, 0xf7, 0x57, 0x0d, 0x60, 0xe5, 0x12, 0xa5, 0x6f, 0xd9, 0x5c, 0x97, 0xa3, - 0x2b, 0x64, 0xdd, 0x7c, 0x65, 0x59, 0x05, 0xda, 0x76, 0x94, 0x2f, 0xe6, 0x74, 0xb4, 0x03, 0xa0, - 0xfd, 0xc1, 0x2a, 0xda, 0xff, 0xb7, 0x77, 0xe9, 0x96, 0x4d, 0xb9, 0x02, 0xa0, 0x45, 0x5c, 0x7a, - 0x92, 0x08, 0x54, 0x08, 0x1a, 0xf7, 0x1a, 0x0f, 0x8e, 0x9e, 0x9c, 0x45, 0xde, 0xd3, 0xb3, 0xc8, - 0xfb, 0xfb, 0x2c, 0xf2, 0x7e, 0x3c, 0x8f, 0xd6, 0x9e, 0x9e, 0x47, 0x6b, 0x7f, 0x9c, 0x47, 0x6b, - 0xdf, 0xde, 0x59, 0xfa, 0x39, 0xfb, 0xe2, 0xe1, 0x83, 0x7b, 0x5f, 0x51, 0xf5, 0x58, 0xb4, 0x93, - 0x24, 0x1f, 0x13, 0xc6, 0x93, 0xef, 0xec, 0x57, 0x0c, 0x7e, 0xd6, 0x46, 0x5d, 0xf8, 0x3a, 0x7c, - 0xf4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x38, 0x7d, 0xd3, 0x35, 0xe0, 0x06, 0x00, 0x00, + // 920 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x26, 0x5b, 0x27, 0x7e, 0x6e, 0x8d, 0x18, 0x42, 0xbb, 0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x9a, 0xf7, 0xb0, 0xa1, 0x74, 0x1f, 0xda, 0xf5, 0x0c, 0x60, 0xbd, + 0x8f, 0x73, 0xcc, 0x12, 0x62, 0x29, 0xee, 0xc4, 0x4b, 0x88, 0xd5, 0x9e, 0x0f, 0x31, 0x02, 0x5b, + 0x63, 0xa2, 0xf7, 0x64, 0x91, 0xdc, 0x89, 0x46, 0x24, 0x58, 0xd7, 0x03, 0x78, 0x73, 0xd9, 0x00, + 0x96, 0x92, 0x28, 0xbe, 0x61, 0x73, 0x5d, 0xb6, 0x2e, 0x81, 0x75, 0xe3, 0xb9, 0x61, 0xe5, 0xb0, + 0xe3, 0x5a, 0xbe, 0x98, 0xd3, 0xb5, 0x5d, 0xd7, 0x6d, 0xbf, 0xb5, 0xac, 0xed, 0xff, 0xe2, 0x5d, + 0xbc, 0x6d, 0x53, 0x2e, 0x71, 0x50, 0x20, 0x2e, 0x3c, 0x18, 0xa0, 0x51, 0xa8, 0x8f, 0xdd, 0x13, + 0x71, 0xd8, 0x7d, 0x7c, 0xd6, 0xf2, 0x9e, 0x9c, 0xb5, 0xbc, 0xbf, 0xce, 0x5a, 0xde, 0xf7, 0xe7, + 0xad, 0x95, 0x27, 0xe7, 0xad, 0x95, 0xdf, 0xcf, 0x5b, 0x2b, 0x5f, 0xdf, 0x59, 0x58, 0xf9, 0x4f, + 0x1e, 0x3e, 0xb8, 0xf7, 0x19, 0x91, 0xa7, 0xbc, 0x1c, 0x45, 0xc9, 0x10, 0x53, 0x16, 0x7d, 0x63, + 0xff, 0x0d, 0xe8, 0xd5, 0xef, 0xd7, 0xf4, 0xaf, 0xec, 0x3b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, + 0xa9, 0xae, 0xc2, 0xd0, 0x28, 0x08, 0x00, 0x00, } func (m *BasicPool) Marshal() (dAtA []byte, err error) { @@ -643,11 +687,40 @@ func (m *FullStaker) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x22 + dAtA[i] = 0x42 + } + } + if len(m.ValidatorCommissionRewards) > 0 { + for iNdEx := len(m.ValidatorCommissionRewards) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ValidatorCommissionRewards[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } } - if m.TotalPoolStake != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.TotalPoolStake)) + if m.ValidatorTotalPoolStake != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ValidatorTotalPoolStake)) + i-- + dAtA[i] = 0x30 + } + if m.ValidatorUnbonding != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ValidatorUnbonding)) + i-- + dAtA[i] = 0x28 + } + if m.ValidatorSelfDelegation != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ValidatorSelfDelegation)) + i-- + dAtA[i] = 0x20 + } + if m.ValidatorDelegators != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ValidatorDelegators)) i-- dAtA[i] = 0x18 } @@ -926,8 +999,23 @@ func (m *FullStaker) Size() (n int) { l = m.Validator.Size() n += 1 + l + sovQuery(uint64(l)) } - if m.TotalPoolStake != 0 { - n += 1 + sovQuery(uint64(m.TotalPoolStake)) + if m.ValidatorDelegators != 0 { + n += 1 + sovQuery(uint64(m.ValidatorDelegators)) + } + if m.ValidatorSelfDelegation != 0 { + n += 1 + sovQuery(uint64(m.ValidatorSelfDelegation)) + } + if m.ValidatorUnbonding != 0 { + n += 1 + sovQuery(uint64(m.ValidatorUnbonding)) + } + if m.ValidatorTotalPoolStake != 0 { + n += 1 + sovQuery(uint64(m.ValidatorTotalPoolStake)) + } + if len(m.ValidatorCommissionRewards) > 0 { + for _, e := range m.ValidatorCommissionRewards { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } } if len(m.Pools) > 0 { for _, e := range m.Pools { @@ -1402,9 +1490,9 @@ func (m *FullStaker) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalPoolStake", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorDelegators", wireType) } - m.TotalPoolStake = 0 + m.ValidatorDelegators = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -1414,12 +1502,103 @@ func (m *FullStaker) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TotalPoolStake |= uint64(b&0x7F) << shift + m.ValidatorDelegators |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSelfDelegation", wireType) + } + m.ValidatorSelfDelegation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorSelfDelegation |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorUnbonding", wireType) + } + m.ValidatorUnbonding = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorUnbonding |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorTotalPoolStake", wireType) + } + m.ValidatorTotalPoolStake = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ValidatorTotalPoolStake |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorCommissionRewards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorCommissionRewards = append(m.ValidatorCommissionRewards, types.Coin{}) + if err := m.ValidatorCommissionRewards[len(m.ValidatorCommissionRewards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pools", wireType) } diff --git a/x/stakers/keeper/exported_functions.go b/x/stakers/keeper/exported_functions.go index 2fa1c8d6..94850695 100644 --- a/x/stakers/keeper/exported_functions.go +++ b/x/stakers/keeper/exported_functions.go @@ -48,7 +48,7 @@ func (k Keeper) GetAllStakerAddressesOfPool(ctx sdk.Context, poolId uint64) (sta } func (k Keeper) GetPaginatedStakersByPoolStake(ctx sdk.Context, pagination *query.PageRequest, stakerStatus querytypes.StakerStatus, accumulator func(validator string, accumulate bool) bool) (*query.PageResponse, error) { - validators, err := k.stakingKeeper.GetBondedValidatorsByPower(ctx) + validators, err := k.stakingKeeper.GetValidators(ctx, 1000) if err != nil { return nil, err } From 6a10c14e90c8b037617ee0f5f1574b7c63098649 Mon Sep 17 00:00:00 2001 From: ruzinata20 <138630083+ruzinata20@users.noreply.github.com> Date: Wed, 29 Jan 2025 10:55:47 +0200 Subject: [PATCH 13/13] chore(migration-proofs): Proxier (#235) --- app/upgrades/v2_0/validator-proofs/mainnet/Proxier.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/upgrades/v2_0/validator-proofs/mainnet/Proxier.json diff --git a/app/upgrades/v2_0/validator-proofs/mainnet/Proxier.json b/app/upgrades/v2_0/validator-proofs/mainnet/Proxier.json new file mode 100644 index 00000000..98bc967e --- /dev/null +++ b/app/upgrades/v2_0/validator-proofs/mainnet/Proxier.json @@ -0,0 +1,7 @@ +{ + "name": "Proxier", + "consensus_address": "kyvevaloper1jeytlpcq2w60hxpedl9yy0wa447zrr3dpg6ccp", + "protocol_address": "kyve1r5gvlzt03a0a9rks3s57cppmfqx2lzjr5pw5cv", + "proof_1": "E456242563993DCDCCAA78A0BE05AE850D12046785E08B43B584AE1DD43C9B8A", + "proof_2": "B8941CD7248A729649CC2AC4CDEC60D3570FF11E9EF1C2C308FC4228E1131DA1" +} \ No newline at end of file