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
P2p message signing component #4460
P2p message signing component #4460
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## feat/optimise-consensus-sigcheck #4460 +/- ##
===================================================================
Coverage ? 75.84%
===================================================================
Files ? 645
Lines ? 85198
Branches ? 0
===================================================================
Hits ? 64619
Misses ? 15781
Partials ? 4798 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
p2p/messageCheck/messageVerifier.go
Outdated
return err | ||
} | ||
|
||
err = pubsub.VerifyMessageSignature(pubsubMsg) |
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.
we do not need this. Please use the p2p/crypto/p2pSigner component available on feat/multisigner branch
https://github.com/ElrondNetwork/elrond-go/tree/feat/multisigner/p2p/crypto
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.
changed to use p2p signer component
) | ||
|
||
type messageVerifier struct { | ||
marshaller marshal.Marshalizer |
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.
the serializer used in the p2p subsystem is not the one used in elrond-go. This needs to be refactored
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.
refactored to use internal marshaller
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestNewMessageVerifier(t *testing.T) { |
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.
beside this, we might create an integration test in which we have 2 connected peers that and verify their received messages with the new component
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.
created the integration test
mv, err := messagecheck.NewMessageVerifier(args) | ||
require.Nil(t, err) | ||
|
||
messagesBytes, err := mv.Serialize(messages) |
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.
I think messages and expected messages are switched (names)
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.
done
… broadcast instead of send to connected peer
Description of the reasoning behind the pull request (what feature was missing / how the problem was manifesting itself / what was the motive behind the refactoring)
Proposed Changes
Testing procedure