Cosmos-sdk: Simulation: Use Consensus Params

Created on 13 Apr 2020  Â·  2Comments  Â·  Source: cosmos/cosmos-sdk

Summary

The InitChain request in initChain function call during simulation does not contain any consensus parameters (block, evidence, and validator).

Problem Definition

To improve the soundness and breadth of coverage in simulation, the simulator should account for and include consensus parameters in the initChain function call.

Proposal

Include consensus parameters in the initChain function call. Block and Validator parameters should be straightforward to generate - they can be randomly generated within a range as the initChain function already accepts an *rand.Rand argument.

However, the evidence parameters should be based on the trusting period (i.e. unbonding period) which resides in the app state defined in x/staking. Since app state is also already provided as an argument to initChain, we can decode and find the value.

/cc @fedekunze


For Admin Use

  • [x] Not duplicate issue
  • [x] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
simulation

Most helpful comment

@jgimeno if you want to start exploring how the simulator works, this would be a good issue to pick up and tackle ;-)

All 2 comments

@jgimeno if you want to start exploring how the simulator works, this would be a good issue to pick up and tackle ;-)

I agree, @jgimeno this'd be quite a learning experience. Go ahead please

Was this page helpful?
0 / 5 - 0 ratings