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

Remove Unnecessary Moniker Requirement and Enforce Username Setup for Councilors #671

Open
kmlbgn opened this issue May 28, 2024 · 0 comments
Assignees
Labels
invalid This doesn't seem right Priority: Medium x/gov Governance module

Comments

@kmlbgn
Copy link
Collaborator

kmlbgn commented May 28, 2024

Description

The current system logic mandates that councilors provide a unique moniker, even though not all councilors are validators. If a moniker is not provided when claiming the councilor seat, a default moniker is set. Since both the moniker and username must be unique, this logic is flawed. You can review the relevant code here:

identityInfo := []types.IdentityInfoEntry{}
if msg.Moniker != "" {
identityInfo = append(identityInfo, types.IdentityInfoEntry{
Key: "moniker",
Info: msg.Moniker,
})
}
if msg.Username != "" {
identityInfo = append(identityInfo, types.IdentityInfoEntry{
Key: "username",
Info: msg.Username,
})
}

Additionally, once a councilor seat is claimed, the user cannot change the username or moniker. This further compounds the issue with the existing logic. The relevant code can be found here:

_, found := k.GetCouncilor(ctx, address)
if found {
monikerRecordId := k.GetIdentityRecordIdByAddressKey(ctx, address, "moniker")
usernameRecordId := k.GetIdentityRecordIdByAddressKey(ctx, address, "username")
moniker := k.GetIdentityRecordById(ctx, monikerRecordId)
username := k.GetIdentityRecordById(ctx, usernameRecordId)
if infos[i].Key == "moniker" && moniker != nil && infos[i].Info != moniker.Value {
return types.ErrCouncilorMonikerNotAllowedToBeChanged
}
if infos[i].Key == "username" && username != nil && infos[i].Info != username.Value {
return types.ErrCouncilorUsernameNotAllowedToBeChanged
}
}

Expected Behavior

  1. Remove the moniker requirement for councilors since the moniker is only related to validator activity and not governance.
  2. No default value should be set for username if not provided. Claiming a seat without a username should fail; Councilors must set up their username prior to claiming a seat, it's their responsibility.
@kmlbgn kmlbgn added invalid This doesn't seem right x/gov Governance module Priority: Medium labels May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right Priority: Medium x/gov Governance module
Projects
None yet
Development

No branches or pull requests

2 participants