Sponsored Content
Skip to content

fix: Check for empty sfAdditionalBooks array in hybrid offer invariant - #6716

Merged
bthomee merged 8 commits into
XRPLF:developfrom
Kassaking7:DEFI-612
Apr 20, 2026
Merged

fix: Check for empty sfAdditionalBooks array in hybrid offer invariant#6716
bthomee merged 8 commits into
XRPLF:developfrom
Kassaking7:DEFI-612

Conversation

@Kassaking7

Copy link
Copy Markdown
Contributor

Fix for Hybrid offer invariant does not catch empty sfAdditionalBooks array: #6590

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)

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

This change has to be amendment gated.

@Kassaking7

Copy link
Copy Markdown
Contributor Author

Got it. Shall I go with fixSecurity3_1_3 ?

@mvadari

mvadari commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Got it. Shall I go with fixSecurity3_1_3 ?

Yes

Comment on lines +14 to +15
bool badHybridPre_ = false; // pre-fixSecurity3_1_3: missing field/domain or size > 1
bool badHybridPost_ = false; // post-fixSecurity3_1_3: also catches size == 0 (size != 1)

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.

For ease of later maintenance, maybe badHybridsOld_ and badHybrids_ would be better names.

@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

⚠️ This PR contains unsigned commits. To get your PR merged, please sign them. ⚠️

If only the most recent commit is unsigned, you can run:

  1. Amend the commit: git commit --amend --no-edit -n -S
  2. Overwrite the commit: git push --force-with-lease

If multiple commits are unsigned, you can run:

  1. Go into interactive rebase mode: git rebase --interactive HEAD~<NUM_OF_COMMITS>, where NUM_OF_COMMITS is the number of most recent commits that will be available to edit.
  2. Change "pick" to "edit" for the commits you need to sign, and then save and exit.
  3. For each commit, run: git commit --amend --no-edit -n -S
  4. Continue the rebase: git rebase --continue
  5. Overwrite the commit(s): git push --force-with-lease

If you're new to commit signing, there are different ways to set it up:

Sign commits with gpg

Follow the steps below to set up commit signing with gpg:

  1. Generate a GPG key
  2. Add the GPG key to your GitHub account
  3. Configure git to use your GPG key for commit signing
Sign commits with ssh-agent

Follow the steps below to set up commit signing with ssh-agent:

  1. Generate an SSH key and add it to ssh-agent
  2. Add the SSH key to your GitHub account
  3. Configure git to use your SSH key for commit signing
Sign commits with 1Password

You can also sign commits using 1Password, which lets you sign commits with biometrics without the signing key leaving the local 1Password process.
See use 1Password to sign your commits.

@github-actions

github-actions Bot commented Apr 7, 2026

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.6%. Comparing base (653a383) to head (cba0bae).
⚠️ Report is 5 commits behind head on develop.

Files with missing lines Patch % Lines
.../libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp 87.5% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6716     +/-   ##
=========================================
- Coverage     81.6%   81.6%   -0.0%     
=========================================
  Files         1010    1010             
  Lines        75992   76003     +11     
  Branches      7601    7607      +6     
=========================================
- Hits         62013   62012      -1     
- Misses       13979   13991     +12     
Files with missing lines Coverage Δ
...libxrpl/tx/invariants/PermissionedDEXInvariant.cpp 100.0% <100.0%> (ø)
.../libxrpl/ledger/helpers/PermissionedDEXHelpers.cpp 96.6% <87.5%> (+0.9%) ⬆️

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

@Kassaking7
Kassaking7 requested a review from shawnxie999 April 10, 2026 15:14
@Kassaking7 Kassaking7 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 Apr 13, 2026

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

@Kassaking7 Based on the feature name, it looks like this PR is intended to be included in the 3.1.3 release. For that to happen, you need to create a second branch based off of ripple/staging-313, and port these changes to it. You can try using cherry-pick, but due to the number of renamed files and other refactoring differences between the two branches, it will be non-trivial. Once you're done, make a PR for that branch, with ripple/staging-313 as the base branch. Use the title fix: Hybrid offer invariant sfAdditionalBooks empty check (#6716) so they can be logically linked together. Ping me once that's done, and I'll merge them both.

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

@ximinez
ximinez dismissed their stale review April 17, 2026 20:51

My "review" was only to port the code to 3.1.3. Dismissing it as that's now done in #6945.

@bthomee
bthomee added this pull request to the merge queue Apr 20, 2026
@bthomee
bthomee removed this pull request from the merge queue due to a manual request Apr 20, 2026
@bthomee bthomee changed the title fix: Hybrid offer invariant sfAdditionalBooks empty check fix: Check for empty sfAdditionalBooks array check in hybrid offer invariant Apr 20, 2026
@bthomee bthomee changed the title fix: Check for empty sfAdditionalBooks array check in hybrid offer invariant fix: Check for empty sfAdditionalBooks array in hybrid offer invariant Apr 20, 2026
@bthomee
bthomee enabled auto-merge April 20, 2026 17:10
@bthomee
bthomee added this pull request to the merge queue Apr 20, 2026
Merged via the queue into XRPLF:develop with commit 96643bb Apr 20, 2026
3 checks passed
ximinez added a commit that referenced this pull request Apr 22, 2026
…ant (#6716) (#6945)

Co-authored-by: Ed Hennis <ed@ripple.com>
Co-authored-by: Ayaz Salikhov <mathbunnyru@users.noreply.github.com>
marek-foss-neti pushed a commit to marek-foss-neti/rippled that referenced this pull request May 5, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 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.

5 participants