Closed MatheusFranco99 closed 5 months ago
@GalRogozinski
The current tests only check msg.Validate()
which doesn't check the signature. This is because we don't specify here how this signature should be created or validated.
I didn't add such a restriction on the type of signature because the message validation module (in p2p/validation) will be removed from spec in a future PR (right?) and the validator or runner don't have access to this signature.
What do you think?
@MatheusFranco99
The spec should achieve 2 objectives in my eyes:
Currently the spec doesn't exactly reach those objectives and in the spec rewrite I am hoping to change this. In the meanwhile I wish to do things correctly for new additions :-)
Imagine someone changes the RSA parameters (for better security) and then creates an incompatibility. This should be caught by the spec
@GalRogozinski Sure, I'll be adding a check in message validation to verify the RSA signature and tests for it.
@y0sher Yes, I'm aware of that. The point of this PR is not only to define a type for this buffer approach that we're using on the node, but it also is a pre-requisite for the next "reduce signatures" PR. This signed message type will now be used in the runner module.
@y0sher @MatheusFranco99
This is a fork because the implementation puts signature first and the PR puts operator first, right?
If so we should change this to not be a fork because I don't think there is a real advantage here...
Its a fork because the implementation uses its own way of encoding the sig and operators. even if you create the struct in the PR in the same order it doesn't mean the final encoded data will be the same unless you enforce the struct to be encoded in the same way. In your PR the encoding is SSZ, where in the impl it is just raw data bytes on a buffer.
@moshe-blox @y0sher
There are 2 things we can do here:
The only reason I would use SSZ is just for the sake of consistency, since we use SSZ everywhere. Besides this I don't see an advantage. But this is good enough for me to opt for 2. If you guys don't want to change to SSZ then we can go for 1.
Overview
Introduce
SignedSSVMessage
, which encapsulatesSSVMessage
along with asignature
and a senderidentifier
fields.Changes
SignedSSVMesage
structure intypes
DecodePubsubMsg
now returns aSignedSSVMesage
MsgValidation
adapted to receive aSignedSSVMesage
instead of aSSVMessage
.Note: though
SSVMessage
is no longer the transmitted message in the network, theRunner
still processes the typeSSVMessage
in theProcessMessage
function.Tests