Skip to content

refactor: Retire Clawback amendment#7353

Open
TimothyBanks wants to merge 5 commits into
XRPLF:developfrom
TimothyBanks:retire_clawback_amendment
Open

refactor: Retire Clawback amendment#7353
TimothyBanks wants to merge 5 commits into
XRPLF:developfrom
TimothyBanks:retire_clawback_amendment

Conversation

@TimothyBanks
Copy link
Copy Markdown

High Level Overview of Change

This change set retires the Clawback amendment. All tests were updated to work correctly against retirement.

Context of Change

API Impact

  • 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)

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.4%. Comparing base (763dd50) to head (a6fc44b).
⚠️ Report is 12 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #7353     +/-   ##
=========================================
- Coverage     82.4%   82.4%   -0.0%     
=========================================
  Files         1011    1011             
  Lines        76484   76542     +58     
  Branches      7316    7320      +4     
=========================================
+ Hits         63007   63051     +44     
- Misses       13477   13491     +14     
Files with missing lines Coverage Δ
include/xrpl/protocol/detail/transactions.macro 100.0% <ø> (ø)
...lude/xrpl/protocol_autogen/transactions/Clawback.h 100.0% <ø> (ø)
src/libxrpl/tx/transactors/account/AccountSet.cpp 98.5% <100.0%> (-<0.1%) ⬇️
src/xrpld/rpc/handlers/account/AccountInfo.cpp 85.3% <100.0%> (-0.1%) ⬇️

... and 132 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR retires the Clawback amendment by removing runtime feature-gating for Clawback-related behavior and registering the amendment as retired in the protocol feature registry. This aligns Clawback behavior with other retired amendments: the transaction type and related account flag handling are treated as always available, and tests are updated accordingly.

Changes:

  • Remove featureClawback gating from RPC account_info output and from AccountSet flag validation/application.
  • Mark Clawback as a retired amendment and remove it as a required feature for the Clawback transaction type.
  • Update unit tests to no longer exercise “Clawback disabled” paths.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/xrpld/rpc/handlers/account/AccountInfo.cpp Always reports allowTrustLineClawback in account_flags (no longer conditional on an amendment).
src/test/rpc/AccountInfo_test.cpp Removes conditional expectations based on featureClawback; simplifies feature-matrix coverage accordingly.
src/test/app/Delegate_test.cpp Drops Clawback from the transaction required-features map to match the transaction metadata change.
src/test/app/Clawback_test.cpp Removes tests for disabled-amendment behavior and updates expected failure modes.
src/libxrpl/tx/transactors/account/AccountSet.cpp Removes amendment gating for setting asfAllowTrustLineClawback and the related asfNoFreeze restriction.
include/xrpl/protocol/detail/transactions.macro Changes ttCLAWBACK required amendment from featureClawback to uint256{} (no amendment requirement).
include/xrpl/protocol/detail/features.macro Moves Clawback from active features to XRPL_RETIRE_FEATURE(Clawback).
include/xrpl/protocol_autogen/transactions/Clawback.h Updates the autogenerated transaction doc comment to reflect “no amendment requirement”.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/test/app/Clawback_test.cpp Outdated
// 1. when asfAllowTrustLineClawback flag has not been set
{
Env env(*this, features - featureClawback);
Env env(*this, features);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think it makes sense to keep this test case.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I will gladly remove it.

@TimothyBanks
Copy link
Copy Markdown
Author

@a1q123456 Comments have been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants