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

minimum staking amounts not explained in tutorial (formerly "stake is the only denomination that works for delegating") #168

Closed
tuckermint opened this issue Oct 18, 2019 · 8 comments
Labels
S:question Status: Question, Further information is requested

Comments

@tuckermint
Copy link

Hi,

I tried to use this tutorial to make a chain with only one token.

First, I changed bond_denom in genesis.json to tuckeratom.
Then, I gave all of the genesis accounts 1000 tuckeratom.
Finally, I made a gentx using --amount 1000tuckeratom.

I collected the gentx and validated the genesis.json, everything looked normal.
But when I run nsd, I get "ERROR: error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain"

This error does not appear if I use stake as the bond_denom and do the default gentx with 100000000stake.

But if I use stake as the bond_denom, I can't delegate tuckeratoms.

Has non-stake delegation worked for anyone else?

Thanks

@tuckermint
Copy link
Author

@marbar3778 are you the lead dev for the tutorial?

@tac0turtle
Copy link
Member

Just a guy who try's to maintain it, but suppose to be mainly on tendermint, I'm flying tomorrow so will debug this on the plane

@tac0turtle
Copy link
Member

tac0turtle commented Oct 23, 2019

I tested it out and was able to get it running with denom: legends, here is my genesis:

{
  "genesis_time": "2019-10-23T21:49:05.842914Z",
  "chain_id": "test",
  "consensus_params": {
    "block": {
      "max_bytes": "22020096",
      "max_gas": "-1",
      "time_iota_ms": "1000"
    },
    "evidence": {
      "max_age": "100000"
    },
    "validator": {
      "pub_key_types": [
        "ed25519"
      ]
    }
  },
  "app_hash": "",
  "app_state": {
    "distribution": {
      "fee_pool": {
        "community_pool": []
      },
      "community_tax": "0.020000000000000000",
      "base_proposer_reward": "0.010000000000000000",
      "bonus_proposer_reward": "0.040000000000000000",
      "withdraw_addr_enabled": true,
      "delegator_withdraw_infos": [],
      "previous_proposer": "",
      "outstanding_rewards": [],
      "validator_accumulated_commissions": [],
      "validator_historical_rewards": [],
      "validator_current_rewards": [],
      "delegator_starting_infos": [],
      "validator_slash_events": []
    },
    "params": null,
    "nameservice": {
      "whois_records": []
    },
    "supply": {
      "supply": []
    },
    "staking": {
      "params": {
        "unbonding_time": "1814400000000000",
        "max_validators": 100,
        "max_entries": 7,
        "bond_denom": "legends"
      },
      "last_total_power": "0",
      "last_validator_powers": null,
      "validators": null,
      "delegations": null,
      "unbonding_delegations": null,
      "redelegations": null,
      "exported": false
    },
    "genutil": {
      "gentxs": [
        {
          "type": "cosmos-sdk/StdTx",
          "value": {
            "msg": [
              {
                "type": "cosmos-sdk/MsgCreateValidator",
                "value": {
                  "description": {
                    "moniker": "as2",
                    "identity": "",
                    "website": "",
                    "details": ""
                  },
                  "commission": {
                    "rate": "0.100000000000000000",
                    "max_rate": "0.200000000000000000",
                    "max_change_rate": "0.010000000000000000"
                  },
                  "min_self_delegation": "1",
                  "delegator_address": "cosmos1gc329pwdwnjv4zvphe8jmahxd3rr5xe33u9vjy",
                  "validator_address": "cosmosvaloper1gc329pwdwnjv4zvphe8jmahxd3rr5xe35g3e7h",
                  "pubkey": "cosmosvalconspub1zcjduepqcdpj75cklk47j6sfkzrk4hf7z7nl33w6kmv4spxlza8ctku6aklslgz225",
                  "value": {
                    "denom": "legends",
                    "amount": "100000000"
                  }
                }
              }
            ],
            "fee": {
              "amount": [],
              "gas": "200000"
            },
            "signatures": [
              {
                "pub_key": {
                  "type": "tendermint/PubKeySecp256k1",
                  "value": "AyNo0ZihyGIfpaZlQxY4t4spQtas0BIY6Zr8vp8XR33l"
                },
                "signature": "LU8SyBHJwZ2zPfRRcNd9GTMpbnI7etkBfxolUzoLz7RVe9SV1vbKNEabIOnGjVsqRyreYuRkhHs16WDg96lyaQ=="
              }
            ],
            "memo": "6c89a014fd9c20471762bf38f39ca9f3953dae22@192.168.43.83:26656"
          }
        }
      ]
    },
    "bank": {
      "send_enabled": true
    },
    "auth": {
      "params": {
        "max_memo_characters": "256",
        "tx_sig_limit": "7",
        "tx_size_cost_per_byte": "10",
        "sig_verify_cost_ed25519": "590",
        "sig_verify_cost_secp256k1": "1000"
      }
    },
    "accounts": [
      {
        "address": "cosmos1gc329pwdwnjv4zvphe8jmahxd3rr5xe33u9vjy",
        "coins": [
          {
            "denom": "legends",
            "amount": "1000000000"
          },
          {
            "denom": "stake",
            "amount": "100000000"
          }
        ],
        "sequence_number": "0",
        "account_number": "0",
        "original_vesting": [],
        "delegated_free": [],
        "delegated_vesting": [],
        "start_time": "0",
        "end_time": "0",
        "module_name": "",
        "module_permissions": [
          ""
        ]
      }
    ],
    "slashing": {
      "params": {
        "max_evidence_age": "120000000000",
        "signed_blocks_window": "100",
        "min_signed_per_window": "0.500000000000000000",
        "downtime_jail_duration": "600000000000",
        "slash_fraction_double_sign": "0.050000000000000000",
        "slash_fraction_downtime": "0.010000000000000000"
      },
      "signing_infos": {},
      "missed_blocks": {}
    }
  }
}

@tuckermint
Copy link
Author

tuckermint commented Oct 23, 2019

If I start the chain with your genesis.json, then switch to mine, it will run.
If I start from scratch with mine, I get the error.

Here is my genesis.json:

 {
  "genesis_time": "2019-10-23T23:04:11.151862481Z",
  "chain_id": "tuckermint",
  "consensus_params": {
    "block": {
      "max_bytes": "22020096",
      "max_gas": "-1",
      "time_iota_ms": "1000"
    },
    "evidence": {
      "max_age": "100000"
    },
    "validator": {
      "pub_key_types": [
        "ed25519"
      ]
    }
  },
  "app_hash": "",
  "app_state": {
    "nameservice": {
      "whois_records": []
    },
    "params": null,
    "slashing": {
      "params": {
        "max_evidence_age": "120000000000",
        "signed_blocks_window": "100",
        "min_signed_per_window": "0.500000000000000000",
        "downtime_jail_duration": "600000000000",
        "slash_fraction_double_sign": "0.050000000000000000",
        "slash_fraction_downtime": "0.010000000000000000"
      },
      "signing_infos": {},
      "missed_blocks": {}
    },
    "supply": {
      "supply": []
    },
    "auth": {
      "params": {
        "max_memo_characters": "256",
        "tx_sig_limit": "7",
        "tx_size_cost_per_byte": "10",
        "sig_verify_cost_ed25519": "590",
        "sig_verify_cost_secp256k1": "1000"
      }
    },
    "staking": {
      "params": {
        "unbonding_time": "1814400000000000",
        "max_validators": 100,
        "max_entries": 7,
        "bond_denom": "tuckeratom"
      },
      "last_total_power": "0",
      "last_validator_powers": null,
      "validators": null,
      "delegations": null,
      "unbonding_delegations": null,
      "redelegations": null,
      "exported": false
    },
    "bank": {
      "send_enabled": true
    },
    "accounts": [
      {
        "address": "cosmos168458gmg62hjxmhkc2va9alu6pyzdclkctw998",
        "coins": [
          {
            "denom": "stake",
            "amount": "100000000"
          },
          {
            "denom": "tuckeratom",
            "amount": "1000"
          }
        ],
        "sequence_number": "0",
        "account_number": "0",
        "original_vesting": [],
        "delegated_free": [],
        "delegated_vesting": [],
        "start_time": "0",
        "end_time": "0",
        "module_name": "",
        "module_permissions": [
          ""
        ]
      }
    ],
    "genutil": {
      "gentxs": [
        {
          "type": "cosmos-sdk/StdTx",
          "value": {
            "msg": [
              {
                "type": "cosmos-sdk/MsgCreateValidator",
                "value": {
                  "description": {
                    "moniker": "tuckermint",
                    "identity": "",
                    "website": "",
                    "details": ""
                  },
                  "commission": {
                    "rate": "0.100000000000000000",
                    "max_rate": "0.200000000000000000",
                    "max_change_rate": "0.010000000000000000"
                  },
                  "min_self_delegation": "1",
                  "delegator_address": "cosmos168458gmg62hjxmhkc2va9alu6pyzdclkctw998",
                  "validator_address": "cosmosvaloper168458gmg62hjxmhkc2va9alu6pyzdclkal6sf5",
                  "pubkey": "cosmosvalconspub1zcjduepqclsepjt0t0zmm7p3g9wvcx3zctc24rv7v9dw462ejh85nayea6js4rmh4v",
                  "value": {
                    "denom": "tuckeratom",
                    "amount": "1000"
                  }
                }
              }
            ],
            "fee": {
              "amount": [],
              "gas": "200000"
            },
            "signatures": [
              {
                "pub_key": {
                  "type": "tendermint/PubKeySecp256k1",
                  "value": "A2yKKKK/MUb6xbyCjpl7sDTdAOnCT5ZADTpwxZy4CW1B"
                },
                "signature": "DIFNxHLHV3b+MuxYtvQJ/mATMdPiHj0FtNDXue7QVu0uo1lZisrKyfg6qQd/GeF4UBH1NR3CofzOjyyaKQDTHA=="
              }
            ],
            "memo": "f15b62f120a1a3b56e5658c655f7a7d485e5c93f@192.168.2.3:26656"
          }
        }
      ]
    },
    "distribution": {
      "fee_pool": {
        "community_pool": []
      },
      "community_tax": "0.020000000000000000",
      "base_proposer_reward": "0.010000000000000000",
      "bonus_proposer_reward": "0.040000000000000000",
      "withdraw_addr_enabled": true,
      "delegator_withdraw_infos": [],
      "previous_proposer": "",
      "outstanding_rewards": [],
      "validator_accumulated_commissions": [],
      "validator_historical_rewards": [],
      "validator_current_rewards": [],
      "delegator_starting_infos": [],
      "validator_slash_events": []
    }
  }
}

@tac0turtle
Copy link
Member

I have to double check but it seems the amount Isnt great enough, can you put a couple 0's I think min_self delegation looks at 1 while bond amount is 1/1000 th

@tac0turtle tac0turtle added the S:question Status: Question, Further information is requested label Oct 24, 2019
@tuckermint tuckermint changed the title stake is the only denomination that works for delegating minimum staking amounts not explained in tutorial (formerly "stake is the only denomination that works for delegating") Oct 24, 2019
@tuckermint
Copy link
Author

It worked with 100000000 tuckeratom.

Is the minimum amount explained in the tutorial anywhere?

If not, I guess it should be added to this part: https://github.com/cosmos/sdk-application-tutorial/blob/master/tutorial/build-run.md#running-the-live-network-and-using-the-commands

Especially since the nametoken amounts are lower than the threshold, so someone trying to test out staking with nametokens would run into this error.

--

I see here that min-self-delegation of 1 means 1000000uatom on mainnet: https://cosmos.network/docs/cosmos-hub/validators/validator-setup.html#create-your-validator

Is there a way I can define utuckeratom to be 1/1000000 of a tuckeratom?
Or is any custom token treated as the smallest unit of a larger, undefined token?

@alexanderbez
Copy link
Contributor

@tac0turtle
Copy link
Member

tac0turtle commented Dec 27, 2019

closing this issue, if there any further questions, please comment and ill be notified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:question Status: Question, Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants