diff --git a/LedgerMaster_8cpp_source.html b/LedgerMaster_8cpp_source.html index 4c2c670359..4a54c829c7 100644 --- a/LedgerMaster_8cpp_source.html +++ b/LedgerMaster_8cpp_source.html @@ -1127,10 +1127,10 @@ $(document).ready(function() { init_codefold(0); });
993 // Check if the majority of validators run a higher version rippled
994 // software. If so print a warning.
995 //
-
996 // Once the HardenedValidations amendment is enabled, validators include
-
997 // their rippled software version in the validation messages of every
-
998 // (flag - 1) ledger. We wait for one ledger time before checking the
-
999 // version information to accumulate more validation messages.
+
996 // Validators include their rippled software version in the validation
+
997 // messages of every (flag - 1) ledger. We wait for one ledger time
+
998 // before checking the version information to accumulate more validation
+
999 // messages.
1000
1001 auto currentTime = app_.timeKeeper().now();
1002 bool needPrint = false;
diff --git a/NetworkOPs_8cpp_source.html b/NetworkOPs_8cpp_source.html index 6182e93a1f..a5ea12df1b 100644 --- a/NetworkOPs_8cpp_source.html +++ b/NetworkOPs_8cpp_source.html @@ -5450,9 +5450,9 @@ $(document).ready(function() { init_codefold(0); });
ripple::Overlay::getPeerDisconnectCharges
virtual std::uint64_t getPeerDisconnectCharges() const =0
ripple::RCLConsensus
Manages the generic consensus algorithm for use by the RCL.
Definition RCLConsensus.h:34
ripple::RCLConsensus::prevProposers
std::size_t prevProposers() const
Get the number of proposing peers that participated in the previous round.
Definition RCLConsensus.h:428
-
ripple::RCLConsensus::simulate
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
Definition RCLConsensus.cpp:962
+
ripple::RCLConsensus::simulate
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
Definition RCLConsensus.cpp:958
ripple::RCLConsensus::prevRoundTime
std::chrono::milliseconds prevRoundTime() const
Get duration of the previous round.
Definition RCLConsensus.h:441
-
ripple::RCLConsensus::getJson
Json::Value getJson(bool full) const
Definition RCLConsensus.cpp:911
+
ripple::RCLConsensus::getJson
Json::Value getJson(bool full) const
Definition RCLConsensus.cpp:907
ripple::RCLCxPeerPos
A peer's signed, proposed position for use in RCLConsensus.
Definition RCLCxPeerPos.h:25
ripple::RCLCxPeerPos::publicKey
PublicKey const & publicKey() const
Public key of peer that sent the proposal.
Definition RCLCxPeerPos.h:59
ripple::RCLTxSet
Represents a set of transactions in RCLConsensus.
Definition RCLCxTx.h:44
diff --git a/RCLConsensus_8cpp_source.html b/RCLConsensus_8cpp_source.html index a0d1e6167e..9344acebd0 100644 --- a/RCLConsensus_8cpp_source.html +++ b/RCLConsensus_8cpp_source.html @@ -951,321 +951,317 @@ $(document).ready(function() { init_codefold(0); });
831 if (proposing)
832 v.setFlag(vfFullValidation);
833
-
834 if (ledger.ledger_->rules().enabled(featureHardenedValidations))
-
835 {
-
836 // Attest to the hash of what we consider to be the last fully
-
837 // validated ledger. This may be the hash of the ledger we are
-
838 // validating here, and that's fine.
-
839 if (auto const vl = ledgerMaster_.getValidatedLedger())
-
840 v.setFieldH256(sfValidatedHash, vl->info().hash);
+
834 // Attest to the hash of what we consider to be the last fully
+
835 // validated ledger. This may be the hash of the ledger we are
+
836 // validating here, and that's fine.
+
837 if (auto const vl = ledgerMaster_.getValidatedLedger())
+
838 v.setFieldH256(sfValidatedHash, vl->info().hash);
+
839
+
840 v.setFieldU64(sfCookie, valCookie_);
841
-
842 v.setFieldU64(sfCookie, valCookie_);
-
843
-
844 // Report our server version every flag ledger:
-
845 if (ledger.ledger_->isVotingLedger())
-
846 v.setFieldU64(
-
847 sfServerVersion, BuildInfo::getEncodedVersion());
-
848 }
-
849
-
850 // Report our load
-
851 {
-
852 auto const& ft = app_.getFeeTrack();
-
853 auto const fee = std::max(ft.getLocalFee(), ft.getClusterFee());
-
854 if (fee > ft.getLoadBase())
-
855 v.setFieldU32(sfLoadFee, fee);
-
856 }
-
857
-
858 // If the next ledger is a flag ledger, suggest fee changes and
-
859 // new features:
-
860 if (ledger.ledger_->isVotingLedger())
-
861 {
-
862 // Fees:
-
863 feeVote_->doValidation(
-
864 ledger.ledger_->fees(), ledger.ledger_->rules(), v);
-
865
-
866 // Amendments
-
867 // FIXME: pass `v` and have the function insert the array
-
868 // directly?
-
869 auto const amendments = app_.getAmendmentTable().doValidation(
-
870 getEnabledAmendments(*ledger.ledger_));
-
871
-
872 if (!amendments.empty())
-
873 v.setFieldV256(
-
874 sfAmendments, STVector256(sfAmendments, amendments));
-
875 }
-
876 });
-
877
-
878 auto const serialized = v->getSerialized();
-
879
-
880 // suppress it if we receive it
-
881 app_.getHashRouter().addSuppression(sha512Half(makeSlice(serialized)));
-
882
-
883 handleNewValidation(app_, v, "local");
-
884
-
885 // Broadcast to all our peers:
-
886 protocol::TMValidation val;
-
887 val.set_validation(serialized.data(), serialized.size());
-
888 app_.overlay().broadcast(val);
+
842 // Report our server version every flag ledger:
+
843 if (ledger.ledger_->isVotingLedger())
+
844 v.setFieldU64(sfServerVersion, BuildInfo::getEncodedVersion());
+
845
+
846 // Report our load
+
847 {
+
848 auto const& ft = app_.getFeeTrack();
+
849 auto const fee = std::max(ft.getLocalFee(), ft.getClusterFee());
+
850 if (fee > ft.getLoadBase())
+
851 v.setFieldU32(sfLoadFee, fee);
+
852 }
+
853
+
854 // If the next ledger is a flag ledger, suggest fee changes and
+
855 // new features:
+
856 if (ledger.ledger_->isVotingLedger())
+
857 {
+
858 // Fees:
+
859 feeVote_->doValidation(
+
860 ledger.ledger_->fees(), ledger.ledger_->rules(), v);
+
861
+
862 // Amendments
+
863 // FIXME: pass `v` and have the function insert the array
+
864 // directly?
+
865 auto const amendments = app_.getAmendmentTable().doValidation(
+
866 getEnabledAmendments(*ledger.ledger_));
+
867
+
868 if (!amendments.empty())
+
869 v.setFieldV256(
+
870 sfAmendments, STVector256(sfAmendments, amendments));
+
871 }
+
872 });
+
873
+
874 auto const serialized = v->getSerialized();
+
875
+
876 // suppress it if we receive it
+
877 app_.getHashRouter().addSuppression(sha512Half(makeSlice(serialized)));
+
878
+
879 handleNewValidation(app_, v, "local");
+
880
+
881 // Broadcast to all our peers:
+
882 protocol::TMValidation val;
+
883 val.set_validation(serialized.data(), serialized.size());
+
884 app_.overlay().broadcast(val);
+
885
+
886 // Publish to all our subscribers:
+
887 app_.getOPs().pubValidation(v);
+
888}
+
889
-
890 // Publish to all our subscribers:
-
891 app_.getOPs().pubValidation(v);
-
892}
+
890void
+
+
891RCLConsensus::Adaptor::onModeChange(ConsensusMode before, ConsensusMode after)
+
892{
+
893 JLOG(j_.info()) << "Consensus mode change before=" << to_string(before)
+
894 << ", after=" << to_string(after);
+
895
+
896 // If we were proposing but aren't any longer, we need to reset the
+
897 // censorship tracking to avoid bogus warnings.
+
898 if ((before == ConsensusMode::proposing ||
+
899 before == ConsensusMode::observing) &&
+
900 before != after)
+
901 censorshipDetector_.reset();
+
902
+
903 mode_ = after;
+
904}
-
893
-
894void
-
-
895RCLConsensus::Adaptor::onModeChange(ConsensusMode before, ConsensusMode after)
-
896{
-
897 JLOG(j_.info()) << "Consensus mode change before=" << to_string(before)
-
898 << ", after=" << to_string(after);
-
899
-
900 // If we were proposing but aren't any longer, we need to reset the
-
901 // censorship tracking to avoid bogus warnings.
-
902 if ((before == ConsensusMode::proposing ||
-
903 before == ConsensusMode::observing) &&
-
904 before != after)
-
905 censorshipDetector_.reset();
-
906
-
907 mode_ = after;
-
908}
+
905
+
906Json::Value
+
+
907RCLConsensus::getJson(bool full) const
+
908{
+
909 Json::Value ret;
+
910 {
+ +
912 ret = consensus_.getJson(full);
+
913 }
+
914 ret["validating"] = adaptor_.validating();
+
915 return ret;
+
916}
-
909
-
910Json::Value
-
-
911RCLConsensus::getJson(bool full) const
-
912{
-
913 Json::Value ret;
-
914 {
- -
916 ret = consensus_.getJson(full);
-
917 }
-
918 ret["validating"] = adaptor_.validating();
-
919 return ret;
-
920}
+
917
+
918void
+
+ +
920 NetClock::time_point const& now,
+ +
922{
+
923 try
+
924 {
+ +
926 consensus_.timerEntry(now, clog);
+
927 }
+
928 catch (SHAMapMissingNode const& mn)
+
929 {
+
930 // This should never happen
+ +
932 ss << "During consensus timerEntry: " << mn.what();
+
933 JLOG(j_.error()) << ss.str();
+
934 CLOG(clog) << ss.str();
+
935 Rethrow();
+
936 }
+
937}
-
921
-
922void
-
- -
924 NetClock::time_point const& now,
- -
926{
-
927 try
-
928 {
- -
930 consensus_.timerEntry(now, clog);
-
931 }
-
932 catch (SHAMapMissingNode const& mn)
-
933 {
-
934 // This should never happen
- -
936 ss << "During consensus timerEntry: " << mn.what();
-
937 JLOG(j_.error()) << ss.str();
-
938 CLOG(clog) << ss.str();
-
939 Rethrow();
-
940 }
-
941}
+
938
+
939void
+
+ +
941{
+
942 try
+
943 {
+ +
945 consensus_.gotTxSet(now, txSet);
+
946 }
+
947 catch (SHAMapMissingNode const& mn)
+
948 {
+
949 // This should never happen
+
950 JLOG(j_.error()) << "During consensus gotTxSet: " << mn.what();
+
951 Rethrow();
+
952 }
+
953}
-
942
-
943void
-
- -
945{
-
946 try
-
947 {
- -
949 consensus_.gotTxSet(now, txSet);
-
950 }
-
951 catch (SHAMapMissingNode const& mn)
-
952 {
-
953 // This should never happen
-
954 JLOG(j_.error()) << "During consensus gotTxSet: " << mn.what();
-
955 Rethrow();
-
956 }
-
957}
+
954
+
956
+
957void
+
+ +
959 NetClock::time_point const& now,
+ +
961{
+ +
963 consensus_.simulate(now, consensusDelay);
+
964}
-
958
-
960
-
961void
-
- -
963 NetClock::time_point const& now,
- -
965{
- -
967 consensus_.simulate(now, consensusDelay);
-
968}
+
965
+
966bool
+
+ +
968 NetClock::time_point const& now,
+
969 RCLCxPeerPos const& newProposal)
+
970{
+ +
972 return consensus_.peerProposal(now, newProposal);
+
973}
-
969
-
970bool
-
- -
972 NetClock::time_point const& now,
-
973 RCLCxPeerPos const& newProposal)
-
974{
- -
976 return consensus_.peerProposal(now, newProposal);
-
977}
+
974
+
975bool
+
+ +
977 RCLCxLedger const& prevLgr,
+
978 hash_set<NodeID> const& nowTrusted)
+
979{
+
980 // We have a key, we do not want out of sync validations after a restart
+
981 // and are not amendment blocked.
+
982 validating_ = validatorKeys_.keys &&
+
983 prevLgr.seq() >= app_.getMaxDisallowedLedger() &&
+
984 !app_.getOPs().isBlocked();
+
985
+
986 // If we are not running in standalone mode and there's a configured UNL,
+
987 // check to make sure that it's not expired.
+
988 if (validating_ && !app_.config().standalone() && app_.validators().count())
+
989 {
+
990 auto const when = app_.validators().expires();
+
991
+
992 if (!when || *when < app_.timeKeeper().now())
+
993 {
+
994 JLOG(j_.error()) << "Voluntarily bowing out of consensus process "
+
995 "because of an expired validator list.";
+
996 validating_ = false;
+
997 }
+
998 }
+
999
+
1000 bool const synced = app_.getOPs().getOperatingMode() == OperatingMode::FULL;
+
1001
+
1002 if (validating_)
+
1003 {
+
1004 JLOG(j_.info()) << "Entering consensus process, validating, synced="
+
1005 << (synced ? "yes" : "no");
+
1006 }
+
1007 else
+
1008 {
+
1009 // Otherwise we just want to monitor the validation process.
+
1010 JLOG(j_.info()) << "Entering consensus process, watching, synced="
+
1011 << (synced ? "yes" : "no");
+
1012 }
+
1013
+
1014 // Notify inbound ledgers that we are starting a new round
+
1015 inboundTransactions_.newRound(prevLgr.seq());
+
1016
+
1017 // Notify NegativeUNLVote that new validators are added
+
1018 if (prevLgr.ledger_->rules().enabled(featureNegativeUNL) &&
+
1019 !nowTrusted.empty())
+
1020 nUnlVote_.newValidators(prevLgr.seq() + 1, nowTrusted);
+
1021
+
1022 // propose only if we're in sync with the network (and validating)
+
1023 return validating_ && synced;
+
1024}
-
978
-
979bool
-
- -
981 RCLCxLedger const& prevLgr,
-
982 hash_set<NodeID> const& nowTrusted)
-
983{
-
984 // We have a key, we do not want out of sync validations after a restart
-
985 // and are not amendment blocked.
-
986 validating_ = validatorKeys_.keys &&
-
987 prevLgr.seq() >= app_.getMaxDisallowedLedger() &&
-
988 !app_.getOPs().isBlocked();
-
989
-
990 // If we are not running in standalone mode and there's a configured UNL,
-
991 // check to make sure that it's not expired.
-
992 if (validating_ && !app_.config().standalone() && app_.validators().count())
-
993 {
-
994 auto const when = app_.validators().expires();
-
995
-
996 if (!when || *when < app_.timeKeeper().now())
-
997 {
-
998 JLOG(j_.error()) << "Voluntarily bowing out of consensus process "
-
999 "because of an expired validator list.";
-
1000 validating_ = false;
-
1001 }
-
1002 }
-
1003
-
1004 bool const synced = app_.getOPs().getOperatingMode() == OperatingMode::FULL;
-
1005
-
1006 if (validating_)
-
1007 {
-
1008 JLOG(j_.info()) << "Entering consensus process, validating, synced="
-
1009 << (synced ? "yes" : "no");
-
1010 }
-
1011 else
-
1012 {
-
1013 // Otherwise we just want to monitor the validation process.
-
1014 JLOG(j_.info()) << "Entering consensus process, watching, synced="
-
1015 << (synced ? "yes" : "no");
-
1016 }
-
1017
-
1018 // Notify inbound ledgers that we are starting a new round
-
1019 inboundTransactions_.newRound(prevLgr.seq());
-
1020
-
1021 // Notify NegativeUNLVote that new validators are added
-
1022 if (prevLgr.ledger_->rules().enabled(featureNegativeUNL) &&
-
1023 !nowTrusted.empty())
-
1024 nUnlVote_.newValidators(prevLgr.seq() + 1, nowTrusted);
1025
-
1026 // propose only if we're in sync with the network (and validating)
-
1027 return validating_ && synced;
-
1028}
+
1026bool
+
+ +
1028{
+
1029 return ledgerMaster_.haveValidated();
+
1030}
-
1029
-
1030bool
-
- -
1032{
-
1033 return ledgerMaster_.haveValidated();
-
1034}
+
1031
+ +
+ +
1034{
+
1035 return ledgerMaster_.getValidLedgerIndex();
+
1036}
-
1035
- -
- -
1038{
-
1039 return ledgerMaster_.getValidLedgerIndex();
-
1040}
+
1037
+ +
+ +
1040{
+
1041 return app_.validators().getQuorumKeys();
+
1042}
-
1041
- -
- -
1044{
-
1045 return app_.validators().getQuorumKeys();
-
1046}
+
1043
+ +
+ +
1046 Ledger_t::Seq const seq,
+ +
1048{
+
1049 return app_.getValidations().laggards(seq, trustedKeys);
+
1050}
-
1047
- -
- -
1050 Ledger_t::Seq const seq,
- -
1052{
-
1053 return app_.getValidations().laggards(seq, trustedKeys);
-
1054}
+
1051
+
1052bool
+
+ +
1054{
+
1055 return validatorKeys_.keys.has_value();
+
1056}
-
1055
-
1056bool
-
- -
1058{
-
1059 return validatorKeys_.keys.has_value();
-
1060}
+
1057
+
1058void
+
+ +
1060{
+
1061 if (!positions && app_.getOPs().isFull())
+
1062 app_.getOPs().setMode(OperatingMode::CONNECTED);
+
1063}
-
1061
-
1062void
-
- -
1064{
-
1065 if (!positions && app_.getOPs().isFull())
-
1066 app_.getOPs().setMode(OperatingMode::CONNECTED);
-
1067}
+
1064
+
1065void
+
+ +
1067 NetClock::time_point const& now,
+
1068 RCLCxLedger::ID const& prevLgrId,
+
1069 RCLCxLedger const& prevLgr,
+
1070 hash_set<NodeID> const& nowUntrusted,
+
1071 hash_set<NodeID> const& nowTrusted,
+ +
1073{
+ +
1075 consensus_.startRound(
+
1076 now,
+
1077 prevLgrId,
+
1078 prevLgr,
+
1079 nowUntrusted,
+
1080 adaptor_.preStartRound(prevLgr, nowTrusted),
+
1081 clog);
+
1082}
-
1068
-
1069void
-
- -
1071 NetClock::time_point const& now,
-
1072 RCLCxLedger::ID const& prevLgrId,
-
1073 RCLCxLedger const& prevLgr,
-
1074 hash_set<NodeID> const& nowUntrusted,
-
1075 hash_set<NodeID> const& nowTrusted,
- -
1077{
- -
1079 consensus_.startRound(
-
1080 now,
-
1081 prevLgrId,
-
1082 prevLgr,
-
1083 nowUntrusted,
-
1084 adaptor_.preStartRound(prevLgr, nowTrusted),
-
1085 clog);
-
1086}
+
1083
+
+ +
1085 char const* label,
+
1086 bool const validating,
+ +
1088 : j_(j)
+
1089{
+
1090 if (!validating && !j.info())
+
1091 return;
+ + +
1094 header_ = "ConsensusLogger ";
+
1095 header_ += label;
+
1096 header_ += ": ";
+
1097}
-
1087
-
- -
1089 char const* label,
-
1090 bool const validating,
- -
1092 : j_(j)
-
1093{
-
1094 if (!validating && !j.info())
-
1095 return;
- - -
1098 header_ = "ConsensusLogger ";
-
1099 header_ += label;
-
1100 header_ += ": ";
-
1101}
+
1098
+
+ +
1100{
+
1101 if (!ss_)
+
1102 return;
+
1103 auto const duration = std::chrono::duration_cast<std::chrono::milliseconds>(
+ +
1105 std::stringstream outSs;
+
1106 outSs << header_ << "duration " << (duration.count() / 1000) << '.'
+
1107 << std::setw(3) << std::setfill('0') << (duration.count() % 1000)
+
1108 << "s. " << ss_->str();
+ +
1110}
-
1102
-
- -
1104{
-
1105 if (!ss_)
-
1106 return;
-
1107 auto const duration = std::chrono::duration_cast<std::chrono::milliseconds>(
- -
1109 std::stringstream outSs;
-
1110 outSs << header_ << "duration " << (duration.count() / 1000) << '.'
-
1111 << std::setw(3) << std::setfill('0') << (duration.count() % 1000)
-
1112 << "s. " << ss_->str();
- -
1114}
-
-
1115
-
1116} // namespace ripple
+
1111
+
1112} // namespace ripple
@@ -1301,40 +1297,40 @@ $(document).ready(function() { init_codefold(0); });
void doAccept(Result const &result, RCLCxLedger const &prevLedger, NetClock::duration closeResolution, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode, Json::Value &&consensusJson)
Accept a new ledger based on the given transactions.
Adaptor(Application &app, std::unique_ptr< FeeVote > &&feeVote, LedgerMaster &ledgerMaster, LocalTxs &localTxs, InboundTransactions &inboundTransactions, ValidatorKeys const &validatorKeys, beast::Journal journal)
-
void onModeChange(ConsensusMode before, ConsensusMode after)
Notified of change in consensus mode.
-
std::size_t laggards(Ledger_t::Seq const seq, hash_set< NodeKey_t > &trustedKeys) const
+
void onModeChange(ConsensusMode before, ConsensusMode after)
Notified of change in consensus mode.
+
std::size_t laggards(Ledger_t::Seq const seq, hash_set< NodeKey_t > &trustedKeys) const
RCLCensorshipDetector< TxID, LedgerIndex > censorshipDetector_
void onForceAccept(Result const &result, RCLCxLedger const &prevLedger, NetClock::duration const &closeResolution, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode, Json::Value &&consensusJson)
Process the accepted ledger that was a result of simulation/force accept.
-
bool validator() const
Whether I am a validator.
+
bool validator() const
Whether I am a validator.
RCLCxLedger buildLCL(RCLCxLedger const &previousLedger, CanonicalTXSet &retriableTxs, NetClock::time_point closeTime, bool closeTimeCorrect, NetClock::duration closeResolution, std::chrono::milliseconds roundTime, std::set< TxID > &failedTxs)
Build the new last closed ledger.
std::optional< RCLCxLedger > acquireLedger(LedgerHash const &hash)
Attempt to acquire a specific ledger.
-
LedgerIndex getValidLedgerIndex() const
+
LedgerIndex getValidLedgerIndex() const
std::size_t proposersFinished(RCLCxLedger const &ledger, LedgerHash const &h) const
Number of proposers that have validated a ledger descended from requested ledger.
std::optional< RCLTxSet > acquireTxSet(RCLTxSet::ID const &setId)
Acquire the transaction set associated with a proposal.
bool hasOpenTransactions() const
Whether the open ledger has any transactions.
- +
void onAccept(Result const &result, RCLCxLedger const &prevLedger, NetClock::duration const &closeResolution, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode, Json::Value &&consensusJson, bool const validating)
Process the accepted ledger.
void validate(RCLCxLedger const &ledger, RCLTxSet const &txns, bool proposing)
Validate the given ledger and share with peers as necessary.
std::uint64_t const valCookie_
-
bool preStartRound(RCLCxLedger const &prevLedger, hash_set< NodeID > const &nowTrusted)
Called before kicking off a new consensus round.
+
bool preStartRound(RCLCxLedger const &prevLedger, hash_set< NodeID > const &nowTrusted)
Called before kicking off a new consensus round.
uint256 getPrevLedger(uint256 ledgerID, RCLCxLedger const &ledger, ConsensusMode mode)
Get the ID of the previous ledger/last closed ledger(LCL) on the network.
std::size_t proposersValidated(LedgerHash const &h) const
Number of proposers that have validated the given ledger.
void notify(protocol::NodeEvent ne, RCLCxLedger const &ledger, bool haveCorrectLCL)
Notify peers of a consensus state change.
-
void updateOperatingMode(std::size_t const positions) const
Update operating mode based on current peer positions.
-
std::pair< std::size_t, hash_set< NodeKey_t > > getQuorumKeys() const
-
void gotTxSet(NetClock::time_point const &now, RCLTxSet const &txSet)
-
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
+
void updateOperatingMode(std::size_t const positions) const
Update operating mode based on current peer positions.
+
std::pair< std::size_t, hash_set< NodeKey_t > > getQuorumKeys() const
+
void gotTxSet(NetClock::time_point const &now, RCLTxSet const &txSet)
+
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
bool validating() const
Whether we are validating consensus ledgers.
RCLConsensus(Application &app, std::unique_ptr< FeeVote > &&feeVote, LedgerMaster &ledgerMaster, LocalTxs &localTxs, InboundTransactions &inboundTransactions, Consensus< Adaptor >::clock_type const &clock, ValidatorKeys const &validatorKeys, beast::Journal journal)
Constructor.
ConsensusMode mode() const
static constexpr unsigned int censorshipWarnInternal
Warn for transactions that haven't been included every so many ledgers.
std::recursive_mutex mutex_
Consensus< Adaptor > consensus_
-
bool peerProposal(NetClock::time_point const &now, RCLCxPeerPos const &newProposal)
-
void startRound(NetClock::time_point const &now, RCLCxLedger::ID const &prevLgrId, RCLCxLedger const &prevLgr, hash_set< NodeID > const &nowUntrusted, hash_set< NodeID > const &nowTrusted, std::unique_ptr< std::stringstream > const &clog)
Adjust the set of trusted validators and kick-off the next round of consensus.
-
void timerEntry(NetClock::time_point const &now, std::unique_ptr< std::stringstream > const &clog={})
+
bool peerProposal(NetClock::time_point const &now, RCLCxPeerPos const &newProposal)
+
void startRound(NetClock::time_point const &now, RCLCxLedger::ID const &prevLgrId, RCLCxLedger const &prevLgr, hash_set< NodeID > const &nowUntrusted, hash_set< NodeID > const &nowTrusted, std::unique_ptr< std::stringstream > const &clog)
Adjust the set of trusted validators and kick-off the next round of consensus.
+
void timerEntry(NetClock::time_point const &now, std::unique_ptr< std::stringstream > const &clog={})
-
Json::Value getJson(bool full) const
+
Json::Value getJson(bool full) const
beast::Journal const j_
Represents a ledger in RCLConsensus.
Definition RCLCxLedger.h:17
Seq const & seq() const
Sequence number of the ledger.
Definition RCLCxLedger.h:42
@@ -1357,10 +1353,10 @@ $(document).ready(function() { init_codefold(0); });
beast::Journal journal() const
Collects logging information.
std::unique_ptr< std::stringstream > const & ss()
-
RclConsensusLogger(char const *label, bool validating, beast::Journal j)
+
RclConsensusLogger(char const *label, bool validating, beast::Journal j)
- +
std::chrono::steady_clock::time_point start_
std::unique_ptr< std::stringstream > ss_
diff --git a/RCLConsensus_8h_source.html b/RCLConsensus_8h_source.html index 688e8cc25c..8a592f72c3 100644 --- a/RCLConsensus_8h_source.html +++ b/RCLConsensus_8h_source.html @@ -514,16 +514,16 @@ $(document).ready(function() { init_codefold(0); });
ConsensusMode mode() const
std::chrono::milliseconds prevRoundTime() const
-
void onModeChange(ConsensusMode before, ConsensusMode after)
Notified of change in consensus mode.
-
std::size_t laggards(Ledger_t::Seq const seq, hash_set< NodeKey_t > &trustedKeys) const
+
void onModeChange(ConsensusMode before, ConsensusMode after)
Notified of change in consensus mode.
+
std::size_t laggards(Ledger_t::Seq const seq, hash_set< NodeKey_t > &trustedKeys) const
RCLCensorshipDetector< TxID, LedgerIndex > censorshipDetector_
void onForceAccept(Result const &result, RCLCxLedger const &prevLedger, NetClock::duration const &closeResolution, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode, Json::Value &&consensusJson)
Process the accepted ledger that was a result of simulation/force accept.
-
bool validator() const
Whether I am a validator.
+
bool validator() const
Whether I am a validator.
RCLCxLedger buildLCL(RCLCxLedger const &previousLedger, CanonicalTXSet &retriableTxs, NetClock::time_point closeTime, bool closeTimeCorrect, NetClock::duration closeResolution, std::chrono::milliseconds roundTime, std::set< TxID > &failedTxs)
Build the new last closed ledger.
std::optional< RCLCxLedger > acquireLedger(LedgerHash const &hash)
Attempt to acquire a specific ledger.
std::unique_ptr< FeeVote > feeVote_
-
LedgerIndex getValidLedgerIndex() const
+
LedgerIndex getValidLedgerIndex() const
std::size_t proposersFinished(RCLCxLedger const &ledger, LedgerHash const &h) const
Number of proposers that have validated a ledger descended from requested ledger.
@@ -533,24 +533,24 @@ $(document).ready(function() { init_codefold(0); });
std::optional< RCLTxSet > acquireTxSet(RCLTxSet::ID const &setId)
Acquire the transaction set associated with a proposal.
bool hasOpenTransactions() const
Whether the open ledger has any transactions.
- +
void onAccept(Result const &result, RCLCxLedger const &prevLedger, NetClock::duration const &closeResolution, ConsensusCloseTimes const &rawCloseTimes, ConsensusMode const &mode, Json::Value &&consensusJson, bool const validating)
Process the accepted ledger.
void validate(RCLCxLedger const &ledger, RCLTxSet const &txns, bool proposing)
Validate the given ledger and share with peers as necessary.
std::atomic< std::chrono::milliseconds > prevRoundTime_
std::uint64_t const valCookie_
-
bool preStartRound(RCLCxLedger const &prevLedger, hash_set< NodeID > const &nowTrusted)
Called before kicking off a new consensus round.
+
bool preStartRound(RCLCxLedger const &prevLedger, hash_set< NodeID > const &nowTrusted)
Called before kicking off a new consensus round.
uint256 getPrevLedger(uint256 ledgerID, RCLCxLedger const &ledger, ConsensusMode mode)
Get the ID of the previous ledger/last closed ledger(LCL) on the network.
std::size_t proposersValidated(LedgerHash const &h) const
Number of proposers that have validated the given ledger.
std::atomic< bool > validating_
void notify(protocol::NodeEvent ne, RCLCxLedger const &ledger, bool haveCorrectLCL)
Notify peers of a consensus state change.
-
void updateOperatingMode(std::size_t const positions) const
Update operating mode based on current peer positions.
+
void updateOperatingMode(std::size_t const positions) const
Update operating mode based on current peer positions.
-
std::pair< std::size_t, hash_set< NodeKey_t > > getQuorumKeys() const
+
std::pair< std::size_t, hash_set< NodeKey_t > > getQuorumKeys() const
Manages the generic consensus algorithm for use by the RCL.
RCLConsensus(RCLConsensus const &)=delete
-
void gotTxSet(NetClock::time_point const &now, RCLTxSet const &txSet)
+
void gotTxSet(NetClock::time_point const &now, RCLTxSet const &txSet)
std::size_t prevProposers() const
Get the number of proposing peers that participated in the previous round.
-
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
+
void simulate(NetClock::time_point const &now, std::optional< std::chrono::milliseconds > consensusDelay)
ConsensusPhase phase() const
bool validating() const
Whether we are validating consensus ledgers.
RCLConsensus & operator=(RCLConsensus const &)=delete
@@ -559,12 +559,12 @@ $(document).ready(function() { init_codefold(0); });
static constexpr unsigned int censorshipWarnInternal
Warn for transactions that haven't been included every so many ledgers.
std::recursive_mutex mutex_
Consensus< Adaptor > consensus_
-
bool peerProposal(NetClock::time_point const &now, RCLCxPeerPos const &newProposal)
-
void startRound(NetClock::time_point const &now, RCLCxLedger::ID const &prevLgrId, RCLCxLedger const &prevLgr, hash_set< NodeID > const &nowUntrusted, hash_set< NodeID > const &nowTrusted, std::unique_ptr< std::stringstream > const &clog)
Adjust the set of trusted validators and kick-off the next round of consensus.
-
void timerEntry(NetClock::time_point const &now, std::unique_ptr< std::stringstream > const &clog={})
+
bool peerProposal(NetClock::time_point const &now, RCLCxPeerPos const &newProposal)
+
void startRound(NetClock::time_point const &now, RCLCxLedger::ID const &prevLgrId, RCLCxLedger const &prevLgr, hash_set< NodeID > const &nowUntrusted, hash_set< NodeID > const &nowTrusted, std::unique_ptr< std::stringstream > const &clog)
Adjust the set of trusted validators and kick-off the next round of consensus.
+
void timerEntry(NetClock::time_point const &now, std::unique_ptr< std::stringstream > const &clog={})
ConsensusParms const & parms() const
-
Json::Value getJson(bool full) const
+
Json::Value getJson(bool full) const
RCLCxLedger::ID prevLedgerID() const
beast::Journal const j_
Represents a ledger in RCLConsensus.
Definition RCLCxLedger.h:17
@@ -577,7 +577,7 @@ $(document).ready(function() { init_codefold(0); });
std::unique_ptr< std::stringstream > const & ss()
- +
std::chrono::steady_clock::time_point start_
std::unique_ptr< std::stringstream > ss_
Validator keys and manifest as set in configuration file.
diff --git a/STValidation_8cpp_source.html b/STValidation_8cpp_source.html index 9affcb89de..584b7c6b15 100644 --- a/STValidation_8cpp_source.html +++ b/STValidation_8cpp_source.html @@ -139,109 +139,108 @@ $(document).ready(function() { init_codefold(0); });
51 {sfSigningPubKey, soeREQUIRED},
52 {sfSignature, soeREQUIRED},
53 {sfConsensusHash, soeOPTIONAL},
-
54 // featureHardenedValidations
-
55 {sfCookie, soeDEFAULT},
-
56 {sfValidatedHash, soeOPTIONAL},
-
57 {sfServerVersion, soeOPTIONAL},
-
58 // featureXRPFees
-
59 {sfBaseFeeDrops, soeOPTIONAL},
-
60 {sfReserveBaseDrops, soeOPTIONAL},
-
61 {sfReserveIncrementDrops, soeOPTIONAL},
-
62 };
-
63 // clang-format on
-
64
-
65 return format;
-
66};
+
54 {sfCookie, soeDEFAULT},
+
55 {sfValidatedHash, soeOPTIONAL},
+
56 {sfServerVersion, soeOPTIONAL},
+
57 // featureXRPFees
+
58 {sfBaseFeeDrops, soeOPTIONAL},
+
59 {sfReserveBaseDrops, soeOPTIONAL},
+
60 {sfReserveIncrementDrops, soeOPTIONAL},
+
61 };
+
62 // clang-format on
+
63
+
64 return format;
+
65};
-
67
- -
- -
70{
- -
72}
+
66
+ + -
73
- -
- -
76{
-
77 return getFieldH256(sfLedgerHash);
-
78}
+
72
+ +
+ +
75{
+
76 return getFieldH256(sfLedgerHash);
+
77}
-
79
- -
- -
82{
-
83 return getFieldH256(sfConsensusHash);
-
84}
+
78
+ +
+ +
81{
+
82 return getFieldH256(sfConsensusHash);
+
83}
-
85
- -
- -
88{
- -
90}
+
84
+ +
+ +
87{
+ +
89}
-
91
- -
- -
94{
-
95 return seenTime_;
-
96}
+
90
+ +
+ +
93{
+
94 return seenTime_;
+
95}
-
97
-
98bool
-
-
99STValidation::isValid() const noexcept
-
100{
-
101 if (!valid_)
-
102 {
-
103 XRPL_ASSERT(
- -
105 "ripple::STValidation::isValid : valid key type");
-
106
- - - -
110 makeSlice(getFieldVL(sfSignature)),
- -
112 }
-
113
-
114 return valid_.value();
-
115}
+
96
+
97bool
+
+
98STValidation::isValid() const noexcept
+
99{
+
100 if (!valid_)
+
101 {
+
102 XRPL_ASSERT(
+ +
104 "ripple::STValidation::isValid : valid key type");
+
105
+ + + +
109 makeSlice(getFieldVL(sfSignature)),
+ +
111 }
+
112
+
113 return valid_.value();
+
114}
-
116
-
117bool
-
-
118STValidation::isFull() const noexcept
-
119{
-
120 return (getFlags() & vfFullValidation) != 0;
-
121}
+
115
+
116bool
+
+
117STValidation::isFull() const noexcept
+
118{
+
119 return (getFlags() & vfFullValidation) != 0;
+
120}
-
122
-
123Blob
-
- -
125{
-
126 return getFieldVL(sfSignature);
-
127}
+
121
+
122Blob
+
+ +
124{
+
125 return getFieldVL(sfSignature);
+
126}
-
128
-
129Blob
-
- -
131{
-
132 Serializer s;
-
133 add(s);
-
134 return s.peekData();
-
135}
+
127
+
128Blob
+
+ +
130{
+
131 Serializer s;
+
132 add(s);
+
133 return s.peekData();
+
134}
-
136
-
137} // namespace ripple
+
135
+
136} // namespace ripple
Defines the fields and their attributes within a STObject.
Definition SOTemplate.h:94
A type which can be exported to a well known binary format.
Definition STBase.h:116
static STBase * emplace(std::size_t n, void *buf, T &&val)
Definition STBase.h:214
@@ -252,20 +251,20 @@ $(document).ready(function() { init_codefold(0); });
std::uint32_t getFlags() const
Definition STObject.cpp:518
uint256 getFieldH256(SField const &field) const
Definition STObject.cpp:626
PublicKey const & getSignerPublic() const noexcept
-
uint256 getConsensusHash() const
+
uint256 getConsensusHash() const
std::optional< bool > valid_
-
Blob getSerialized() const
-
NetClock::time_point getSeenTime() const noexcept
+
Blob getSerialized() const
+
NetClock::time_point getSeenTime() const noexcept
static SOTemplate const & validationFormat()
-
bool isFull() const noexcept
+
bool isFull() const noexcept
NetClock::time_point seenTime_
STBase * copy(std::size_t n, void *buf) const override
-
uint256 getLedgerHash() const
-
bool isValid() const noexcept
-
uint256 getSigningHash() const
-
Blob getSignature() const
+
uint256 getLedgerHash() const
+
bool isValid() const noexcept
+
uint256 getSigningHash() const
+
Blob getSignature() const
STBase * move(std::size_t n, void *buf) override
-
NetClock::time_point getSignTime() const
+
NetClock::time_point getSignTime() const
Blob const & peekData() const
Definition Serializer.h:183
diff --git a/STValidation_8h_source.html b/STValidation_8h_source.html index b5aab76ed9..b101a37a9b 100644 --- a/STValidation_8h_source.html +++ b/STValidation_8h_source.html @@ -361,28 +361,28 @@ $(document).ready(function() { init_codefold(0); });
PublicKey const & getSignerPublic() const noexcept
-
uint256 getConsensusHash() const
+
uint256 getConsensusHash() const
std::string render() const
std::optional< bool > valid_
STValidation(SerialIter &sit, LookupNodeID &&lookupNodeID, bool checkSignature)
Construct a STValidation from a peer from serialized data.
-
Blob getSerialized() const
-
NetClock::time_point getSeenTime() const noexcept
+
Blob getSerialized() const
+
NetClock::time_point getSeenTime() const noexcept
void setSeen(NetClock::time_point s)
bool isTrusted() const noexcept
NodeID const nodeID_
PublicKey const signingPubKey_
static SOTemplate const & validationFormat()
NodeID const & getNodeID() const noexcept
-
bool isFull() const noexcept
+
bool isFull() const noexcept
NetClock::time_point seenTime_
STBase * copy(std::size_t n, void *buf) const override
-
uint256 getLedgerHash() const
-
bool isValid() const noexcept
-
uint256 getSigningHash() const
-
Blob getSignature() const
+
uint256 getLedgerHash() const
+
bool isValid() const noexcept
+
uint256 getSigningHash() const
+
Blob getSignature() const
STBase * move(std::size_t n, void *buf) override
-
NetClock::time_point getSignTime() const
+
NetClock::time_point getSignTime() const
A secret key.
Definition SecretKey.h:19
diff --git a/classripple_1_1RCLConsensus.html b/classripple_1_1RCLConsensus.html index ef9c671fef..d09a42d4f6 100644 --- a/classripple_1_1RCLConsensus.html +++ b/classripple_1_1RCLConsensus.html @@ -531,7 +531,7 @@ Static Private Attributes
See also
Consensus::getJson
-

Definition at line 911 of file RCLConsensus.cpp.

+

Definition at line 907 of file RCLConsensus.cpp.

@@ -588,7 +588,7 @@ Static Private Attributes

Adjust the set of trusted validators and kick-off the next round of consensus.

For more details,

See also
Consensus::startRound
-

Definition at line 1070 of file RCLConsensus.cpp.

+

Definition at line 1066 of file RCLConsensus.cpp.

@@ -619,7 +619,7 @@ Static Private Attributes
See also
Consensus::timerEntry
-

Definition at line 923 of file RCLConsensus.cpp.

+

Definition at line 919 of file RCLConsensus.cpp.

@@ -650,7 +650,7 @@ Static Private Attributes
See also
Consensus::gotTxSet
-

Definition at line 944 of file RCLConsensus.cpp.

+

Definition at line 940 of file RCLConsensus.cpp.

@@ -700,7 +700,7 @@ Static Private Attributes
See also
Consensus::simulate
-

Definition at line 962 of file RCLConsensus.cpp.

+

Definition at line 958 of file RCLConsensus.cpp.

@@ -731,7 +731,7 @@ Static Private Attributes
See also
Consensus::proposal
-

Definition at line 971 of file RCLConsensus.cpp.

+

Definition at line 967 of file RCLConsensus.cpp.

diff --git a/classripple_1_1RCLConsensus_1_1Adaptor.html b/classripple_1_1RCLConsensus_1_1Adaptor.html index 6597f9068a..0f2e1caa37 100644 --- a/classripple_1_1RCLConsensus_1_1Adaptor.html +++ b/classripple_1_1RCLConsensus_1_1Adaptor.html @@ -641,7 +641,7 @@ Friends
Returns
Whether we enter the round proposing
-

Definition at line 980 of file RCLConsensus.cpp.

+

Definition at line 976 of file RCLConsensus.cpp.

@@ -660,7 +660,7 @@ Friends
-

Definition at line 1031 of file RCLConsensus.cpp.

+

Definition at line 1027 of file RCLConsensus.cpp.

@@ -679,7 +679,7 @@ Friends
-

Definition at line 1037 of file RCLConsensus.cpp.

+

Definition at line 1033 of file RCLConsensus.cpp.

@@ -698,7 +698,7 @@ Friends
-

Definition at line 1043 of file RCLConsensus.cpp.

+

Definition at line 1039 of file RCLConsensus.cpp.

@@ -728,7 +728,7 @@ Friends
-

Definition at line 1049 of file RCLConsensus.cpp.

+

Definition at line 1045 of file RCLConsensus.cpp.

@@ -750,7 +750,7 @@ Friends

Whether I am a validator.

Returns
whether I am a validator.
-

Definition at line 1057 of file RCLConsensus.cpp.

+

Definition at line 1053 of file RCLConsensus.cpp.

@@ -779,7 +779,7 @@ Friends -

Definition at line 1063 of file RCLConsensus.cpp.

+

Definition at line 1059 of file RCLConsensus.cpp.

@@ -1238,7 +1238,7 @@ Friends -

Definition at line 895 of file RCLConsensus.cpp.

+

Definition at line 891 of file RCLConsensus.cpp.

diff --git a/classripple_1_1RclConsensusLogger.html b/classripple_1_1RclConsensusLogger.html index d021298a45..a2308b8cd7 100644 --- a/classripple_1_1RclConsensusLogger.html +++ b/classripple_1_1RclConsensusLogger.html @@ -185,7 +185,7 @@ Private Attributes
-

Definition at line 1088 of file RCLConsensus.cpp.

+

Definition at line 1084 of file RCLConsensus.cpp.

@@ -204,7 +204,7 @@ Private Attributes
-

Definition at line 1103 of file RCLConsensus.cpp.

+

Definition at line 1099 of file RCLConsensus.cpp.

diff --git a/classripple_1_1STValidation.html b/classripple_1_1STValidation.html index 73c64eaf80..66e52ebc6e 100644 --- a/classripple_1_1STValidation.html +++ b/classripple_1_1STValidation.html @@ -749,7 +749,7 @@ template<typename F >
-

Definition at line 75 of file STValidation.cpp.

+

Definition at line 74 of file STValidation.cpp.

@@ -768,7 +768,7 @@ template<typename F >
-

Definition at line 81 of file STValidation.cpp.

+

Definition at line 80 of file STValidation.cpp.

@@ -787,7 +787,7 @@ template<typename F >
-

Definition at line 87 of file STValidation.cpp.

+

Definition at line 86 of file STValidation.cpp.

@@ -814,7 +814,7 @@ template<typename F >
-

Definition at line 93 of file STValidation.cpp.

+

Definition at line 92 of file STValidation.cpp.

@@ -895,7 +895,7 @@ template<typename F >
-

Definition at line 99 of file STValidation.cpp.

+

Definition at line 98 of file STValidation.cpp.

@@ -922,7 +922,7 @@ template<typename F >
-

Definition at line 118 of file STValidation.cpp.

+

Definition at line 117 of file STValidation.cpp.

@@ -968,7 +968,7 @@ template<typename F >
-

Definition at line 69 of file STValidation.cpp.

+

Definition at line 68 of file STValidation.cpp.

@@ -1045,7 +1045,7 @@ template<typename F >
-

Definition at line 130 of file STValidation.cpp.

+

Definition at line 129 of file STValidation.cpp.

@@ -1064,7 +1064,7 @@ template<typename F >
-

Definition at line 124 of file STValidation.cpp.

+

Definition at line 123 of file STValidation.cpp.