Skip to content

test: Add confidential mpt bulletproof tests - #7816

Open
oleks-rip wants to merge 10 commits into
XRPLF:developfrom
oleks-rip:compt_booletproof_test
Open

test: Add confidential mpt bulletproof tests#7816
oleks-rip wants to merge 10 commits into
XRPLF:developfrom
oleks-rip:compt_booletproof_test

Conversation

@oleks-rip

@oleks-rip oleks-rip commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

High Level Overview of Change

Add ConfidentialMPTTransfer and ConfidentialMPTConvertBack bulletproof tests that trying spend / convert more than user have on their balance / convert to MPT.

@oleks-rip
oleks-rip force-pushed the compt_booletproof_test branch from 05eeced to 922969a Compare July 16, 2026 14:37
@oleks-rip oleks-rip changed the title Add confidential mpt transfer bulletproof test test: Add confidential mpt transfer bulletproof test Jul 16, 2026
@oleks-rip
oleks-rip force-pushed the compt_booletproof_test branch from 922969a to c880dda Compare July 16, 2026 14:41
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@oleks-rip
oleks-rip force-pushed the compt_booletproof_test branch from c880dda to 02fc1c2 Compare July 21, 2026 17:15
Comment thread src/test/app/ConfidentialTransfer_test.cpp Outdated
Comment thread src/test/app/ConfidentialTransfer_test.cpp Outdated
Comment thread src/test/app/ConfidentialTransfer_test.cpp Outdated
@oleks-rip
oleks-rip requested a review from PeterChen13579 July 22, 2026 17:30
@oleks-rip oleks-rip 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 Jul 22, 2026
@oleks-rip

Copy link
Copy Markdown
Contributor Author
2026-07-22T19:08:34.7946773Z /__w/rippled/rippled/src/test/app/ConfidentialTransfer_test.cpp:5498:54: runtime error: unsigned integer overflow: 100 - 101 cannot be represented in type 'uint64_t' (aka 'unsigned long')
2026-07-22T19:08:34.7947982Z SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /__w/rippled/rippled/src/test/app/ConfidentialTransfer_test.cpp:5498:54 

This ubsan report about UB(and 2 failing tests) is incorrect

@oleks-rip
oleks-rip requested a review from PeterChen13579 July 23, 2026 14:58

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

Adds a new regression test in the confidential MPT transfer suite to validate that an attempted “overdraft” (sending more than the sender’s confidential balance) is rejected by range-proof verification, and updates UBSan suppressions accordingly.

Changes:

  • Add testSendOverdraftBulletproof that constructs a proof manually to bypass client-side checks and verifies ledger-side rejection for overdraft amounts.
  • Wire the new test into the existing confidential send negative-test sequence.
  • Add an UBSan suppression entry for unsigned overflow in the test file.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/test/app/ConfidentialTransfer_test.cpp Adds a new overdraft-focused bulletproof/range-proof negative test and hooks it into the test run.
sanitizers/suppressions/ubsan.supp Adds a UBSan suppression for unsigned wraparound triggered by the new test logic.
Comments suppressed due to low confidence (1)

src/test/app/ConfidentialTransfer_test.cpp:5558

  • recipients is constructed but never used. With -Wall (and builds enabling -Werror), this triggers an unused-variable warning/error and will break the build. Since the proof is built directly from c2Vec/pkVec below, this block can be removed.
        // Build recipients for sigma proof
        std::vector<ConfidentialRecipient> recipients;
        recipients.push_back({
            .publicKey = Slice(requireOptional(mptIssuer.getPubKey(alice), "Missing alice pubkey")),
            .encryptedAmount = aliceEncAmt,

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

Comment thread src/test/app/ConfidentialTransfer_test.cpp Outdated
Comment thread sanitizers/suppressions/ubsan.supp
Comment thread src/test/app/ConfidentialTransfer_test.cpp Outdated
@bthomee bthomee removed the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Jul 24, 2026
@oleks-rip oleks-rip 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 Jul 24, 2026
@bthomee bthomee added Needs additional review PR requires at least one more code review approval before it can be merged and removed Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. labels Jul 24, 2026
Comment thread src/test/app/ConfidentialTransfer_test.cpp Outdated
Comment thread src/test/app/ConfidentialTransfer_test.cpp Outdated
Comment thread src/test/app/ConfidentialTransfer_test.cpp
@oleks-rip oleks-rip changed the title test: Add confidential mpt transfer bulletproof test test: Add confidential mpt bulletproof tests Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs additional review PR requires at least one more code review approval before it can be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants