-
Notifications
You must be signed in to change notification settings - Fork 197
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
Pseudo slashing for invalid signers #4269
Merged
AdoAdoAdo
merged 38 commits into
feat/optimise-consensus-sigcheck
from
pseudo-slashing-for-invalid-signers
Oct 21, 2022
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
8da8b53
added new field for consensus message - InvalidSigners
ssd04 765a83b
first implementation for pseudo slashing
ssd04 514622f
temp version for p2p pubsub
ssd04 6dcfb39
add custom type for invalid signers
ssd04 7b78941
first implementation for pseudo slashing: fix unit tests
ssd04 947f8b8
validity checks for invalisSigners consensus message type + use json …
ssd04 044b165
p2p: added additional field with marshalled pubsub message to p2p mes…
ssd04 c2dece2
use original marshalled p2p message instead of json marshalling
ssd04 c70ac05
added new field for consensus message - number of InvalidSigners
ssd04 d5e629f
reverted new field for consensus message - number of InvalidSigners
ssd04 46968f9
added interface for p2p message handling
ssd04 fbdc098
use p2p message signing component in subround endround
ssd04 5e2d918
subround endround: unit test for invalid signers verification
ssd04 53e3bec
p2p: remove marshalled data field
ssd04 d01da9f
consensus: use p2p message instead of marshalled data
ssd04 73c46eb
unit tests for consensus core and message validator
ssd04 9919dc3
cleanup unused core:
ssd04 a0b5f11
consensus: more unit tests for end round + comment updates
ssd04 fccb94d
flag check for invalid signers + peer honesty change
ssd04 6cd0194
fix should send flag on error
ssd04 d185fe3
bls worker: more checks for invalid signers consensus message
ssd04 4736186
bls worker: more checks for invalid signers consensus message - fix u…
ssd04 887d6ed
use single signer to verify sig share; add keyGenerator to consensus …
ssd04 c818111
use single signer to verify sig share; add keyGenerator to consensus …
ssd04 9250e77
fix mocks: remove reference to peer blacklist
ssd04 86e1b51
add message signer mock
ssd04 4f3b53f
consensus state: rlock for get message with signature
ssd04 984ac90
Merge branch 'feat/optimise-consensus-sigcheck' into pseudo-slashing-…
ssd04 67f385a
spos endround: comments and log updates
ssd04 e6609d0
consensus worker: remove TODO comment
ssd04 d759b60
Merge branch 'feat/optimise-consensus-sigcheck' into merge-optimize-c…
ssd04 33334b0
Merge pull request #4509 from ElrondNetwork/merge-optimize-consensus-…
ssd04 f850519
Merge branch 'feat/optimise-consensus-sigcheck' into merge-optimize-c…
ssd04 f60633f
Merge pull request #4557 from ElrondNetwork/merge-optimize-consensus-…
ssd04 4272475
fixes after review: more check, small refactoring, comments update
ssd04 d92dc33
fix linter issue
ssd04 387e6f9
added more unit tests for received invalid signers info
ssd04 63d7e98
fix comment typo
ssd04 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package mock | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/ElrondNetwork/elrond-go/p2p" | ||
"github.com/ElrondNetwork/elrond-go/p2p/message" | ||
) | ||
|
||
// MessageSignerMock implements P2PSigningHandler interface but it does nothing as it is disabled | ||
type MessageSignerMock struct { | ||
} | ||
|
||
// Verify does nothing | ||
func (ms *MessageSignerMock) Verify(message p2p.MessageP2P) error { | ||
return nil | ||
} | ||
|
||
// Serialize will serialize the list of p2p messages | ||
func (ms *MessageSignerMock) Serialize(messages []p2p.MessageP2P) ([]byte, error) { | ||
messagesBytes, err := json.Marshal(messages) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return messagesBytes, nil | ||
} | ||
|
||
// Deserialize will unmarshal into a list of p2p messages | ||
func (ms *MessageSignerMock) Deserialize(messagesBytes []byte) ([]p2p.MessageP2P, error) { | ||
var messages []*message.Message | ||
err := json.Unmarshal(messagesBytes, &messages) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
messages2 := make([]p2p.MessageP2P, 0) | ||
for _, msg := range messages { | ||
messages2 = append(messages2, msg) | ||
} | ||
|
||
return messages2, nil | ||
} | ||
|
||
// IsInterfaceNil returns true if there is no value under the interface | ||
func (ms *MessageSignerMock) IsInterfaceNil() bool { | ||
return ms == nil | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
L191: ConsensusCore instead ConsensusStore and also in some other files (2 more files)
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