Skip to content

fix: Add zero keylet check in credential - #7971

Open
yinyiqian1 wants to merge 6 commits into
XRPLF:developfrom
yinyiqian1:fix-zero-credential
Open

fix: Add zero keylet check in credential#7971
yinyiqian1 wants to merge 6 commits into
XRPLF:developfrom
yinyiqian1:fix-zero-credential

Conversation

@yinyiqian1

@yinyiqian1 yinyiqian1 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

credential should check if the id is zero before querying the ledger.
Otherwise, it will trigger assertion

High Level Overview of Change

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)

@yinyiqian1
yinyiqian1 force-pushed the fix-zero-credential branch 3 times, most recently from 31564ae to 12106c8 Compare August 6, 2026 18:32
@yinyiqian1
yinyiqian1 marked this pull request as ready for review August 6, 2026 18:32
@yinyiqian1 yinyiqian1 changed the title fix: Add zero keylet check fix: Add zero keylet check in credential Aug 6, 2026

@PeterChen13579 PeterChen13579 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.

LGTM

Comment thread src/libxrpl/ledger/helpers/CredentialHelpers.cpp Outdated
Comment thread src/libxrpl/ledger/helpers/CredentialHelpers.cpp Outdated
{
// LCOV_EXCL_START
JLOG(j.trace()) << "Zero credential ID.";
return tecBAD_CREDENTIALS;

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.

If this is already checked in preflight, this should return a more severe error, like tecINTERNAL

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

557c6c2
updated

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shawnxie999 shawnxie999 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.

lgtm

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.

4 participants