Skip to content

feat: Introduce lending 1.1 amendment and add MemoData field to VaultDelete transaction#6324

Merged
bthomee merged 17 commits into
developfrom
tapanito/lending-fix-amendment
Jul 1, 2026
Merged

feat: Introduce lending 1.1 amendment and add MemoData field to VaultDelete transaction#6324
bthomee merged 17 commits into
developfrom
tapanito/lending-fix-amendment

Conversation

@Tapanito

@Tapanito Tapanito commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Introduces the featureLendingProtocolV1_1 amendment and a new feature it gates:

  • Optional sfMemoData on VaultDelete: Allows callers to record a deletion reason (up to kMaxDataPayloadLength bytes) when closing a vault. The field is validated for non-zero length in preflight; submitting it without the amendment enabled returns temDISABLED. Autogen accessor/builder updated accordingly.

Changes

Area What changed
features.macro Declares featureLendingProtocolV1_1 (Supported::No, DefaultNo)
transactions.macro + autogen Adds sfMemoData (optional) to VaultDelete
VaultDelete.cpp preflight validates sfMemoData length and amendment guard
Vault_test.cpp testVaultDeleteData — covers disabled/oversized/empty/valid cases

Note: VaultInvariant changes were temporarily reset to develop state pending re-evaluation; the diff is preserved in /tmp/vault-invariant-changes.patch.

High Level Overview of Change

Context of Change

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

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

@Tapanito Tapanito force-pushed the tapanito/lending-fix-amendment branch 2 times, most recently from cb45787 to 3422c11 Compare February 4, 2026 10:30
Comment thread include/xrpl/protocol/detail/features.macro Outdated
@Tapanito Tapanito added the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Feb 12, 2026
@Tapanito Tapanito requested a review from a1q123456 February 12, 2026 10:48
@codecov

codecov Bot commented Feb 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.3%. Comparing base (8abbd1b) to head (dffa0a0).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6324     +/-   ##
=========================================
- Coverage     82.3%   82.3%   -0.0%     
=========================================
  Files         1024    1024             
  Lines        78384   78397     +13     
  Branches      8978    8978             
=========================================
- Hits         64501   64498      -3     
- Misses       13874   13890     +16     
  Partials         9       9             
Files with missing lines Coverage Δ
include/xrpl/protocol/detail/transactions.macro 100.0% <ø> (ø)
...e/xrpl/protocol_autogen/transactions/VaultDelete.h 100.0% <100.0%> (ø)
src/libxrpl/tx/transactors/vault/VaultDelete.cpp 87.5% <100.0%> (+0.8%) ⬆️

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

@Tapanito Tapanito changed the title [W.I.P] adds lending v1.1 fix amendment Lending Protocol v1.1 Feb 19, 2026
@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@github-actions

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@godexsoft

Copy link
Copy Markdown
Contributor

We recently merged a refactor to develop that enables clang-tidy's readability-identifier-naming. Your branch now has heavy conflicts that are largely mechanical. Below is a workflow that aligns your branch's naming with develop before merging, which should minimize the merge conflicts.

One-time setup

If you don't already have clang-tidy working in your env, on macOS:

brew install llvm@21
# Follow brew's hint to put $(brew --prefix llvm@21)/bin on PATH so run-clang-tidy is found.

Workflow on your branch (before merging develop)

1. Grab the new .clang-tidy from develop without pulling anything else. Sync your fork on GitHub first, then:

git remote -v   # should show 'upstream' among others; if not:
# git remote set-url upstream git@github.com:XRPLF/rippled.git
git fetch upstream
git checkout upstream/develop -- .clang-tidy

2. Reconfigure conan/cmake so compile_commands.json is fresh.

3. Apply renames for the files modified in your PR:

git diff --name-only $(git merge-base HEAD upstream/develop) HEAD \
  | grep -E '\.(cpp|h|hpp|ipp)$' \
  | xargs run-clang-tidy -p build -fix -allow-no-checks
# or -p .build, or whatever your build dir is called

4. Build + test, then commit as a single dedicated commit:

cmake --build build -j8
git commit -am "refactor: Align identifier naming with develop"

5. Now merge develop:

git merge upstream/develop

Extra

Run clang-tidy once more after the merge to catch any stragglers introduced from develop's side:

run-clang-tidy -p build -fix -allow-no-checks src tests
# or -p .build, or whatever your build dir is called

@ximinez ximinez added this to the 3.2.0 milestone May 13, 2026
@Tapanito Tapanito removed this from the 3.2.0 milestone May 20, 2026
@Tapanito Tapanito requested review from ximinez June 8, 2026 09:17
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@Tapanito Tapanito marked this pull request as ready for review June 8, 2026 09:58
@Tapanito Tapanito changed the title Lending Protocol v1.1 feat: Introduce lending 1.1 amendment and add MemoData field to VaultDelete transaction Jun 8, 2026
@Tapanito Tapanito added this to the Lending Protocol 1.1 milestone Jun 8, 2026
@Tapanito Tapanito removed the DraftRunCI Normally CI does not run on draft PRs. This opts in. label Jun 8, 2026

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

Had a look at this

One correctness bug: missing env.close() after enableFeature means the "data too large" and "data empty" sub-cases never actually test the enabled-feature path — see inline.


Review by ReviewBot 🤖

Review by Claude Sonnet 4.6 · Prompt: V15

Comment thread src/test/app/Vault_test.cpp

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

Missing env.close() after enableFeature — see inline.

Review by Claude Sonnet 4.6 · Prompt: V15

Comment thread src/test/app/Vault_test.cpp

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@github-actions

Copy link
Copy Markdown

This PR has conflicts, please resolve them in order for the PR to be reviewed.

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@github-actions

Copy link
Copy Markdown

All conflicts have been resolved. Assigned reviewers can now start or resume their review.

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

a1q123456
a1q123456 previously approved these changes Jun 29, 2026
ximinez
ximinez previously approved these changes Jun 29, 2026
@Tapanito Tapanito 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 30, 2026

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

Copilot AI left a comment

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.

Pull request overview

This PR introduces the featureLendingProtocolV1_1 amendment and uses it to gate a new optional sfMemoData field on the VaultDelete transaction, allowing a bounded “deletion reason” payload to be included and validated at preflight time.

Changes:

  • Registers the new LendingProtocolV1_1 amendment in features.macro.
  • Adds optional sfMemoData to VaultDelete (macro + protocol_autogen wrapper/builder + protocol_autogen tests).
  • Implements amendment guarding and payload length validation in VaultDelete::preflight, with corresponding app-level unit tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/libxrpl/tx/transactors/vault/VaultDelete.cpp Adds amendment gate + sfMemoData size validation in preflight.
include/xrpl/protocol/detail/transactions.macro Declares sfMemoData as an optional field on ttVAULT_DELETE.
include/xrpl/protocol/detail/features.macro Registers the new LendingProtocolV1_1 amendment.
include/xrpl/protocol_autogen/transactions/VaultDelete.h Updates generated wrapper/builder with getMemoData() / setMemoData().
src/tests/libxrpl/protocol_autogen/transactions/VaultDeleteTests.cpp Extends generated transaction wrapper tests for the new optional field.
src/test/app/Vault_test.cpp Adds integration-style test coverage for disabled/invalid/valid sfMemoData cases.

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

Comment thread src/libxrpl/tx/transactors/vault/VaultDelete.cpp
@Tapanito Tapanito dismissed stale reviews from a1q123456 and ximinez via 8c56202 June 30, 2026 11:56

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@xrplf-ai-reviewer xrplf-ai-reviewer Bot left a comment

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.

No issues.

Review by Claude Sonnet 4.6 · Prompt: V15

@bthomee bthomee enabled auto-merge June 30, 2026 17:25
@bthomee bthomee added this pull request to the merge queue Jun 30, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 30, 2026
@bthomee bthomee added this pull request to the merge queue Jun 30, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jun 30, 2026
@bthomee bthomee added this pull request to the merge queue Jun 30, 2026
Merged via the queue into develop with commit ecf7f80 Jul 1, 2026
49 checks passed
@bthomee bthomee deleted the tapanito/lending-fix-amendment branch July 1, 2026 00:25
@bthomee bthomee modified the milestones: Lending Protocol 1.1, 3.3.0 Jul 6, 2026
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.

6 participants