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

Refactor consensus for simulation (RIPD-1011) #2040

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@bachase
Copy link
Contributor

bachase commented Mar 7, 2017

This is a substantial refactor of the consensus code and also introduces a basic consensus simulation and testing framework. The new generic/templated version is in src/ripple/consensus and documents the current type requirements. The version adapted for the RCL is in src/ripple/app/consensus. The testing framework is in src/test/csf. The goal of this phase of refactoring is to get sufficient test coverage of consensus to allow the next phase of refactoring needed for the simulation framework.

Minor behavioral changes/fixes include:

  • Adjust close time offset even when not validating.
  • Remove spurious proposing_ = false call at end of handleLCL.
  • Remove unused functionality provided by checkLastValidation.
  • Separate open and converge time
  • Don't send a bow out if we're not proposing
  • Prevent consensus stopping if NetworkOPs switches to disconnect mode while
    consensus accepts a ledger
  • Prevent a corner case in which Consensus::gotTxSet or Consensus::peerProposal
    has the potential to update internal state while an dispatched accept job is
    running.
  • Distinguish external and internal calls to startNewRound. Only external
    calls can reset the proposing_ state of consensus

This is a squashed version of #1941.

@bachase bachase added the Passed label Mar 7, 2017

@bachase bachase requested a review from JoelKatz Mar 7, 2017

@bachase

This comment has been minimized.

Copy link
Contributor Author

bachase commented Mar 7, 2017

Marked as passed based on @JoelKatz review of #1941

@bachase bachase referenced this pull request Mar 7, 2017

Closed

Consensus Refactor #1941

@bachase bachase force-pushed the bachase:consensus-squash branch from 0b767be to 945de91 Mar 7, 2017

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Mar 7, 2017

Codecov Report

Merging #2040 into develop will increase coverage by 0.76%.
The diff coverage is 72.78%.

@@             Coverage Diff             @@
##           develop    #2040      +/-   ##
===========================================
+ Coverage     67.7%   68.46%   +0.76%     
===========================================
  Files          680      678       -2     
  Lines        49219    49212       -7     
===========================================
+ Hits         33323    33693     +370     
+ Misses       15896    15519     -377
Impacted Files Coverage Δ
src/ripple/protocol/STValidation.h 52.38% <ø> (ø) ⬆️
src/ripple/app/main/Application.cpp 61.12% <ø> (-0.1%) ⬇️
src/ripple/app/ledger/Ledger.cpp 81.36% <ø> (ø) ⬆️
src/ripple/app/misc/Validations.cpp 68.09% <ø> (ø) ⬆️
src/ripple/overlay/impl/PeerImp.h 0% <ø> (ø) ⬆️
src/ripple/app/misc/NetworkOPs.h 100% <ø> (ø) ⬆️
src/ripple/app/consensus/RCLCxPeerPos.cpp 3.44% <0%> (ø)
src/ripple/app/ledger/impl/LedgerMaster.cpp 44.04% <0%> (-0.57%) ⬇️
src/ripple/app/consensus/RCLCxPeerPos.h 0% <0%> (ø)
src/ripple/overlay/impl/PeerImp.cpp 0% <0%> (ø) ⬆️
... and 27 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 0df1b09...d1ed96a. Read the comment docs.

@bachase bachase force-pushed the bachase:consensus-squash branch 2 times, most recently from 4a0b7d8 to 714bf4b Mar 7, 2017

@bachase bachase force-pushed the bachase:consensus-squash branch from 714bf4b to d1ed96a Mar 20, 2017

@bachase

This comment has been minimized.

Copy link
Contributor Author

bachase commented Mar 20, 2017

Rebased on 0.60.0

@scottschurr scottschurr referenced this pull request Mar 21, 2017

Merged

Develop next #2059

Refactor consensus for simulation (RIPD-1011):
This is a substantial refactor of the consensus code and also introduces
a basic consensus simulation and testing framework.  The new generic/templated
version is in src/ripple/consensus and documents the current type requirements.
The version adapted for the RCL is in src/ripple/app/consensus.  The testing
framework is in src/test/csf.

Minor behavioral changes/fixes include:
* Adjust close time offset even when not validating.
* Remove spurious proposing_ = false call at end of handleLCL.
* Remove unused functionality provided by checkLastValidation.
* Separate open and converge time
* Don't send a bow out if we're not proposing
* Prevent consensus stopping if NetworkOPs switches to disconnect mode while
  consensus accepts a ledger
* Prevent a corner case in which Consensus::gotTxSet or Consensus::peerProposal
  has the potential to update internal state while an dispatched accept job is
  running.
* Distinguish external and internal calls to startNewRound.  Only external
  calls can reset the proposing_ state of consensus

@bachase bachase force-pushed the bachase:consensus-squash branch from d1ed96a to 5b6ae79 Mar 21, 2017

@bachase bachase referenced this pull request Mar 21, 2017

Merged

Proposed 0.70.0-b2 #2061

@bachase

This comment has been minimized.

Copy link
Contributor Author

bachase commented Mar 22, 2017

Merged in 0.70.0-b2 as bc5a740

@bachase bachase closed this Mar 22, 2017

@bachase bachase referenced this pull request Mar 22, 2017

Closed

Consensus refactor #2064

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.