Compare commits

...

25 Commits

Author SHA1 Message Date
Ed Hennis
8afba1d8cd Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-03-12 15:05:01 -04:00
Ed Hennis
72ebea20f6 Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-03-10 13:39:22 -04:00
Ed Hennis
e15972d239 Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-03-06 13:32:14 -04:00
Ed Hennis
cd740beed3 Change the SAV override into an example 2026-03-04 16:08:52 -05:00
Ed Hennis
e80b95b1fc Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-03-04 16:04:50 -04:00
Ed Hennis
2d616f194c Break down the transitive logic a little more cleanly
- Optimize to do the quicker check first.
2026-03-04 14:15:00 -05:00
Ed Hennis
976932566e Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-03-03 18:38:37 -04:00
Ed Hennis
48dcac476d Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-02-24 17:43:42 -04:00
Ed Hennis
5e0f1d2ddf Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-02-20 18:51:07 -04:00
Ed Hennis
74f2003db6 Merge remote-tracking branch 'XRPLF/develop' into ximinez/lending-transitive-amendments
* XRPLF/develop:
  ci: [DEPENDABOT] bump actions/checkout from 4.3.0 to 6.0.2 (6397)
  ci: [DEPENDABOT] bump actions/setup-python from 5.6.0 to 6.2.0 (6395)
  ci: [DEPENDABOT] bump tj-actions/changed-files from 46.0.5 to 47.0.4 (6394)
  ci: [DEPENDABOT] bump codecov/codecov-action from 5.4.3 to 5.5.2 (6398)
  ci: Build docs in PRs and in private repos (6400)
  ci: Add dependabot config (6379)
  Fix tautological assertion (6393)
2026-02-20 17:36:58 -05:00
Ed Hennis
7a72b54ba7 Merge commit '2c1fad1023' into ximinez/lending-transitive-amendments
* commit '2c1fad1023':
  chore: Apply clang-format width 100 (6387)
2026-02-20 17:36:55 -05:00
Ed Hennis
87776e3114 Update formatting 2026-02-20 17:34:59 -05:00
Ed Hennis
3523f8828c Merge commit '25cca465538a56cce501477f9e5e2c1c7ea2d84c' into ximinez/lending-transitive-amendments
* commit '25cca465538a56cce501477f9e5e2c1c7ea2d84c':
  chore: Set clang-format width to 100 in config file (6387)
2026-02-20 17:29:48 -05:00
Ed Hennis
058080f6cd Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-02-19 16:25:21 -05:00
Ed Hennis
a646956271 Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-02-18 21:13:29 -04:00
Ed Hennis
7c59b7e064 Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-02-04 17:18:34 -04:00
Ed Hennis
a1f7e1fd78 Fix formatting 2026-01-28 19:26:43 -05:00
Ed Hennis
ca06325ed9 Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-01-28 19:20:10 -04:00
Ed Hennis
ca8ef9bf0c Merge commit '5f638f55536def0d88b970d1018a465a238e55f4' into ximinez/lending-transitive-amendments
* commit '5f638f55536def0d88b970d1018a465a238e55f4':
  chore: Set ColumnLimit to 120 in clang-format (6288)
2026-01-28 18:18:45 -05:00
Ed Hennis
74875e9ab8 Merge commit '92046785d1fea5f9efe5a770d636792ea6cab78b' into ximinez/lending-transitive-amendments
* commit '92046785d1fea5f9efe5a770d636792ea6cab78b':
  test: Fix the `xrpl.net` unit test using async read (6241)
  ci: Upload Conan recipes for develop, release candidates, and releases (6286)
  fix: Stop embedded tests from hanging on ARM by using `atomic_flag` (6248)
  fix:  Remove DEFAULT fields that change to the default in associateAsset (6259) (6273)
  refactor: Update Boost to 1.90 (6280)
  refactor: clean up uses of `std::source_location` (6272)
  ci: Pass missing sanitizers input to actions (6266)
  ci: Properly propagate Conan credentials (6265)
  ci: Explicitly set version when exporting the Conan recipe (6264)
  ci: Use plus instead of hyphen for Conan recipe version suffix (6261)
  chore: Detect uninitialized variables in CMake files (6247)
  ci: Run on-trigger and on-pr when generate-version is modified (6257)
  refactor: Enforce 15-char limit and simplify labels for thread naming (6212)
  docs: Update Ripple Bug Bounty public key (6258)
  ci: Add missing commit hash to Conan recipe version (6256)
  fix: Include `<functional>` header in `Number.h` (6254)
  ci: Upload Conan recipe for merges into develop and commits to release (6235)
  Limit reply size on `TMGetObjectByHash` queries (6110)
  ci: remove 'master' branch as a trigger (6234)
  Improve ledger_entry lookups for fee, amendments, NUNL, and hashes (5644)
2026-01-28 18:18:38 -05:00
Ed Hennis
f71c7f1959 Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-01-15 13:16:37 -04:00
Ed Hennis
049e12bfd6 Merge branch 'develop' into ximinez/lending-transitive-amendments 2026-01-15 12:06:28 -04:00
Ed Hennis
6fbd1360d6 Fix AMM unit tests after rebase 2026-01-14 18:15:27 -05:00
Ed Hennis
d0810d3cbe fixup! Implement transitive feature enabling for SAV 2026-01-13 18:21:53 -05:00
Ed Hennis
9568ea0f02 Implement transitive feature enabling for SAV 2026-01-13 18:08:50 -05:00

View File

@@ -116,12 +116,47 @@ Rules::presets() const
return impl_->presets();
}
/** Define features that can be considered enabled based on other features.
*
* This is a simple key-value map where
* - the key is the feature being checked
* - the value is a set of other features, which, in any of them are enabled,
* will cause the key feature to be considered enabled.
*
*/
std::map<uint256, std::vector<uint256>> const&
getTransitiveFeatureMap()
{
static std::map<uint256, std::vector<uint256>> const featureToOverride{
// In this example, if LendingProtocol is enabled, then
// SingleAssetVault can also be considered enabled. This example
// is commented because both amendments have been released as
// supported, and this would change their behaviors. Only new
// amendments my be included in the value set.
//
// {featureSingleAssetVault, {featureLendingProtocol}},
};
return featureToOverride;
}
bool
Rules::enabled(uint256 const& feature) const
{
XRPL_ASSERT(impl_, "xrpl::Rules::enabled : initialized");
return impl_->enabled(feature);
if (impl_->enabled(feature))
return true;
// Some features can be considered enabled based on other enabled features.
static auto const& transitiveFeatureMap = getTransitiveFeatureMap();
// If this feature is not one of them, then we're done.
if (!transitiveFeatureMap.contains(feature))
return false;
auto const& transitiveFeatures = transitiveFeatureMap.at(feature);
return std::any_of(transitiveFeatures.begin(), transitiveFeatures.end(), [this](auto const& f) {
return impl_->enabled(f);
});
}
bool