spacemeshos / go-spacemesh

Go Implementation of the Spacemesh protocol full node. 💾⏰💪
https://spacemesh.io
MIT License
760 stars 211 forks source link

[Merged by Bors] - Replace commitment ATX proof with valid label index #6444

Closed fasmat closed 1 week ago

fasmat commented 2 weeks ago

Motivation

Closes #6433. Instead of proofing that the Commitment ATX in the InvalidPost malfeasance proof, include a valid label that indirectly proofs the correctness of the Commitment ATX.

Description

This allows the same proof to be used for ATXv2 invalid posts independent of if the initial ATX is v1 or v2.

To make this change work after identifying an invalid post index the node has to verify the full PoST to see if any other index is valid. If not the ATX is considered syntactically invalid and no malfeasance proof is generated (and the ATX isn't stored in the DB). If at least one valid index is found this index is used in the malfeasance proof generation and the malfeasance proof is published.

Test Plan

existing tests were updated to fit the new behavior

TODO

fasmat commented 2 weeks ago

bors try

codecov[bot] commented 2 weeks ago

Codecov Report

Attention: Patch coverage is 92.15686% with 8 lines in your changes missing coverage. Please review.

Project coverage is 79.8%. Comparing base (12a1e00) to head (662e9ec). Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
activation/handler_v2.go 94.5% 2 Missing and 2 partials :warning:
activation/validation.go 20.0% 4 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #6444 +/- ## ========================================= - Coverage 79.8% 79.8% -0.1% ========================================= Files 344 344 Lines 44613 44610 -3 ========================================= - Hits 35638 35632 -6 - Misses 6963 6967 +4 + Partials 2012 2011 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

spacemesh-bors[bot] commented 2 weeks ago

try

Build failed:

fasmat commented 1 week ago

bors merge

spacemesh-bors[bot] commented 1 week ago

Pull request successfully merged into develop.

Build succeeded: