mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-04 17:27:00 +00:00
Several changes to improve Consensus stability: (#4505)
* Verify accepted ledger becomes validated, and retry with a new consensus transaction set if not. * Always store proposals. * Track proposals by ledger sequence. This helps slow peers catch up with the rest of the network. * Acquire transaction sets for proposals with future ledger sequences. This also helps slow peers catch up. * Optimize timer delay for establish phase to wait based on how long validators have been sending proposals. This also helps slow peers to catch up. * Fix impasse achieving close time consensus. * Don't wait between open and establish phases.
This commit is contained in:
@@ -44,34 +44,35 @@ public:
|
||||
// Use default parameters
|
||||
ConsensusParms const p{};
|
||||
|
||||
std::optional<std::chrono::milliseconds> delay;
|
||||
// Bizarre times forcibly close
|
||||
BEAST_EXPECT(shouldCloseLedger(
|
||||
true, 10, 10, 10, -10s, 10s, 1s, 1s, p, journal_));
|
||||
true, 10, 10, 10, -10s, 10s, 1s, delay, 1s, p, journal_));
|
||||
BEAST_EXPECT(shouldCloseLedger(
|
||||
true, 10, 10, 10, 100h, 10s, 1s, 1s, p, journal_));
|
||||
true, 10, 10, 10, 100h, 10s, 1s, delay, 1s, p, journal_));
|
||||
BEAST_EXPECT(shouldCloseLedger(
|
||||
true, 10, 10, 10, 10s, 100h, 1s, 1s, p, journal_));
|
||||
true, 10, 10, 10, 10s, 100h, 1s, delay, 1s, p, journal_));
|
||||
|
||||
// Rest of network has closed
|
||||
BEAST_EXPECT(
|
||||
shouldCloseLedger(true, 10, 3, 5, 10s, 10s, 10s, 10s, p, journal_));
|
||||
BEAST_EXPECT(shouldCloseLedger(
|
||||
true, 10, 3, 5, 10s, 10s, 10s, delay, 10s, p, journal_));
|
||||
|
||||
// No transactions means wait until end of internval
|
||||
BEAST_EXPECT(
|
||||
!shouldCloseLedger(false, 10, 0, 0, 1s, 1s, 1s, 10s, p, journal_));
|
||||
BEAST_EXPECT(
|
||||
shouldCloseLedger(false, 10, 0, 0, 1s, 10s, 1s, 10s, p, journal_));
|
||||
BEAST_EXPECT(!shouldCloseLedger(
|
||||
false, 10, 0, 0, 1s, 1s, 1s, delay, 10s, p, journal_));
|
||||
BEAST_EXPECT(shouldCloseLedger(
|
||||
false, 10, 0, 0, 1s, 10s, 1s, delay, 10s, p, journal_));
|
||||
|
||||
// Enforce minimum ledger open time
|
||||
BEAST_EXPECT(
|
||||
!shouldCloseLedger(true, 10, 0, 0, 10s, 10s, 1s, 10s, p, journal_));
|
||||
BEAST_EXPECT(!shouldCloseLedger(
|
||||
true, 10, 0, 0, 10s, 10s, 1s, delay, 10s, p, journal_));
|
||||
|
||||
// Don't go too much faster than last time
|
||||
BEAST_EXPECT(
|
||||
!shouldCloseLedger(true, 10, 0, 0, 10s, 10s, 3s, 10s, p, journal_));
|
||||
BEAST_EXPECT(!shouldCloseLedger(
|
||||
true, 10, 0, 0, 10s, 10s, 3s, delay, 10s, p, journal_));
|
||||
|
||||
BEAST_EXPECT(
|
||||
shouldCloseLedger(true, 10, 0, 0, 10s, 10s, 10s, 10s, p, journal_));
|
||||
BEAST_EXPECT(shouldCloseLedger(
|
||||
true, 10, 0, 0, 10s, 10s, 10s, delay, 10s, p, journal_));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user