You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the ValidateValidatorParams function does not check the pubkey type.
So, no error is returned even if an illegal pubkey type is passed as param.
Problem Definition
funcValidateValidatorParams(iinterface{}) error {
v, ok:=i.(ocproto.ValidatorParams)
if!ok {
returnfmt.Errorf("invalid parameter type: %T", i)
}
iflen(v.PubKeyTypes) ==0 {
returnerrors.New("validator allowed pubkey types must not be empty")
}
returnnil
}
In the above function, only the length of v.PubKeyTypes is checked, not whether the contents are allowed or not.
Summary
Currently, the ValidateValidatorParams function does not check the pubkey type.
So, no error is returned even if an illegal pubkey type is passed as param.
Problem Definition
In the above function, only the length of v.PubKeyTypes is checked, not whether the contents are allowed or not.
the test is passing despite the pubkey type that is not allowed in the above test.
Proposal
Add check that allowed pubkey types are correct.
For Admin Use
The text was updated successfully, but these errors were encountered: