-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into cbrumm/merkle-bundles-migration
- Loading branch information
Showing
31 changed files
with
884 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "LiveRaveN", | ||
"consensus_address": "kyvevaloper13eduhc6ds4fvcatt8vj472rwkr5vvup79wnz2y", | ||
"protocol_address": "kyve13eduhc6ds4fvcatt8vj472rwkr5vvup7h7nzyx", | ||
"proof_1": "03A0651F91A42BCCEB31C1752B037C240C3CDB652FDD4B8C4217D0BCA3ACFE31", | ||
"proof_2": "03A0651F91A42BCCEB31C1752B037C240C3CDB652FDD4B8C4217D0BCA3ACFE31" | ||
} |
7 changes: 0 additions & 7 deletions
7
app/upgrades/v2_0/validator-proofs/kaon/example-validator.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "IONode Online", | ||
"consensus_address": "kyvevaloper186n5up4j80j02vpfrr9tq8cml3h2ju5uara3ye", | ||
"protocol_address": "kyve186n5up4j80j02vpfrr9tq8cml3h2ju5u0na32m", | ||
"proof_1": "6D33A0FE5544B73AED2492E5C4AB93CDF7418B021F52410736DE4FE12194F1E3", | ||
"proof_2": "DD7CE5C254297E57EFB89083CC345FAED20B992BD12AF2A613EA40DC9772BFF0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Lefey", | ||
"consensus_address": "kyvevaloper1w3etlejq78tn4vwmqhepzcl2a6zyth0wg4ae02", | ||
"protocol_address": "kyve1xccnldlwmgpq4hc855f3nzvshfl5nw7493c9l9", | ||
"proof_1": "B62F9BDC97739110624A170F953C4345888D8590A69EDDCA78E7CA33BF2D177F", | ||
"proof_2": "9E44B457568470274020E59A91D09E84BDC8222BDAFB5C1B84548BFE8BB5A844" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "LiveRaveN", | ||
"consensus_address": "kyvevaloper13eduhc6ds4fvcatt8vj472rwkr5vvup79wnz2y", | ||
"protocol_address": "kyve13eduhc6ds4fvcatt8vj472rwkr5vvup7h7nzyx", | ||
"proof_1": "CFFE09093C83A3525E9BC3A3BF76DCACD2EA034B19EED3043AE0ABA52559B3D9", | ||
"proof_2": "CFFE09093C83A3525E9BC3A3BF76DCACD2EA034B19EED3043AE0ABA52559B3D9" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "MELLIFERA", | ||
"consensus_address": "kyvevaloper13am3qms82sevhv9nv7z9jwfuffjsfqfum2dc2h", | ||
"protocol_address": "kyve1dsk7wfy6n2ylwj8x2el6txgsyff8av6wa5yl28", | ||
"proof_1": "9F636AD173DBB92C911E7E4230E43995F3E12A43FC20131EF7D9B64FB16B76E9", | ||
"proof_2": "5837D0555B087E4BBBCCBBC9B53323555891C3ABA232E8CBB6E969715026FC51" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Meria", | ||
"consensus_address": "kyvevaloper1hy44ra3hv8vf294fs49zqzykt9hpzegrse4epk", | ||
"protocol_address": "kyve1gqg64xv8uh8zvnym5qkavd882d67ks4ewhhrdf", | ||
"proof_1": "6DA7C83F1B18FE90268C79D414B1871BDD96FCC9720BDDF0333DA3A9E3B29DAC", | ||
"proof_2": "29DB08AAD05EF660BD75FE4EBDC869AB3A1686D2B2DFCC39B9F4EBE7CCEE22CE" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Nodes Hub 🛡️ 100% Slash Protected 🛡️", | ||
"consensus_address": "kyvevaloper1hvlarv7f2cyjd8y82f6dd6ue0v6xexsskdsxzn", | ||
"protocol_address": "kyve1hvlarv7f2cyjd8y82f6dd6ue0v6xexssyasxv3", | ||
"proof_1": "2D095EE9FFA025D97442B67C3758A479875A95C93EFBF70473AD00FB3F525522", | ||
"proof_2": "8FA9DCABA4310126505C0A7E0A82F4017341343F1D3989F93A6FA180A01D85BE" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "POSTHUMAN", | ||
"consensus_address": "kyvevaloper16hnse4c852xg4vxjnqhx648e02z32n72l66nv7", | ||
"protocol_address": "kyve16hnse4c852xg4vxjnqhx648e02z32n72d26nzu", | ||
"proof_1": "030342E61AFF1A24277936BE32EB8ECCAD364A4296DBC5CDE8270FCC7CAFC80F", | ||
"proof_2": "030342E61AFF1A24277936BE32EB8ECCAD364A4296DBC5CDE8270FCC7CAFC80F" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Pro-Nodes75", | ||
"consensus_address": "kyvevaloper18y8xcyecmuffkhexvqdpnqc3y7urh02u83ctx4", | ||
"protocol_address": "kyve129y2x3m9muxmg42ua5wjzquadclk2j3yy6ztkw", | ||
"proof_1": "152C4D15BD1941B4EF359487391C7210F6BE001E9C64C98102293434862B9A9B", | ||
"proof_2": "86C105E630D6C9F65960E3401A2B54AA38374FB21A407D2A4FDC71CE10FA78F2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "Proxier", | ||
"consensus_address": "kyvevaloper1jeytlpcq2w60hxpedl9yy0wa447zrr3dpg6ccp", | ||
"protocol_address": "kyve1r5gvlzt03a0a9rks3s57cppmfqx2lzjr5pw5cv", | ||
"proof_1": "E456242563993DCDCCAA78A0BE05AE850D12046785E08B43B584AE1DD43C9B8A", | ||
"proof_2": "B8941CD7248A729649CC2AC4CDEC60D3570FF11E9EF1C2C308FC4228E1131DA1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "STAVR", | ||
"consensus_address": "kyvevaloper16qwtkeadppy3u9z6pu9tuy8zq02u3vecun3s0d", | ||
"protocol_address": "kyve162ydfdt3j34cx9ndrajfsjxcf5e2hfuxqt49d0", | ||
"proof_1": "519B03D2F88CA680B395EC7D0DA306DAE816B92BAD0487DE76CA4363BAA5846E", | ||
"proof_2": "6CEC9CAE20E2BD131C59CCA5673CB836FB84F534F855FA3983C08F5E921F1B1A" | ||
} |
7 changes: 0 additions & 7 deletions
7
app/upgrades/v2_0/validator-proofs/mainnet/example-validator.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.