-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat(adr-032): Add ResumeFinalityProposal and handler #242
base: main
Are you sure you want to change the base?
Conversation
} | ||
|
||
func generateNFpPks(t *testing.T, r *rand.Rand, n int) []bbntypes.BIP340PubKey { | ||
fpPks := make([]bbntypes.BIP340PubKey, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fpPks := make([]bbntypes.BIP340PubKey, 0) | |
fpPks := make([]bbntypes.BIP340PubKey, 0, n) |
fpPks := make([]bbntypes.BIP340PubKey, len(fps.FinalityProviders)) | ||
for i, pkStr := range fps.FinalityProviders { | ||
pk, err := bbntypes.NewBIP340PubKeyFromHex(pkStr) | ||
if err != nil { | ||
return nil, fmt.Errorf("invalid finality provider public key %s: %w", pkStr, err) | ||
} | ||
fpPks[i] = *pk | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fpPks := make([]bbntypes.BIP340PubKey, len(fps.FinalityProviders)) | |
for i, pkStr := range fps.FinalityProviders { | |
pk, err := bbntypes.NewBIP340PubKeyFromHex(pkStr) | |
if err != nil { | |
return nil, fmt.Errorf("invalid finality provider public key %s: %w", pkStr, err) | |
} | |
fpPks[i] = *pk | |
} | |
fpPks := make([]bbntypes.BIP340PubKey, 0, len(fps.FinalityProviders)) // avoid wrangling indexes | |
for i, pkStr := range fps.FinalityProviders { | |
pk, err := bbntypes.NewBIP340PubKeyFromHex(pkStr) | |
if err != nil { | |
return nil, fmt.Errorf("invalid finality provider public key %s: %w", pkStr, err) | |
} | |
fpPks = append(fpPks, *pk) | |
} |
) | ||
|
||
// NewResumeFinalityProposalHandler is a handler for governance proposal on resume finality. | ||
func NewResumeFinalityProposalHandler(k keeper.Keeper) govtypesv1.Handler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm why usage of the old way of handling proposals ? (which I think is discouraged)
Wouldn't it be better to have separate message on finality provider message server which can be only executed by governance module ? (similar to parameters updates)
This PR introduces the
ResumeFinalityProposal
and implements the handler, which is part of ADR-32. This part is quite independent and the algorithm of choosing finality providers to jail can be implemented in the future