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

(lib/grandpa): verify justification hash relates to block being justified #2619

Merged
merged 10 commits into from
Jul 4, 2022

Conversation

EclesioMeloJunior
Copy link
Member

Changes

  • Check if the given justification commit hash is equal the given header hash in the method VerifyBlockJustification(hash common.Hash, justification []byte)

Tests

go test github.com/ChainSafe/gossamer/lib/grandpa

Issues

Primary Reviewer

@timwu20

@EclesioMeloJunior EclesioMeloJunior force-pushed the eclesio/compare-justification-hash branch from 11338a9 to 594c367 Compare June 23, 2022 14:52
@EclesioMeloJunior EclesioMeloJunior self-assigned this Jun 23, 2022
@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

Merging #2619 (5ce3e40) into development (e7749cf) will decrease coverage by 0.02%.
The diff coverage is 72.72%.

@@               Coverage Diff               @@
##           development    #2619      +/-   ##
===============================================
- Coverage        61.97%   61.95%   -0.03%     
===============================================
  Files              215      215              
  Lines            28453    28492      +39     
===============================================
+ Hits             17634    17651      +17     
- Misses            9067     9087      +20     
- Partials          1752     1754       +2     
Flag Coverage Δ
unit-tests 61.95% <72.72%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/common/hash.go 32.46% <0.00%> (-1.32%) ⬇️
lib/common/variadic/uint32OrHash.go 31.95% <100.00%> (+2.92%) ⬆️
lib/grandpa/message_handler.go 56.47% <100.00%> (+0.34%) ⬆️
dot/network/inbound.go 92.98% <0.00%> (-7.02%) ⬇️
dot/state/block_notify.go 81.90% <0.00%> (-5.72%) ⬇️
internal/trie/node/decode.go 91.11% <0.00%> (-4.81%) ⬇️
lib/blocktree/leaves.go 93.39% <0.00%> (-2.84%) ⬇️
dot/network/notifications.go 63.79% <0.00%> (-1.38%) ⬇️
dot/network/service.go 56.54% <0.00%> (-0.47%) ⬇️
internal/trie/node/key.go 100.00% <0.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 792e53f...5ce3e40. Read the comment docs.

lib/common/hash.go Outdated Show resolved Hide resolved
lib/grandpa/errors.go Outdated Show resolved Hide resolved
lib/grandpa/message_handler.go Outdated Show resolved Hide resolved
lib/grandpa/errors.go Outdated Show resolved Hide resolved
lib/grandpa/message_handler.go Outdated Show resolved Hide resolved
@EclesioMeloJunior EclesioMeloJunior merged commit c6e9c80 into development Jul 4, 2022
@EclesioMeloJunior EclesioMeloJunior deleted the eclesio/compare-justification-hash branch July 4, 2022 20:51
@github-actions
Copy link

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

VerifyBlockJustification() Does Not Verify Justification Hash Relates to Block Being Justified (GSR-17)
4 participants