Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

genesis: accounts & txs #303

Merged
merged 10 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 98 additions & 2 deletions networks/testnets/raspi/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,48 @@
"pub_key": null,
"account_number": "0",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "eve18p4wl3hss9e9wv264yklyjp700kn8uazvwwxyy",
"pub_key": null,
"account_number": "1",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "eve18r27aslqyuk3wsmaqqq9l4lyd6c0dach4y9lxd",
"pub_key": null,
"account_number": "2",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "eve1wrns6kdtxql3rstkk7mx8f4v49tal3dzsptfr7",
"pub_key": null,
"account_number": "3",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "eve1yy4u2ap6zl95tsvg36k3datly7ctek05w22g7h",
"pub_key": null,
"account_number": "4",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "eve1l6qf3pdxe8rrr8ak8lt9ypff66s3rhuaphvc2c",
"pub_key": null,
"account_number": "5",
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"address": "eve1l732ry6k3zrf5jre96c0jmy5mdjvddpumutqqe",
"pub_key": null,
"account_number": "6",
"sequence": "0"
}
]
},
Expand All @@ -37,6 +79,15 @@
"default_send_enabled": true
},
"balances": [
{
"address": "eve18p4wl3hss9e9wv264yklyjp700kn8uazvwwxyy",
"coins": [
{
"denom": "ueve",
"amount": "100000000000000"
}
]
},
{
"address": "eve16hpk4083nxajqhuc3rh9lvxpw6rz8z60ra3sem",
"coins": [
Expand All @@ -45,12 +96,57 @@
"amount": "100000000000000"
}
]
},
{
"address": "eve18r27aslqyuk3wsmaqqq9l4lyd6c0dach4y9lxd",
"coins": [
{
"denom": "ueve",
"amount": "100000000000000"
}
]
},
{
"address": "eve1wrns6kdtxql3rstkk7mx8f4v49tal3dzsptfr7",
"coins": [
{
"denom": "ueve",
"amount": "100000000000000"
}
]
},
{
"address": "eve1yy4u2ap6zl95tsvg36k3datly7ctek05w22g7h",
"coins": [
{
"denom": "ueve",
"amount": "100000000000000"
}
]
},
{
"address": "eve1l6qf3pdxe8rrr8ak8lt9ypff66s3rhuaphvc2c",
"coins": [
{
"denom": "ueve",
"amount": "100000000000000"
}
]
},
{
"address": "eve1l732ry6k3zrf5jre96c0jmy5mdjvddpumutqqe",
"coins": [
{
"denom": "ueve",
"amount": "100000000000000"
}
]
}
],
"supply": [
{
"denom": "ueve",
"amount": "100000000000000"
"amount": "700000000000000"
}
],
"denom_metadata": [],
Expand Down Expand Up @@ -379,4 +475,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"iliyanbachiyski","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"","validator_address":"evevaloper1wrns6kdtxql3rstkk7mx8f4v49tal3dz3fhaze","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"71KqC7VMlbLvY2Q+2T95EtLEM0QmcmgOLmScGwkVb0Q="},"value":{"denom":"ueve","amount":"10000000000000"}}],"memo":"[email protected]:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AyugAVonfqGYfIHmp9eggfNElnA5ziEns/eOTvSYAQb/"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["jGgW/wSw6T4S8AQ3UicWCGx85sM4mMW2YO4K4cIxoKkyfkN1JHBY8VPrSx6gKrv/2r5Iim/nK5VCEN0oAmt2xA=="]}

Check failure

Code scanning / devskim

A token or key was found in source code. If this represents a secret, it should be moved somewhere else. Error test

Do not store tokens or keys in source code.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"vladimirtrifonov","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.069420000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"","validator_address":"evevaloper18r27aslqyuk3wsmaqqq9l4lyd6c0dach5vet82","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"NpFYcaTifPwiYVaUC6xCa9fDCpp2qbc1I2hg7m4PKmo="},"value":{"denom":"ueve","amount":"10000000000000"}}],"memo":"[email protected]:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"Ato5x5j4N2ZohrVFlhuTMVmnxUdWMqB3STBV3QhOhTgR"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["Q+YODL55yAigOjAE1ShBEw0F79yPaeSOKaB9pe5cdXBDHBlSzkr9NjUyrKN+mapX2crXz8WbqkHy1Oisr3O+MA=="]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix critical configuration issues in validator setup

There are several critical issues in the validator configuration:

  1. The memo contains a private IP address (192.168.0.82) which won't be accessible by other nodes
  2. The delegator_address field is empty, which will cause transaction failure

Please update the configuration with:

  1. A public IP address or DNS name for your validator node
  2. Your delegator address that will be used for the initial delegation
🧰 Tools
🪛 Gitleaks (8.21.2)

1-1: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1-1: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 checkov (3.2.312)

[HIGH] 1-2: IBM Cloud IAM Key

(CKV_SECRET_7)


💡 Codebase verification

Based on the gathered information, I can now provide a final response:

The delegation amount is significantly higher than the recommended amount

The gentx amount of 10,000,000,000,000 ueve (10M EVE) is much higher than the recommended amount from the genesis instructions, which specifies using 1,000,000 ueve for self-delegation. Other gentx files show the same high amount, but this appears to be incorrect as:

  • Genesis instructions explicitly state to fund accounts with 1,000,000,000 ueve and use 1,000,000 ueve for self-delegation
  • The total supply shown in genesis is 200,000,000,000,000 ueve, making this delegation amount (10M EVE) too large for a single validator

Please adjust your delegation amount to 1,000,000 ueve as specified in the genesis instructions.

🔗 Analysis chain

Verify the delegation amount against network parameters

The delegation amount of 10,000,000,000,000 ueve needs verification against network parameters to ensure it doesn't exceed maximum allowed stake or total supply.


Let me gather more information about the network parameters and other gentx files to make a complete assessment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check genesis file for total supply and other validator's delegation amounts

# Find and check genesis.json file
fd -t f "genesis.json" -x cat {} | jq -r '.app_state.bank.supply[] | select(.denom=="ueve") | .amount'

# Check other gentx files for delegation amounts
fd -t f "gentx-*.json" -x jq -r '.body.messages[0].value.amount' {}

Length of output: 226


Script:

#!/bin/bash
# Check all gentx files in the directory for their delegation amounts
find . -name "gentx-*.json" -exec cat {} \; | jq -r '.body.messages[0].value.amount'

# Check if there are any network parameter files that might define staking limits
fd -t f "config.toml|app.toml|params.toml" --exec cat {}

# Look for any documentation files that might contain network parameters
fd -t f "README.md|NETWORK.md|PARAMETERS.md" --exec cat {}

Length of output: 5179

🧰 Tools
🪛 Gitleaks (8.21.2)

1-1: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


1-1: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 checkov (3.2.312)

[HIGH] 1-2: IBM Cloud IAM Key

(CKV_SECRET_7)

Check failure

Code scanning / devskim

A token or key was found in source code. If this represents a secret, it should be moved somewhere else. Error test

Do not store tokens or keys in source code.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"lol","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.042069900000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"","validator_address":"evevaloper18p4wl3hss9e9wv264yklyjp700kn8uazdxjj9r","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"KvRZdsJqIckq7eqZDZwejabRtqGuaClVAa2zXsjB9Zk="},"value":{"denom":"ueve","amount":"10000000000000"}}],"memo":"[email protected]:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A/TFoIoCHY57GSzKLKRfq2XwbNujwGmvzXacyIAia4Ab"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["qGzGtfwk2d1Y9dUY0HHUHzwy1c+FS8GT7ZQRYgQut98tJaqCQiR/7T/eGpCsSTFq8uQdNGzM6o9kS3tStYeCcw=="]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical: Fix delegation configuration

Several critical issues in the delegation setup:

  1. Empty delegator_address field must be filled
  2. min_self_delegation of "1" is too low for a production validator

Recommendations:

  1. Add your delegator address
  2. Set a meaningful min_self_delegation amount (e.g., "1000000000" ueve) to demonstrate commitment to the network
🧰 Tools
🪛 Gitleaks (8.21.2)

1-1: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


⚠️ Potential issue

Update node address configuration

The node address (192.168.0.170) is a private IP address that won't be accessible to other nodes in the network. Update this to your public endpoint before submitting the gentx.

Example:

-"[email protected]:26656"
+"9486066c4712c00a7cab5f7b188fff4c978fb9e7@public.validator.example.com:26656"

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Gitleaks (8.21.2)

1-1: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"body": {
"messages": [
{
"@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
"description": {
"moniker": "viktort",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
},
"commission": {
"rate": "0.100000000000000000",
"max_rate": "0.200000000000000000",
"max_change_rate": "0.010000000000000000"
},
Comment on lines +13 to +17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Commission rate exceeds maximum rate in multiple validators

Critical issue found: Several validators have set their initial commission rate to 42.0699%, which exceeds their maximum rate of 20%. This is an invalid configuration that will cause validator creation to fail.

Affected validators:

  • Rate: 42.0699%, Max Rate: 20% (found in 3 gentx files)
  • Rate: 6.942%, Max Rate: 20% (found in 2 gentx files)
  • Rate: 10%, Max Rate: 20% (found in 1 gentx file)

The initial commission rate must be less than or equal to the maximum rate. The validators with 42.0699% initial rate need to adjust their configuration.

🔗 Analysis chain

Verify commission rate configuration aligns with network economics.

The commission configuration is immutable after validator creation. Current settings:

  • Initial rate: 10%
  • Maximum rate: 20%
  • Maximum daily increase: 1%

The maximum rate of 20% might be restrictive for future adjustments. Consider if this aligns with the network's long-term economic model.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check other validators' commission configurations for consistency
fd -t f 'gentx-.*\.json' networks/testnets/raspi/gentx --exec jq -r '.body.messages[0].commission | "Rate: \(.rate), Max Rate: \(.max_rate), Max Change Rate: \(.max_change_rate)"'

Length of output: 769

"min_self_delegation": "1",
"delegator_address": "",
"validator_address": "evevaloper1l6qf3pdxe8rrr8ak8lt9ypff66s3rhuaqlsvtl",
Comment on lines +18 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical: Missing delegator address and insufficient minimum self delegation.

Two critical issues found:

  1. The delegator_address field is empty, which will cause the transaction to fail
  2. The min_self_delegation of "1" is extremely low. Consider setting a higher value to demonstrate skin in the game and prevent validator hopping.

"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "vaTDdMhC3/7Eg1DIgYOtBkhQGuirGc+ZgZGWHDqJDwA="
},
"value": {
"denom": "ueve",
"amount": "10000000000000"
}
}
],
"memo": "[email protected]:26656",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Critical: Invalid node address in memo field.

The memo contains a private network IP address (192.168.0.78) which won't be accessible to other nodes on the network. Please update this to a public IP address or domain name.

"timeout_height": "0",
"extension_options": [],
"non_critical_extension_options": []
},
"auth_info": {
"signer_infos": [
{
"public_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key": "A4AhH4t80k8CZs+oS5Xse5mO7OBWWWrxSZkgvd3y/Kw5"
},
"mode_info": {
"single": {
"mode": "SIGN_MODE_DIRECT"
}
},
"sequence": "0"
}
],
"fee": {
"amount": [],
"gas_limit": "200000",
"payer": "",
"granter": ""
},
"tip": null
},
"signatures": [
"cTQrdsM5xaOFr+8jpxJ66+mtn427nnvlkoKpbmJYg6BxFpcZkHZUaltpgR1tZSsB9ryFaORVTJOfw/URNHeCcg=="
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"body": {
"messages": [
{
"@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
"description": {
"moniker": "radopi",
"identity": "",
"website": "",
"security_contact": "",
"details": ""
},
"commission": {
"rate": "0.420699000000000000",
"max_rate": "0.200000000000000000",
"max_change_rate": "0.010000000000000000"
},
"min_self_delegation": "1",
"delegator_address": "",
"validator_address": "evevaloper1yy4u2ap6zl95tsvg36k3datly7ctek050zkuls",
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "dN36Zs6/ichqZg/QvrRwiFvfDsBZIlUUePNapMnQmOw="
},
"value": {
"denom": "ueve",
"amount": "10000000000000"
}
}
],
"memo": "[email protected]:26656",
"timeout_height": "0",
"extension_options": [],
"non_critical_extension_options": []
},
"auth_info": {
"signer_infos": [
{
"public_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key": "AgYDnzgNC4407y9pxgRP5QOm4/QWhx/6pOmr4K7EnRiH"
},
"mode_info": {
"single": {
"mode": "SIGN_MODE_DIRECT"
}
},
"sequence": "0"
}
],
"fee": {
"amount": [],
"gas_limit": "200000",
"payer": "",
"granter": ""
},
"tip": null
},
"signatures": [
"SLhcbNL5S+y80vaf8fhzGTMs7InW0P2SUkO8m7auYtR+iTYXrKoqJfwP1mlosv9R5haRwT1XqpTA6VPJ0tZAEw=="
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"tuga","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"","validator_address":"evevaloper1l732ry6k3zrf5jre96c0jmy5mdjvddpu65h5p7","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"fpYtN2Y6/BiT73duDs6NXBOnXgRz1dMrpEFf+F+P1B8="},"value":{"denom":"ueve","amount":"10000000000000"}}],"memo":"[email protected]:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A+cXoTUypYotoi2gEaOjEWMn4JRPDouXwlcVigIiMqjE"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["VGixvwF/LoHHKj7F/YTU4G3uT+WxW9uy6YFH9a5jHGkwBPt50loCcAOV8IDHoNTHb+zPbOYjYHCM9prQyPz20Q=="]}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Potential issue

Critical: Empty delegator addresses in all gentx files

All gentx files in the repository have empty delegator addresses, which is a systemic issue. The delegator address is a mandatory field that must be set to the address derived from the signer's public key for each validator. This will cause all transactions to fail.

  • Found 7 gentx files, all with missing delegator addresses
  • Each file has a validator address set but the corresponding delegator address is empty
🔗 Analysis chain

Critical: Missing delegator address

The delegator_address field is empty, which will cause the transaction to fail. This address is required and should match the address derived from the signer's public key.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if this is a pattern in other gentx files
rg -l "delegator_address" | xargs jq -r '.body.messages[0].delegator_address' | grep -c '^$'

Length of output: 94


Script:

#!/bin/bash
# Let's check all gentx files to see the pattern of empty delegator addresses
rg -l "delegator_address" | xargs jq -r '[.body.messages[0].delegator_address, .body.messages[0].validator_address] | @tsv'

Length of output: 482

Check failure

Code scanning / devskim

A token or key was found in source code. If this represents a secret, it should be moved somewhere else. Error test

Do not store tokens or keys in source code.
Loading