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

Port SCP's hashes into 64-bytes #737

Merged
merged 1 commit into from
Apr 9, 2020

Conversation

AndrejMitrovic
Copy link
Contributor

This is the first part of resolving #702

@AndrejMitrovic AndrejMitrovic added the type-enhancement An improvement of existing functionalities label Apr 7, 2020
@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #737 into v0.x.x will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           v0.x.x     #737      +/-   ##
==========================================
- Coverage   91.39%   91.36%   -0.03%     
==========================================
  Files          63       63              
  Lines        5146     5120      -26     
==========================================
- Hits         4703     4678      -25     
+ Misses        443      442       -1     
Flag Coverage Δ
#integration 51.75% <100.00%> (+0.27%) ⬆️
#unittests 90.20% <100.00%> (-0.04%) ⬇️
Impacted Files Coverage Δ
source/scpd/types/Stellar_SCP.d 93.54% <ø> (ø)
source/scpd/types/Utils.d 30.00% <ø> (ø)
source/agora/common/Config.d 90.78% <100.00%> (-0.07%) ⬇️
source/agora/consensus/protocol/Nominator.d 91.35% <100.00%> (-0.05%) ⬇️
source/agora/utils/SCPPrettyPrinter.d 91.66% <100.00%> (ø)
source/scpd/tests/LayoutTest.d 100.00% <100.00%> (ø)
source/scpd/types/Stellar_types.d 50.00% <100.00%> (ø)
source/agora/test/Base.d 88.73% <0.00%> (-0.41%) ⬇️
source/agora/network/NetworkManager.d 80.00% <0.00%> (-0.13%) ⬇️
source/agora/consensus/data/UTXOSet.d 91.91% <0.00%> (-0.09%) ⬇️
... and 2 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 324fdae...49cc23f. Read the comment docs.

@AndrejMitrovic AndrejMitrovic added the status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue label Apr 7, 2020
@AndrejMitrovic
Copy link
Contributor Author

StellarHashFmt needs to be removed in SCPPrettyPrinter.

@AndrejMitrovic AndrejMitrovic removed the status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue label Apr 7, 2020
@AndrejMitrovic
Copy link
Contributor Author

StellarHashFmt needs to be removed in SCPPrettyPrinter.

Done.

AndrejMitrovic added a commit to AndrejMitrovic/agora that referenced this pull request Apr 7, 2020
AndrejMitrovic added a commit to AndrejMitrovic/agora that referenced this pull request Apr 7, 2020
@AndrejMitrovic AndrejMitrovic changed the title Port SCP's hashes into 64-bit Port SCP's hashes into 64-bytes Apr 7, 2020
@AndrejMitrovic AndrejMitrovic force-pushed the 64-byte-hashes branch 3 times, most recently from a9a264e to ab79669 Compare April 7, 2020 09:08
}
uint512 t = h->finish();

// WARNING: Do not replace this back with SCP's original implementation.

This comment was marked as resolved.

Copy link
Collaborator

@Geod24 Geod24 left a comment

Choose a reason for hiding this comment

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

Few comments, looks nice

using uint256 = xdr::opaque_array<32>;
using uint512 = xdr::opaque_array<64>;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a comment above those types, explaining that they were modified on purpose ?

@@ -3,7 +3,6 @@

namespace std
{

Copy link
Collaborator

Choose a reason for hiding this comment

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

Unrelated

// Plain SHA256
uint256
sha256(ByteSlice const& bin)
// Plain SHA512
Copy link
Collaborator

Choose a reason for hiding this comment

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

So I guess you want to do the migration in two steps ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just realized this could have been all part of the same PR. But I'll leave it as is then, and fix up the comments.

AndrejMitrovic added a commit to AndrejMitrovic/agora that referenced this pull request Apr 9, 2020
Also removed StellarHashFmt since
we can just use prettify which
supports 64-byte hashes already.

Part of: bosagora#702
@AndrejMitrovic
Copy link
Contributor Author

Fixed up, green.

@Geod24 Geod24 merged commit 8f3c64e into bosagora:v0.x.x Apr 9, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants