-
Notifications
You must be signed in to change notification settings - Fork 24
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
Simplify Message Containers #455
Comments
See: ssv-spec/ssv/partial_sig_container.go Lines 14 to 19 in ccf408d
|
Looking at this code for a while, I think although it it not good looking, it is a reasonable implementation. If we want to get rid of the nested map we can use a list of type PartialSignatureMessage struct {
PartialSignature Signature `ssz-size:"96"` // The Beacon chain partial Signature for a duty
SigningRoot [32]byte `ssz-size:"32"` // the root signed in PartialSignature
Signer OperatorID
ValidatorIndex phase0.ValidatorIndex
} |
@alan-ssvlabs func GetSignature(ps PartialSigContainer, validatorIndex phase0.ValidatorIndex, signer types.OperatorID, signingRoot [32]byte) (types.Signature, error) {
for _, psm := range ps.GetSignatureMessages {
if psm.ValidatorIndex == validatorIndex && psm.Signer == signer && psm.Root == signingRoot {
return psm.Signature, nil
}
}
return nil, error.new("Signature is not found")
} I think this is simpler and more readable. |
I spoke with the team. We don't have strong opinions either way. We typically like simpler things that are easy to read, so this change sounds good to us. |
Description
For spec it makes better sense to have simpler message containers with inefficient logic, rather than hard to decipher nested map structure.
The text was updated successfully, but these errors were encountered: