-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use json format for migration proofs
- Loading branch information
1 parent
1c80ec6
commit d34f50b
Showing
5 changed files
with
95 additions
and
59 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,31 @@ | ||
## Protocol-Consensus Validator Linking | ||
|
||
For the Shared Staking update [https://www.mintscan.io/kyve/proposals/43](https://www.mintscan.io/kyve/proposals/43) | ||
it is necessary that every validator links their protocol and consensus validator. | ||
|
||
All delegators are then transferred from the protocol validator to the consensus | ||
validator during the upgrade. | ||
|
||
If a protocol validator does not link to a chain validator before the upgrade is finalized, | ||
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. | ||
|
||
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" | ||
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. | ||
|
||
## Questions | ||
|
||
If you have any questions feel free to submit an issue or ask them directly while | ||
creating the pull-request. |
7 changes: 7 additions & 0 deletions
7
app/upgrades/v2_0/validator-proofs/kaon/example-validator.json
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": "My example Kaon validator name - this is just for human-readability", | ||
"consensus_address": "kyvevaloper...", | ||
"protocol_address": "kyve...", | ||
"proof_1": "89644D8598D007F7B744E91BA4490C11513860046C257F29CFAF41EAE37FAE9C", | ||
"proof_2": "36A1110532EC28C4BEDA610720CA31DD1B14D4A49772F8890EB5C62B417D253B" | ||
} |
7 changes: 7 additions & 0 deletions
7
app/upgrades/v2_0/validator-proofs/mainnet/example-validator.json
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": "My example validator name - this is just for human-readability", | ||
"consensus_address": "kyvevaloper...", | ||
"protocol_address": "kyve...", | ||
"proof_1": "EEA08DDDA94434BBE1FA25AB941B58D85FC5EE48E866B602549CA194CAB41B11", | ||
"proof_2": "21771F8B4B2F72D0F292F3517051FD6D8CAA5BB9EC83B906F2BF38684F1E624E" | ||
} |
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 |
---|---|---|
@@ -1,59 +1,49 @@ | ||
package v2_0 | ||
|
||
/* | ||
Protocol-Consensus Validator Linking: | ||
1. Fill out the entry below following the example. | ||
2. Send 1$KYVE from the protocol-address to the consensus-validator-operator address using the memo "Shared-Staking" | ||
and put the tx-hash in Proof1. | ||
3. Send 1$KYVE from the consensus-validator-operator address to the protocol address using the memo "Shared-Staking" | ||
and put the tx-hash in Proof2. | ||
4. Submit a Pull-Request to https://github.com/KYVENetwork/chain | ||
*/ | ||
import ( | ||
"embed" | ||
"encoding/json" | ||
"fmt" | ||
) | ||
|
||
//go:embed validator-proofs/* | ||
var validatorProofs embed.FS | ||
|
||
func init() { | ||
parseDirectory := func(directory string) []ValidatorMapping { | ||
dir, err := validatorProofs.ReadDir(directory) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
result := make([]ValidatorMapping, 0) | ||
for _, file := range dir { | ||
readFile, err := validatorProofs.ReadFile(fmt.Sprintf("%s/%s", directory, file.Name())) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
var proof ValidatorMapping | ||
if err = json.Unmarshal(readFile, &proof); err != nil { | ||
panic(err) | ||
} | ||
result = append(result, proof) | ||
} | ||
return result | ||
} | ||
|
||
ValidatorMappingsMainnet = parseDirectory("validator-proofs/mainnet") | ||
ValidatorMappingsKaon = parseDirectory("validator-proofs/kaon") | ||
} | ||
|
||
type ValidatorMapping struct { | ||
Name string | ||
ConsensusAddress string | ||
ProtocolAddress string | ||
Proof1 string | ||
Proof2 string | ||
Name string `json:"name"` | ||
ConsensusAddress string `json:"consensus_address"` | ||
ProtocolAddress string `json:"protocol_address"` | ||
Proof1 string `json:"proof_1"` | ||
Proof2 string `json:"proof_2"` | ||
} | ||
|
||
var ValidatorMappingsMainnet = []ValidatorMapping{ | ||
{ | ||
// human-readable name, only used for logging | ||
Name: "", | ||
// kyvevaloper... address of the chain node | ||
ConsensusAddress: "", | ||
// kyve... address of the protocol node | ||
ProtocolAddress: "", | ||
// Proof TX-Hash 1, transferring 1 $KYVE from the protocol-address to the operator address | ||
// using "Shared Staking" as memo. | ||
Proof1: "", | ||
// Proof TX-Hash 2, transferring 1 $KYVE from the operator address to the protocol-address | ||
// using "Shared Staking" as memo. | ||
Proof2: "", | ||
}, | ||
} | ||
var ValidatorMappingsMainnet []ValidatorMapping | ||
|
||
var ValidatorMappingsKaon = []ValidatorMapping{ | ||
{ | ||
// human-readable name, only used for logging | ||
Name: "", | ||
// kyvevaloper... address of the chain node | ||
ConsensusAddress: "", | ||
// kyve... address of the protocol node | ||
ProtocolAddress: "", | ||
// Proof TX-Hash 1, transferring 1 $KYVE from the protocol-address to the operator address | ||
// using "Shared Staking" as memo. | ||
Proof1: "", | ||
// Proof TX-Hash 2, transferring 1 $KYVE from the operator address to the protocol-address | ||
// using "Shared Staking" as memo. | ||
Proof2: "", | ||
}, | ||
} | ||
var ValidatorMappingsKaon []ValidatorMapping |