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

Use our own hashing routines instead of SCPs #741

Merged
merged 3 commits into from
Apr 10, 2020

Conversation

AndrejMitrovic
Copy link
Contributor

@AndrejMitrovic AndrejMitrovic commented Apr 7, 2020

@AndrejMitrovic AndrejMitrovic added status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue type-feature An addition to the system introducing new functionalities type-enhancement An improvement of existing functionalities labels Apr 7, 2020
@AndrejMitrovic
Copy link
Contributor Author

Note: this is only for SCPQuorumSet. I haven't changed the routines for hashing the Value.

@AndrejMitrovic AndrejMitrovic force-pushed the agora-hash branch 2 times, most recently from 2d72677 to 5ca40ca Compare April 7, 2020 09:11
@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #741 into v0.x.x will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           v0.x.x     #741      +/-   ##
==========================================
- Coverage   91.34%   91.34%   -0.01%     
==========================================
  Files          64       65       +1     
  Lines        5151     5162      +11     
==========================================
+ Hits         4705     4715      +10     
- Misses        446      447       +1     
Flag Coverage Δ
#integration 51.15% <90.00%> (+0.96%) ⬆️
#unittests 90.18% <100.00%> (+<0.01%) ⬆️
Impacted Files Coverage Δ
source/scpd/tests/LayoutTest.d 100.00% <ø> (ø)
source/scpd/types/Utils.d 22.22% <ø> (-7.78%) ⬇️
source/agora/common/SCPHash.d 100.00% <100.00%> (ø)
source/agora/consensus/protocol/Nominator.d 91.30% <100.00%> (-0.05%) ⬇️
source/agora/utils/SCPPrettyPrinter.d 91.60% <100.00%> (-0.07%) ⬇️
source/scpd/types/Stellar_SCP.d 95.45% <100.00%> (+1.90%) ⬆️
source/scpd/types/XDRBase.d 15.38% <0.00%> (-23.08%) ⬇️
source/agora/test/Base.d 88.78% <0.00%> (+0.46%) ⬆️
source/agora/network/NetworkManager.d 79.37% <0.00%> (+0.62%) ⬆️

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 8a08d45...a00fb51. Read the comment docs.

@@ -24,14 +24,14 @@ LocalNode::LocalNode(NodeID const& nodeID, bool isValidator,
: mNodeID(nodeID), mIsValidator(isValidator), mQSet(qSet), mSCP(scp)
{
normalizeQSet(mQSet);
mQSetHash = sha512(xdr::xdr_to_opaque(mQSet));
mQSetHash = getHashOf(mQSet);

This comment was marked as resolved.

@AndrejMitrovic AndrejMitrovic force-pushed the agora-hash branch 3 times, most recently from 7db6fcd to 29222ff Compare April 9, 2020 08:13
@AndrejMitrovic AndrejMitrovic changed the title [RFC] Use our own hashing routines instead of SCPs Use our own hashing routines instead of SCPs Apr 9, 2020
@AndrejMitrovic AndrejMitrovic marked this pull request as ready for review April 9, 2020 08:14
@AndrejMitrovic AndrejMitrovic removed the status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue label Apr 9, 2020
return uint512(hashFull(qset));
}

/// ditto
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice if D is uppercase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay! It doesn't make a difference to the compiler, but sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah for consistency, sure.

@AndrejMitrovic
Copy link
Contributor Author

I'll fix the linking issue in a bit.

@AndrejMitrovic AndrejMitrovic force-pushed the agora-hash branch 3 times, most recently from 4311e76 to 65f91b6 Compare April 9, 2020 10:16
We want to use our own hashing routines
when hashing SCPQuorumSet.
The ByteSlice bindings will be removed
in the next commit.
@AndrejMitrovic
Copy link
Contributor Author

I get linker errors with 1.20.1 but not 1.20.0. Sigh.

SCP uses hashing in four different places,
for different data types. So we're providing
4 prototoypes of the hashing routine implemented
on the D side.

Fixes: bosagora#702
@AndrejMitrovic
Copy link
Contributor Author

Fixed the linker issue.

@Geod24 Geod24 merged commit 2b787c8 into bosagora:v0.x.x Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement An improvement of existing functionalities type-feature An addition to the system introducing new functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use our own hashing in getQSet instead of relying on Stellar's
3 participants