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

[Merged by Bors] - fix regression in proposals sync #4986

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ See [RELEASE](./RELEASE.md) for workflow instructions.
* [#4965](https://github.com/spacemeshos/go-spacemesh/pull/4965) Updates to PoST:
* Prevent errors when shutting down the node that can result in a crash
* `postdata_metadata.json` is now updated atomically to prevent corruption of the file.
* [#4956](https://github.com/spacemeshos/go-spacemesh/pull/4956) Active set is will not be gossipped in every proposal.
Active set usually contains list of atxs that targets current epoch. As the number of atxs grows this object grows as well.

## v1.1.4

Expand Down
11 changes: 9 additions & 2 deletions proposals/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,19 @@
latency := receivedTime.Sub(h.clock.LayerToTime(p.Layer))
metrics.ReportMessageLatency(pubsub.ProposalProtocol, pubsub.ProposalProtocol, latency)

set := p.ActiveSet
// on sync path activeset is downloaded together with proposal
// but starting at layer AllowEmptyActiveSet proposals are signed without activeset
if p.Layer >= h.cfg.AllowEmptyActiveSet {
p.ActiveSet = nil
}
if !h.edVerifier.Verify(signing.PROPOSAL, p.SmesherID, p.SignedBytes(), p.Signature) {
badSigBallot.Inc()
badSigProposal.Inc()
return fmt.Errorf("failed to verify proposal signature")
}
p.ActiveSet = set
if !h.edVerifier.Verify(signing.BALLOT, p.Ballot.SmesherID, p.Ballot.SignedBytes(), p.Ballot.Signature) {
badSigProposal.Inc()
badSigBallot.Inc()

Check warning on line 281 in proposals/handler.go

View check run for this annotation

Codecov / codecov/patch

proposals/handler.go#L281

Added line #L281 was not covered by tests
return fmt.Errorf("failed to verify ballot signature")
}

Expand Down