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

Tidy consensus #2156

Closed
wants to merge 2 commits into from
Closed

Tidy consensus #2156

wants to merge 2 commits into from

Conversation

bachase
Copy link
Collaborator

@bachase bachase commented Jun 27, 2017

Simplify the use of and bow-out logic in handleWrongLedger

@codecov-io
Copy link

codecov-io commented Jun 27, 2017

Codecov Report

Merging #2156 into master will decrease coverage by <.01%.
The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2156      +/-   ##
==========================================
- Coverage   69.01%   69.01%   -0.01%     
==========================================
  Files         684      684              
  Lines       50468    50475       +7     
==========================================
  Hits        34833    34833              
- Misses      15635    15642       +7
Impacted Files Coverage Δ
src/ripple/consensus/Consensus.h 84.82% <41.66%> (-0.27%) ⬇️
src/ripple/app/misc/Validations.cpp 59.45% <50%> (-0.08%) ⬇️
src/ripple/app/ledger/PendingSaves.h 93.54% <0%> (-6.46%) ⬇️
src/ripple/app/misc/SHAMapStoreImp.cpp 78.86% <0%> (-1.04%) ⬇️
src/ripple/beast/clock/chrono_util.h 91.3% <0%> (+8.69%) ⬆️

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 7b0d482...5e2de96. Read the comment docs.

Copy link
Contributor

@nbougalis nbougalis left a comment

Choose a reason for hiding this comment

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

👍

Looks good to me. I'd simply squash everything down into one commit: "Simplify bow-out handling & dispute updating"

// try to acquire the correct one
if(auto newLedger = impl().acquireLedger(prevLedgerID))
{
prevLedger = *newLedger;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ledger_t looks like it's usually a thin wrapper around a shared_ptr (i.e. RCLCxLedger). There's a minor benefit if we move here instead of copy.

@JoelKatz
Copy link
Collaborator

👍

@bachase bachase changed the base branch from develop to master June 27, 2017 17:48
@@ -93,6 +93,10 @@ class ValidationsImp : public Validations

auto pubKey = app_.validators ().getTrustedKey (signer);

// Do not process or forward partial validations.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just for my own education, what are the consequences of not forwarding partial validations? My understanding is that part of the role of a partial validation is that it lets other folks know that validator is still on the job, although it is not contributing during this round. Will not forwarding the partial cause some observers to remove this validator?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. I fixed to properly forward partial validations. At this time, we aren't actually using them to do anything special aside from including them in the partial validation stream, but you are correct that they should be forwarded.

{
// Only forward if current
return isCurrent;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: The {} really aren't necessary.

@bachase
Copy link
Collaborator Author

bachase commented Jul 10, 2017

Merged as a89be5b

@bachase bachase closed this Jul 10, 2017
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.

7 participants