Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
shotasilagadzetaal committed Nov 7, 2024
1 parent 3397054 commit b73b542
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions cl/phase1/network/services/sync_contribution_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,44 +132,43 @@ func (s *syncContributionService) ProcessMessage(ctx context.Context, subnet *ui
return ErrIgnore
}

// aggregate signatures for later verification
aggregateVerificationData, err := s.GetSignaturesOnContributionSignatures(headState, contributionAndProof, signedContribution, subcommiteePubsKeys)
if err != nil {
return err
}

// aggregate signatures for later verification
aggregateVerificationData, err := s.GetSignaturesOnContributionSignatures(headState, contributionAndProof, signedContribution, subcommiteePubsKeys)
if err != nil {
return err
}

aggregateVerificationData.GossipData = signedContribution.GossipData
aggregateVerificationData.GossipData = signedContribution.GossipData

// further processing will be done after async signature verification
aggregateVerificationData.F = func() {
// further processing will be done after async signature verification
aggregateVerificationData.F = func() {

// mark the valid contribution as seen
s.markContributionAsSeen(contributionAndProof)
// mark the valid contribution as seen
s.markContributionAsSeen(contributionAndProof)

// emit contribution_and_proof
// emit contribution_and_proof

s.emitters.Operation().SendContributionProof(signedContribution.SignedContributionAndProof)
// add the contribution to the pool
err = s.syncContributionPool.AddSyncContribution(headState, contributionAndProof.Contribution)
if errors.Is(err, sync_contribution_pool.ErrIsSuperset) {
return
}
}
s.emitters.Operation().SendContributionProof(signedContribution.SignedContributionAndProof)
// add the contribution to the pool
err = s.syncContributionPool.AddSyncContribution(headState, contributionAndProof.Contribution)
if errors.Is(err, sync_contribution_pool.ErrIsSuperset) {
return
}
}

if signedContribution.ImmediateVerification {
return s.batchSignatureVerifier.ImmediateVerification(aggregateVerificationData)
}
if signedContribution.ImmediateVerification {
return s.batchSignatureVerifier.ImmediateVerification(aggregateVerificationData)
}

// push the signatures to verify asynchronously and run final functions after that.
s.batchSignatureVerifier.AsyncVerifySyncContribution(aggregateVerificationData)
// push the signatures to verify asynchronously and run final functions after that.
s.batchSignatureVerifier.AsyncVerifySyncContribution(aggregateVerificationData)

// As the logic goes, if we return ErrIgnore there will be no peer banning and further publishing
// gossip data into the network by the gossip manager. That's what we want because we will be doing that ourselves
// in BatchVerification function. After validating signatures, if they are valid we will publish the
// gossip ourselves or ban the peer which sent that particular invalid signature.
return ErrIgnore
}
// As the logic goes, if we return ErrIgnore there will be no peer banning and further publishing
// gossip data into the network by the gossip manager. That's what we want because we will be doing that ourselves
// in BatchVerification function. After validating signatures, if they are valid we will publish the
// gossip ourselves or ban the peer which sent that particular invalid signature.
return ErrIgnore
})
}

func (s *syncContributionService) GetSignaturesOnContributionSignatures(
Expand Down

0 comments on commit b73b542

Please sign in to comment.