Remove conditionals for fix1528 enabled 14Nov2017

This commit is contained in:
Scott Schurr
2020-02-28 14:48:24 -08:00
parent 323dbc7962
commit 8cf7c9548a
6 changed files with 93 additions and 163 deletions

View File

@@ -119,9 +119,6 @@ RCLConsensus::Adaptor::acquireLedger(LedgerHash const& hash)
// Notify inbound transactions of the new ledger sequence number // Notify inbound transactions of the new ledger sequence number
inboundTransactions_.newRound(built->info().seq); inboundTransactions_.newRound(built->info().seq);
// Use the ledger timing rules of the acquired ledger
parms_.useRoundedCloseTime = built->rules().enabled(fix1528);
return RCLCxLedger(built); return RCLCxLedger(built);
} }
@@ -913,9 +910,6 @@ RCLConsensus::Adaptor::preStartRound(RCLCxLedger const & prevLgr)
// Notify inbound ledgers that we are starting a new round // Notify inbound ledgers that we are starting a new round
inboundTransactions_.newRound(prevLgr.seq()); inboundTransactions_.newRound(prevLgr.seq());
// Use parent ledger's rules to determine whether to use rounded close time
parms_.useRoundedCloseTime = prevLgr.ledger_->rules().enabled(fix1528);
// propose only if we're in sync with the network (and validating) // propose only if we're in sync with the network (and validating)
return validating_ && synced; return validating_ && synced;
} }

View File

@@ -1697,10 +1697,7 @@ template <class Adaptor>
NetClock::time_point NetClock::time_point
Consensus<Adaptor>::asCloseTime(NetClock::time_point raw) const Consensus<Adaptor>::asCloseTime(NetClock::time_point raw) const
{ {
if (adaptor_.parms().useRoundedCloseTime)
return roundCloseTime(raw, closeResolution_); return roundCloseTime(raw, closeResolution_);
else
return effCloseTime(raw, closeResolution_, previousLedger_.closeTime());
} }
} // namespace ripple } // namespace ripple

View File

@@ -138,17 +138,6 @@ struct ConsensusParms
//! Percentage of nodes required to reach agreement on ledger close time //! Percentage of nodes required to reach agreement on ledger close time
std::size_t avCT_CONSENSUS_PCT = 75; std::size_t avCT_CONSENSUS_PCT = 75;
//--------------------------------------------------------------------------
/** Whether to use roundCloseTime or effCloseTime for reaching close time
consensus.
This was added to migrate from effCloseTime to roundCloseTime on the
live network. The desired behavior (as given by the default value) is
to use roundCloseTime during consensus voting and then use effCloseTime
when accepting the consensus ledger.
*/
bool useRoundedCloseTime = true;
}; };
} // ripple } // ripple

View File

@@ -381,7 +381,7 @@ extern uint256 const fix1201;
extern uint256 const fix1512; extern uint256 const fix1512;
extern uint256 const fix1513; extern uint256 const fix1513;
extern uint256 const fix1523; extern uint256 const fix1523;
extern uint256 const fix1528; extern uint256 const retiredFix1528;
extern uint256 const featureDepositAuth; extern uint256 const featureDepositAuth;
extern uint256 const featureChecks; extern uint256 const featureChecks;
extern uint256 const fix1571; extern uint256 const fix1571;

View File

@@ -172,7 +172,7 @@ uint256 const fix1201 = *getRegisteredFeature("fix1201");
uint256 const fix1512 = *getRegisteredFeature("fix1512"); uint256 const fix1512 = *getRegisteredFeature("fix1512");
uint256 const fix1513 = *getRegisteredFeature("fix1513"); uint256 const fix1513 = *getRegisteredFeature("fix1513");
uint256 const fix1523 = *getRegisteredFeature("fix1523"); uint256 const fix1523 = *getRegisteredFeature("fix1523");
uint256 const fix1528 = *getRegisteredFeature("fix1528"); uint256 const retiredFix1528 = *getRegisteredFeature("fix1528");
uint256 const featureDepositAuth = *getRegisteredFeature("DepositAuth"); uint256 const featureDepositAuth = *getRegisteredFeature("DepositAuth");
uint256 const featureChecks = *getRegisteredFeature("Checks"); uint256 const featureChecks = *getRegisteredFeature("Checks");
uint256 const fix1571 = *getRegisteredFeature("fix1571"); uint256 const fix1571 = *getRegisteredFeature("fix1571");

View File

@@ -592,11 +592,7 @@ public:
// This is a specialized test engineered to yield ledgers with different // This is a specialized test engineered to yield ledgers with different
// close times even though the peers believe they had close time // close times even though the peers believe they had close time
// consensus on the ledger. // consensus on the ledger.
for (bool useRoundedCloseTime : {false, true})
{
ConsensusParms parms; ConsensusParms parms;
parms.useRoundedCloseTime = useRoundedCloseTime;
Sim sim; Sim sim;
@@ -692,54 +688,8 @@ public:
sim.run(1); sim.run(1);
if (parms.useRoundedCloseTime)
{
BEAST_EXPECT(sim.synchronized()); BEAST_EXPECT(sim.synchronized());
} }
else
{
// Not currently synchronized
BEAST_EXPECT(!sim.synchronized());
// All slow peers agreed on LCL
BEAST_EXPECT(std::all_of(
slow.begin(), slow.end(), [&slow](Peer const* p) {
return p->lastClosedLedger.id() ==
slow[0]->lastClosedLedger.id();
}));
// All fast peers agreed on LCL
BEAST_EXPECT(std::all_of(
fast.begin(), fast.end(), [&fast](Peer const* p) {
return p->lastClosedLedger.id() ==
fast[0]->lastClosedLedger.id();
}));
Ledger const& slowLCL = slow[0]->lastClosedLedger;
Ledger const& fastLCL = fast[0]->lastClosedLedger;
// Agree on parent close and close resolution
BEAST_EXPECT(
slowLCL.parentCloseTime() == fastLCL.parentCloseTime());
BEAST_EXPECT(
slowLCL.closeTimeResolution() ==
fastLCL.closeTimeResolution());
// Close times disagree ...
BEAST_EXPECT(slowLCL.closeTime() != fastLCL.closeTime());
// Effective close times agree! The slow peer already rounded!
BEAST_EXPECT(
effCloseTime(
slowLCL.closeTime(),
slowLCL.closeTimeResolution(),
slowLCL.parentCloseTime()) ==
effCloseTime(
fastLCL.closeTime(),
fastLCL.closeTimeResolution(),
fastLCL.parentCloseTime()));
}
}
}
void void
testFork() testFork()