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

Extend Testgen to generate Validator sets #665

Open
andrey-kuprianov opened this issue Nov 9, 2020 · 2 comments
Open

Extend Testgen to generate Validator sets #665

andrey-kuprianov opened this issue Nov 9, 2020 · 2 comments
Assignees
Labels

Comments

@andrey-kuprianov
Copy link
Contributor

andrey-kuprianov commented Nov 9, 2020

After extending Tendermint Validator Set with the total_voting_power field, the model-based tests stopped to work.

The reason for that behavior is that validator sets are not first class citizens in the Testgen. Instead, when generating validator sets via Jsonatr transform, we map Testgen validator generation over the array of abstract validator identifiers, as produced by Apalache. This was ok, until total_voting_power, that requires treating Validator Set as a datastructure on its own.

The solution is as follows:

  • add ValidatorSet to Testgen, and generate it in the same way as all other datastructures.
  • add valset command to tendermint-testgen binary.
  • in the Jsonatr transform above, invoke tendermint_valset for the array of identifiers, instead of mapping the tendermint_validator.
@Shivani912
Copy link
Contributor

Thanks @andrey-kuprianov , we definitely need to make this improvement to Testgen. On a second thought, does it make sense to use validator::Set::new(validators, voting_power) instead of the old valset constructor since we do not currently make use of total_voting_power in Testgen apart from construction. I think it'll be easier to quickly unblock things this way.

@Shivani912 Shivani912 self-assigned this Nov 10, 2020
@thanethomson thanethomson added this to the v0.17.0 milestone Nov 19, 2020
@Shivani912 Shivani912 modified the milestones: v0.17.0, v0.18 Dec 3, 2020
@Shivani912
Copy link
Contributor

With #730, we have introduced the ValidatorSet to testgen and can be generated like other data structures. But, we still need to integrate it with other data structures (header, commit, etc.) - see this comment. Doing that will require both steps 2 & 3 to be implemented.

@thanethomson thanethomson removed this from the v0.19 milestone Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants