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] - Add double marry malfeasance proof #6219

Closed
wants to merge 6 commits into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Aug 6, 2024

Motivation

Closes #6218

Description

Adds the proof for double marry malfeasance and updates the ATX handler to create and publish one when detected

Test Plan

  • Tests for malfeasance proof and ATX handler have been added / updated

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed
  • Update changelog as needed

@fasmat fasmat self-assigned this Aug 6, 2024
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 84.76821% with 23 lines in your changes missing coverage. Please review.

Project coverage is 82.0%. Comparing base (00d476f) to head (42ddecc).

Files Patch % Lines
activation/wire/malfeasance_double_marry.go 89.1% 6 Missing and 6 partials ⚠️
activation/handler_v2.go 55.5% 5 Missing and 3 partials ⚠️
activation/wire/wire_v2.go 90.4% 1 Missing and 1 partial ⚠️
activation/malfeasance2.go 0.0% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           develop   #6219     +/-   ##
=========================================
- Coverage     82.0%   82.0%   -0.1%     
=========================================
  Files          308     309      +1     
  Lines        33913   34033    +120     
=========================================
+ Hits         27829   27922     +93     
- Misses        4311    4326     +15     
- Partials      1773    1785     +12     

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

activation/handler_v2.go Outdated Show resolved Hide resolved
activation/wire/malfeasance_double_marry.go Outdated Show resolved Hide resolved
activation/wire/malfeasance_double_marry.go Outdated Show resolved Hide resolved
Comment on lines +110 to +112
var vrfNonce types.Hash32
binary.LittleEndian.PutUint64(vrfNonce[:], atx.VRFNonce)
tree.AddLeaf(vrfNonce.Bytes())
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain why is it important that leaves are all 32B?

Copy link
Member Author

Choose a reason for hiding this comment

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

If I remember correctly the validate Merkle proof function assumes that all values are 32 bytes and appends them with zeroes if they are not.

So if we don't create the Merkle proof with 32 byte values the proof will fail to validate 😕

activation/wire/wire_v2_test.go Outdated Show resolved Hide resolved
@fasmat fasmat requested a review from poszu August 7, 2024 12:28
@fasmat
Copy link
Member Author

fasmat commented Aug 7, 2024

bors merge

spacemesh-bors bot pushed a commit that referenced this pull request Aug 7, 2024
@spacemesh-bors
Copy link

spacemesh-bors bot commented Aug 7, 2024

Pull request successfully merged into develop.

Build succeeded:

@spacemesh-bors spacemesh-bors bot changed the title Add double marry malfeasance proof [Merged by Bors] - Add double marry malfeasance proof Aug 7, 2024
@spacemesh-bors spacemesh-bors bot closed this Aug 7, 2024
@spacemesh-bors spacemesh-bors bot deleted the add-double-marry-malfeasance branch August 7, 2024 13:23
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.

Malfeasance V2: Double Marry
2 participants