From faebfce3ed1eb448f84803f0e40ca8adc12a9e02 Mon Sep 17 00:00:00 2001 From: Richard Holland Date: Thu, 5 Sep 2024 23:33:23 +1000 Subject: [PATCH] page cap fix --- src/ripple/ledger/impl/ApplyView.cpp | 6 ++++-- src/ripple/protocol/Feature.h | 3 ++- src/ripple/protocol/impl/Feature.cpp | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ripple/ledger/impl/ApplyView.cpp b/src/ripple/ledger/impl/ApplyView.cpp index eced521fb..5d26ac682 100644 --- a/src/ripple/ledger/impl/ApplyView.cpp +++ b/src/ripple/ledger/impl/ApplyView.cpp @@ -91,9 +91,11 @@ ApplyView::dirAdd( return page; } + bool const capped = !rules().enabled(fixPageCap); + // Check whether we're out of pages. - if (++page >= dirNodeMaxPages) - return std::nullopt; + if (++page >= dirNodeMaxPages && capped) + return std::nullopt; // We are about to create a new node; we'll link it to // the chain first: diff --git a/src/ripple/protocol/Feature.h b/src/ripple/protocol/Feature.h index 1ae142d30..e91f147ad 100644 --- a/src/ripple/protocol/Feature.h +++ b/src/ripple/protocol/Feature.h @@ -74,7 +74,7 @@ namespace detail { // Feature.cpp. Because it's only used to reserve storage, and determine how // large to make the FeatureBitset, it MAY be larger. It MUST NOT be less than // the actual number of amendments. A LogicError on startup will verify this. -static constexpr std::size_t numFeatures = 71; +static constexpr std::size_t numFeatures = 72; /** Amendments that this server supports and the default voting behavior. Whether they are enabled depends on the Rules defined in the validated @@ -359,6 +359,7 @@ extern uint256 const featureRemit; extern uint256 const featureZeroB2M; extern uint256 const fixNSDelete; extern uint256 const fix240819; +extern uint256 const fixPageCap; } // namespace ripple diff --git a/src/ripple/protocol/impl/Feature.cpp b/src/ripple/protocol/impl/Feature.cpp index e8769d977..a13c210cd 100644 --- a/src/ripple/protocol/impl/Feature.cpp +++ b/src/ripple/protocol/impl/Feature.cpp @@ -465,6 +465,7 @@ REGISTER_FEATURE(Remit, Supported::yes, VoteBehavior::De REGISTER_FEATURE(ZeroB2M, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FIX (fixNSDelete, Supported::yes, VoteBehavior::DefaultNo); REGISTER_FIX (fix240819, Supported::yes, VoteBehavior::DefaultYes); +REGISTER_FIX (fixPageCap, Supported::yes, VoteBehavior::DefaultYes); // The following amendments are obsolete, but must remain supported // because they could potentially get enabled.