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

Send & receive SCP quorum sets to fix SCP message propagation #621

Closed
wants to merge 5 commits into from

Conversation

AndrejMitrovic
Copy link
Contributor

@AndrejMitrovic AndrejMitrovic commented Mar 4, 2020

@AndrejMitrovic AndrejMitrovic added type-bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense type-enhancement An improvement of existing functionalities labels Mar 4, 2020
@codecov
Copy link

codecov bot commented Mar 4, 2020

Codecov Report

Merging #621 into v0.x.x will decrease coverage by 0.01%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           v0.x.x     #621      +/-   ##
==========================================
- Coverage   91.34%   91.33%   -0.02%     
==========================================
  Files          65       65              
  Lines        5167     5192      +25     
==========================================
+ Hits         4720     4742      +22     
- Misses        447      450       +3     
Flag Coverage Δ
#integration 50.53% <66.66%> (+0.15%) ⬆️
#unittests 90.18% <92.59%> (-0.02%) ⬇️
Impacted Files Coverage Δ
source/agora/test/Base.d 88.78% <ø> (ø)
source/agora/consensus/protocol/Nominator.d 90.57% <88.88%> (-0.73%) ⬇️
source/agora/node/Node.d 98.16% <88.88%> (-0.84%) ⬇️
source/agora/network/NetworkClient.d 95.34% <100.00%> (+0.47%) ⬆️
source/agora/network/NetworkManager.d 79.87% <100.00%> (+0.50%) ⬆️
source/scpd/types/XDRBase.d 21.42% <100.00%> (+6.04%) ⬆️

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 20decfd...c59bd05. Read the comment docs.

@AndrejMitrovic AndrejMitrovic added the type-feature An addition to the system introducing new functionalities label Mar 4, 2020
@AndrejMitrovic
Copy link
Contributor Author

Some of these commits should be split off into another PR.

@AndrejMitrovic AndrejMitrovic added the status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue label Mar 5, 2020
@@ -365,6 +381,8 @@ public class NetworkManager
try
{
node.handshake(this.getAddress());
if (node.quorum_hash != StellarHash.init)
this.quorum_sets[node.quorum_hash] = node.quorum_set;

This comment was marked as outdated.

@AndrejMitrovic AndrejMitrovic added status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue and removed status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue labels Mar 5, 2020
@AndrejMitrovic AndrejMitrovic changed the title Fix SCP message propagation & make cyclic quorum's possible [WIP] Fix SCP message propagation & make cyclic quorum's possible Mar 9, 2020
@AndrejMitrovic AndrejMitrovic force-pushed the new-clients branch 2 times, most recently from 427a75b to b87068e Compare March 9, 2020 07:20
@AndrejMitrovic AndrejMitrovic changed the title [WIP] Fix SCP message propagation & make cyclic quorum's possible Fix SCP message propagation & make cyclic quorum's possible Mar 9, 2020
@AndrejMitrovic
Copy link
Contributor Author

I will split this into two, and remove the necessity to exchange SCP structs in the API.

@AndrejMitrovic
Copy link
Contributor Author

This needs to be reworked with regards to #702.

@AndrejMitrovic AndrejMitrovic removed the type-feature An addition to the system introducing new functionalities label Apr 6, 2020
@AndrejMitrovic AndrejMitrovic changed the title Fix SCP message propagation & make cyclic quorum's possible Send & receive SCP quorum sets to fix SCP message propagation Apr 7, 2020
Temporary measure until we use our own hashes.
This is a temporary solution to make getQSet() in our implementation
of the SCPDriver to work properly.

In the future, the set of quorum hashes and sets will be known
based on the quorum balancing algorithm and these APIs can then
be removed..
If there was a new client connecting to use,
it might have a quorum set associated with
a hash that we previously haven't seen.

If a new hash is found, it's added to the
cache.
The previous set of fixes included:
- Gossip all messages to connected peers,
  and not just to *our* quorum set

- Retrieve all hash => QuorumSet mappings,
  through a set of new APIs.

Together with these fixes, the cylic quorum
configuration finally works.

In addition, the ExtraChecks for the quorum
configurations can finally be re-enabled.

Fixes bosagora#606
AndrejMitrovic added a commit to AndrejMitrovic/agora that referenced this pull request Apr 16, 2020
{
auto stellar_hash = uint512(hash);
auto set = this.nominator.getQSet(stellar_hash);
assert(set.ptr !is null);
Copy link
Member

Choose a reason for hiding this comment

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

If StellarHash is not new, an error occurs.
Can it be used for malicious attacks?

@AndrejMitrovic
Copy link
Contributor Author

As mentioned in #621 (comment), this PR has become unnecessary. We don't need to look up quorum sets explicitly because they will be known in advance once #240 is implemented.

AndrejMitrovic added a commit to AndrejMitrovic/agora that referenced this pull request Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status-blocked Another issue/PR/external dependency is blocking completion of this PR/issue type-bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense type-enhancement An improvement of existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCP messages need to be broadcasted to all a Node's connected Validator peers
2 participants