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

crosschain: Use FindBallot in TSS voter #896

Closed
kingpinXD opened this issue Aug 1, 2023 · 2 comments
Closed

crosschain: Use FindBallot in TSS voter #896

kingpinXD opened this issue Aug 1, 2023 · 2 comments
Assignees
Labels
m:crosschain wontfix This will not be worked on

Comments

@kingpinXD
Copy link
Contributor

Replace the following piece of code with the FindBallot function.
` ballot, found := k.zetaObserverKeeper.GetBallot(ctx, index)
if !found {
var voterList []string

	for _, nodeAccount := range k.zetaObserverKeeper.GetAllNodeAccount(ctx) {
		voterList = append(voterList, nodeAccount.Operator)
	}
	ballot = observerTypes.Ballot{
		Index:                "",
		BallotIdentifier:     index,
		VoterList:            voterList,
		Votes:                observerTypes.CreateVotes(len(voterList)),
		ObservationType:      observerTypes.ObservationType_TSSKeyGen,
		BallotThreshold:      sdk.MustNewDecFromStr("1.00"),
		BallotStatus:         observerTypes.BallotStatus_BallotInProgress,
		BallotCreationHeight: ctx.BlockHeight(),
	}
}`
  • Find Ballot would need to be modified to accept ballot thresholds
  • Threshold for different types of ballots needs to maintained in the params
@lumtis
Copy link
Member

lumtis commented Aug 2, 2023

The observer list per chain is removed is it correct? Is the ObserverMapper structure still used?

Also I think this logic should be abstracted inside the observer keeper

for _, nodeAccount := range k.zetaObserverKeeper.GetAllNodeAccount(ctx) {
	voterList = append(voterList, nodeAccount.Operator)
}
voterList = k.zetaObserverKeeper.GetAllOperators()

I would also think we could have method NewBallot in observer keeper

func NewBallot(index string) Ballot {
  voterList = voterList = GetAllOperators()
  return Ballot{
		BallotIdentifier:     index,
		VoterList:            voterList,
		Votes:                observerTypes.CreateVotes(len(voterList)),
		ObservationType:      observerTypes.ObservationType_TSSKeyGen,
		BallotThreshold:      sdk.MustNewDecFromStr("1.00"),
		BallotStatus:        observerTypes.BallotStatus_BallotInProgress,
		BallotCreationHeight: ctx.BlockHeight(),
	}
}

Threshold for different types of ballots needs to maintained in the params

In the current implementation, we read from obsParams := k.GetParams(ctx).GetParamsForChain(chain), why changing it to sdk.MustNewDecFromStr("1.00"), do we also want to keep a unique one for all chains?

@fbac fbac self-assigned this Jul 12, 2024
@fbac fbac closed this as completed Jul 12, 2024
@fbac fbac closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2024
@fbac
Copy link
Contributor

fbac commented Jul 12, 2024

Closing this as won't fix, as the msg for vote TSS differs from the other messages, and does not carry ChainID, which makes it not possible to use FindBallot.

@fbac fbac added the wontfix This will not be worked on label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
m:crosschain wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants