Skip to content

Conversation

Bronek
Copy link
Collaborator

@Bronek Bronek commented May 27, 2025

High Level Overview of Change

Return tecEXPIRED from VaultDeposit to allow the Transactor to remove the expired credentials.

Context of Change

Single Asset Vault #5224 added VaultDeposit which calls enforceMPTokenAuthorization to check domain
based permissions of the depositor, which in turn calls verifyValidDomain. Unfortunately both functions, as added in #5224, will generalize the "credentials not found" result to tecNO_AUTH and tecNO_PERMISSION rather than return tecEXPIRED as required by Transactor to actually carry out deletion of expired credentials. This change fixes the problem and extends the unit tests.

Before this change, expired credentials will not be deleted if VaultDeposit fails when only expired credentials are found. With this change, the reason for transaction failure will change, and the expired credentials will be no longer kept in the ledger unnecessarily.

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

@Bronek Bronek marked this pull request as ready for review May 27, 2025 12:10
@Bronek Bronek requested a review from a team as a code owner May 27, 2025 12:10
@Bronek Bronek requested review from bthomee and vlntb May 27, 2025 12:10
@Bronek Bronek added the Bug label May 27, 2025
@Bronek Bronek added this to the 2.5.0 (Q2 2025) milestone May 27, 2025
@Bronek Bronek requested a review from gregtatcam May 27, 2025 12:11
Copy link

codecov bot commented May 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.7%. Comparing base (d71ce51) to head (6d7c0b4).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5452   +/-   ##
=======================================
  Coverage     78.7%   78.7%           
=======================================
  Files          816     816           
  Lines        70534   70542    +8     
  Branches      8284    8287    +3     
=======================================
+ Hits         55477   55485    +8     
  Misses       15057   15057           
Files with missing lines Coverage Δ
src/xrpld/app/misc/CredentialHelpers.cpp 97.8% <100.0%> (+2.7%) ⬆️
src/xrpld/ledger/detail/View.cpp 91.3% <100.0%> (+0.2%) ⬆️

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

Copy link
Collaborator

@vlntb vlntb left a comment

Choose a reason for hiding this comment

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

LGTM

@Bronek Bronek force-pushed the Bronek/vault_expired_creds branch from 8a84fc6 to 81b7c0a Compare May 27, 2025 13:45
@Bronek Bronek force-pushed the Bronek/vault_expired_creds branch from 81b7c0a to eae690a Compare May 27, 2025 14:53
Copy link
Contributor

@PeterChen13579 PeterChen13579 left a comment

Choose a reason for hiding this comment

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

This change won't affect Clio because VaultDeposit is a transaction , but LGTM 👍

@Bronek Bronek 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 May 28, 2025
@bthomee bthomee merged commit 9e1fe9a into develop May 28, 2025
28 checks passed
@bthomee bthomee deleted the Bronek/vault_expired_creds branch May 28, 2025 14:28
This was referenced Jun 12, 2025
@legleux legleux mentioned this pull request Jun 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug 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