8000 Remove OwnerPaysFee as it's never fully supported by a1q123456 · Pull Request #5435 · XRPLF/rippled · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove OwnerPaysFee as it's never fully supported #5435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jun 24, 2025

Conversation

a1q123456
Copy link
Collaborator

High Level Overview of Change

As instructed, the OwnerPaysFee amendment is never fully supported and therefore we should remove it. However, after some investigation, I found that we can't fully purge everything relating to it because some other features are relying on it. I've removed the feature from RippleCalc.cpp and set the ownerPaysFee flag to false for flow(), but this flag is sometimes hardcoded as true in some contexts, e.g. XChainBridge.cpp at line 502, CashCheck.cpp at line 448, and CreateOffer.cpp at line 804, which implies we shouldn't fully remove all the business logic relating to it.

I've also removed some unit test cases because they were written for the OwnerPaysFee feature and there are already some test cases for the regular scenario with OwnerPaysFee disabled.

Context of Change

This change removes unneeded logic and unit tests.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

This change doesn't affect any public protocol.

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

Test Plan

As this is the first time we have a feature that is both obsolete and unsupported, we should check if any related systems support it. e.g. https://xrpscan.com/amendments and https://js.xrpl.org/

@a1q123456 a1q123456 requested a review from a team as a code owner May 19, 2025 13:30
Copy link
codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.1%. Comparing base (42fd74b) to head (e955f18).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5435   +/-   ##
=======================================
  Coverage     79.1%   79.1%           
=======================================
  Files          817     817           
  Lines        71704   71703    -1     
  Branches      8238    8236    -2     
=======================================
+ Hits         56720   56722    +2     
+ Misses       14984   14981    -3     
Files with missing lines Coverage Δ
include/xrpl/protocol/Feature.h 100.0% <ø> (ø)
src/libxrpl/protocol/Feature.cpp 94.8% <100.0%> (ø)
src/xrpld/app/paths/RippleCalc.cpp 82.9% <ø> (-0.4%) ⬇️

... and 6 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Bronek
Copy link
Collaborator
Bronek commented May 19, 2025

@a1q123456 you can fix the formatting errors with

find src include -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -exec clang-format -i {} +

You will need clang-format version 18.1.8 in your path. Since you do not need full clang/llvm for formatting only, a simpler way to get it is with pip, e.g.

pip install clang-format==18.1.8

@a1q123456
Copy link
Collaborator Author

@a1q123456 you can fix the formatting errors with

find src include -type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' -o -name '*.ipp' \) -exec clang-format -i {} +

You will need clang-format version 18.1.8 in your path. Since you do not need full clang/llvm for formatting only, a simpler way to get it is with pip, e.g.

pip install clang-format==18.1.8

Thanks Bronek! Will do.

@a1q123456 a1q123456 requested a review from ximinez May 19, 2025 17:06
@bthomee bthomee added this to the 2.6.0 (Q3 2025) milestone May 27, 2025
@bthomee bthomee requested review from vvysokikh1 and removed request for ximinez May 29, 2025 18:07
Copy link
Collaborator
@vvysokikh1 vvysokikh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General question: are all tests that are being removed failing? If some of them can succeed, they should stay

@bthomee bthomee requested a review from Bronek June 20, 2025 15:19
Copy link
Collaborator
@Bronek Bronek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spent some time with this PR and I think I see a potential problem here.

The established semantics of "Retired" feature is that it is permanently enabled and the code does not support it being disabled. However when we examine how amendment support is handled in FeatureCollections::registerFeature, the body of lambda getAmendmentSupport makes implied assumption that an Obsolete feature is always Retired and I think that's incorrect and may potentially cause problems in the future.

I suggest the following change:

--- a/src/libxrpl/protocol/Feature.cpp
+++ b/src/libxrpl/protocol/Feature.cpp
@@ -276,7 +276,7 @@ FeatureCollections::registerFeature(
         features.emplace_back(name, f);

         auto const getAmendmentSupport = [=]() {
-            if (vote == VoteBehavior::Obsolete)
+            if (vote == VoteBehavior::Obsolete && support == Supported::yes)
                 return AmendmentSupport::Retired;
             return support == Supported::yes ? AmendmentSupport::Supported
                                              : AmendmentSupport::Unsupported;

... and then you will find that you can undo changes in Feature_test.cpp and also remove numObsoleteUnsupportedAmendments (as they will be now simply considered "unsupported") from Feature.cpp and Feature.h.

You might also add point 5) in the large comment near the top of Feature.h to explain that a feature might be marked Obsolete, and that can mean one of two things, depending on Supported - either it is in the ledger and it is on its way to become Retired (if it is Supported::yes) or the feature is not in the ledger and the code to support it has been removed (if it is Supported::no). Feel free to phrase it differently, just note the comment above retireFeature in Feature.cpp

@Bronek Bronek added the Blocked on requested changes Reviewers have requested changes which must be addressed or responded to label Jun 23, 2025
Copy link
Collaborator
@Bronek Bronek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, just please improve the comment in Feature.h

@Bronek Bronek removed the Blocked on requested changes Reviewers have requested changes which must be addressed or responded to label Jun 24, 2025
@Bronek Bronek requested a review from vvysokikh1 June 24, 2025 11:58
@bthomee
Copy link
Collaborator
bthomee commented Jun 24, 2025

@a1q123456 is this ready to merge or are you still working on addressing some comments?

8000

@a1q123456 a1q123456 added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Jun 24, 2025
@a1q123456
Copy link
Collaborator Author

@a1q123456 is this ready to merge or are you still working on addressing some comments?

Hey Bart, you're faster than me :). It's ready to merge now.

@bthomee bthomee enabled auto-merge (squash) June 24, 2025 17:04
@bthomee bthomee merged commit e9d46f0 into develop Jun 24, 2025
28 checks passed
@bthomee bthomee deleted the a1q123456/remove-unused-feature-owner-pays-fee branch June 24, 2025 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0