Skip to content

Conversation

@zeegomo
Copy link
Contributor

@zeegomo zeegomo commented Mar 10, 2022

Define High Level Intermediate Representation (HIR) for voting entities in the Catalyst ecosystem.
This is intended as a high level description of the setup, which is not enough on its own to spin a blockchain, but it's slimmer, easier to understand and free from implementation constraints.
You can roughly read this as "voting_key will participate in this voting round with role voting_group and will have voting_power influence"

This builds on the concept of voting groups as described in input-output-hk/vit-servicing-station#198

This is an intermediate step in the proposed process of spinning up a blockchain from the raw mainnet snapshot.

Such process is planned to look as follow:

  • collect valid catalyst registrations (db-sync + Adrestia's voting tools)
  • collect valid representative registrations (TBD)
  • aggregate all registrations and produce a single set of participants in the voting event ( snapshot tool in this repo)
  • setup blockchain parameters (block0, ...) and spin up nodes (vitup)

Not sure if catalyst toolbox is actually the correct place to host this.

@zeegomo zeegomo force-pushed the define-voting-hir branch from c052c6f to 01e0450 Compare March 11, 2022 15:51
@zeegomo zeegomo force-pushed the define-voting-hir branch from 65c11a2 to bc768d0 Compare March 23, 2022 08:36
@zeegomo zeegomo force-pushed the define-voting-hir branch from 451b395 to c3af7b6 Compare April 6, 2022 15:49
@zeegomo zeegomo requested a review from a team April 11, 2022 11:38
@zeegomo zeegomo marked this pull request as ready for review April 11, 2022 11:38
/// key will be used.
pub voting_group: VotingGroup,
/// Voting power as processed by the snapshot
pub voting_power: Value,
Copy link
Contributor

Choose a reason for hiding this comment

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

Am I right that voting_power is referenced to the voting_key ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

/// You can roughly read this as
/// "voting_key will participate in this voting round with role voting_group and will have voting_power influence"
pub struct VotingHIR {
pub voting_key: Identifier,
Copy link
Contributor

@Mr-Leshiy Mr-Leshiy Apr 12, 2022

Choose a reason for hiding this comment

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

Is voting_key a user Identifier ? If so maybe it is better to rename it to users_voting_key to reflect that it belongs to user.
Otherwise I think we should provide a description for this field.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I mean, who should this voting key belong to otherwise? If we rename the struct to VoterHIR would this be clearer?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it looks better to me

pub struct VotingHIR {
pub voting_key: Identifier,
/// Voting group this key belongs to.
/// If this key belong to multiple voting groups, multiple records for the same
Copy link
Contributor

Choose a reason for hiding this comment

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

But why does not to store it inside an array if we have multiple records ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't get what you are suggesting

Copy link
Contributor

Choose a reason for hiding this comment

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

I am talking about to replace pub voting_group: VotingGroup, to the pub voting_group: Vec<VotingGroup>,, so to not create a one record for the voting_key

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but those voting groups might have different voting power, so you should also have a Vec of voting power, but then the relation between the two is not so tight anyway. Also, in the beginning we're probably only going to have one group per voter anyway, and this seems like the simplest solution to ma that is both not an overkill for now and flexible enough in the future.

///
/// You can roughly read this as
/// "voting_key will participate in this voting round with role voting_group and will have voting_power influence"
pub struct VoterHIR {
Copy link
Contributor

Choose a reason for hiding this comment

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

are we going to implement serde traits for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, even though we may want to serialize the voting key differently from the default bech32 encoding (e.g. hex). Maybe I should add some helper methods for that here

@zeegomo zeegomo force-pushed the define-voting-hir branch from 4496c51 to b3cc0df Compare April 14, 2022 10:22
@zeegomo
Copy link
Contributor Author

zeegomo commented Apr 19, 2022

superseded by #129

@zeegomo zeegomo closed this Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants