dymensionxyz / dymension-rdk

Framework for building highly scalable RollApps
Apache License 2.0
96 stars 53 forks source link

Bug: Unable to staking #232

Closed VictorTrustyDev closed 1 year ago

VictorTrustyDev commented 1 year ago

I got validator address from here

rollapp_evm --home ~/.roller/rollapp/ q sequencers sequencers

Which is ethmvaloper1k9uvtqy2d2vkjn22lvqeyapfn9mz37ls7urn3r

I tried to stake (amount equals 0.9 ETH)

rollapp_evm --home ~/.roller/rollapp/ --keyring-backend test tx staking delegate ethmvaloper1k9uvtqy2d2vkjn22lvqeyapfn9mz37ls7urn3r 900000000000000000uescan --from staker

I got tx error failed to execute message; message index: 0: validator does not exist. It said validator does not exists so I tried to query the sequencer again, it does exists:

rollapp_evm --home ~/.roller/rollapp/ q sequencers sequencer ethmvaloper1k9uvtqy2d2vkjn22lvqeyapfn9mz37ls7urn3r
sequencer:
  commission:
    commission_rates:
      max_change_rate: "0.000000000000000000"
      max_rate: "0.000000000000000000"
      rate: "0.000000000000000000"
    update_time: "1970-01-01T00:00:00Z"
  consensus_pubkey:
    '@type': /cosmos.crypto.ed25519.PubKey
    key: 1GU5eqz7L2yJHLuqCH+G3/UeNd0NgQf+HVOmnwR3f0s=
  delegator_shares: "0.000000000000000000"
  description:
    details: ""
    identity: ""
    moniker: ""
    security_contact: ""
    website: ""
  jailed: false
  min_self_delegation: "1"
  operator_address: ethmvaloper1k9uvtqy2d2vkjn22lvqeyapfn9mz37ls7urn3r
  status: BOND_STATUS_BONDED
  tokens: "1000000000000000000"
  unbonding_height: "0"
  unbonding_time: "1970-01-01T00:00:00Z"
VictorTrustyDev commented 1 year ago

One out-topic suggestion:

Based on @mtsitrin answer here

I think you should wrap the staking module and override methods so rollapp can returns set of validators when query smt like rollapp_evm q staking validators (it returns empty atm). Why? It is easier for existing apps to integrate with your products (and your users's production) without modifying much. For example if a block explorer wants to query validators set of a roll app, it has to custom query to adapt.


An additional question: by removal of slashing module, how can we know a validator/sequencer uptime? Because validator can be slash due to downtime or violating double sign rule,... and the number has been calculated from signing info & slashing params.

mtsitrin commented 1 year ago

Hi @VictorTrustyDev You've tried to delegate to a sequencer (i.e sequencer module, defined on Dymension Hub), instead of a staker (i.e staking module)

You can create a validator using tx staking create-validator ... then u will be able to delegate to it

We did the separation of the modules on purpose. Sequencers are for block production, based on the sequencer registered on the Hub Stakers are for "power management" on the rollapp, based on bond on the rollapp

regarding the uptime, it can be correlated from the settlement on the Hub

VictorTrustyDev commented 1 year ago

I see, let me try it again. Tysm