Skip to content
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

Fix invalid signers message broadcast on multikey #5817

Merged
merged 7 commits into from Jan 16, 2024

Conversation

sstanculeanu
Copy link
Contributor

Reasoning behind the pull request

  • the consensus message with invalid signers was sent from self key instead of leader, which would not be compatible with multikey mode

Proposed changes

  • broadcast the consensus message from leader

Testing procedure

  • standard system test + multikey test

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@sstanculeanu sstanculeanu self-assigned this Jan 9, 2024
AdoAdoAdo
AdoAdoAdo previously approved these changes Jan 9, 2024
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (a7707af) 80.19% compared to head (d5d23aa) 80.15%.

Files Patch % Lines
consensus/spos/bls/subroundEndRound.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           rc/sirius-patch-2    #5817      +/-   ##
=====================================================
- Coverage              80.19%   80.15%   -0.04%     
=====================================================
  Files                    708      708              
  Lines                  94083    94086       +3     
=====================================================
- Hits                   75446    75415      -31     
- Misses                 13293    13327      +34     
  Partials                5344     5344              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

iulianpascalau
iulianpascalau previously approved these changes Jan 9, 2024
@@ -1556,29 +1603,56 @@ func TestVerifyInvalidSigners(t *testing.T) {
func TestSubroundEndRound_CreateAndBroadcastInvalidSigners(t *testing.T) {
t.Parallel()

wg := &sync.WaitGroup{}
wg.Add(1)
t.Run("redundancy node should not send", func(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"redundancy node should not send while the main is active"

iulianpascalau
iulianpascalau previously approved these changes Jan 10, 2024
@@ -589,20 +589,31 @@ func (sr *subroundEndRound) createAndBroadcastHeaderFinalInfo() {
}

func (sr *subroundEndRound) createAndBroadcastInvalidSigners(invalidSigners []byte) {
isSelfLeader := sr.IsSelfLeaderInCurrentRound() && sr.ShouldConsiderSelfKeyInConsensus()
if !isSelfLeader && !sr.IsMultiKeyLeaderInCurrentRound() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change the condition to

if !(isSelfLeader || sr.IsMultiKeyLeaderInCurrentRound()) 

would be easier to read

container := mock.InitConsensusCore()
messenger := &mock.BroadcastMessengerMock{
BroadcastConsensusMessageCalled: func(message *consensus.Message) error {
wg.Done()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do the wg.Done after the wasCalled = true?

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normal allin test: master-ace90ef010 -> fix_multikey_invalid_signe-624cbd54fe

--- Specific errors ---

block hash does not match 9031
wrong nonce in block 3592
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0

/------/

--- Statistics ---

Nr. of all ERRORS: 3
Nr. of all WARNS: 3319
Nr. of new ERRORS: 3
Nr. of new WARNS: 18
Nr. of PANICS: 0

/------/

--- ERRORS ---

/------/

@sstanculeanu sstanculeanu merged commit 0e20091 into rc/sirius-patch-2 Jan 16, 2024
6 of 8 checks passed
@sstanculeanu sstanculeanu deleted the fix_multikey_invalid_signers branch January 16, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants