test: Add confidential mpt bulletproof tests - #7816
Open
oleks-rip wants to merge 10 commits into
Open
Conversation
oleks-rip
force-pushed
the
compt_booletproof_test
branch
from
July 16, 2026 14:37
05eeced to
922969a
Compare
oleks-rip
force-pushed
the
compt_booletproof_test
branch
from
July 16, 2026 14:41
922969a to
c880dda
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
oleks-rip
force-pushed
the
compt_booletproof_test
branch
from
July 21, 2026 17:15
c880dda to
02fc1c2
Compare
PeterChen13579
requested changes
Jul 22, 2026
PeterChen13579
approved these changes
Jul 22, 2026
Contributor
Author
This ubsan report about UB(and 2 failing tests) is incorrect |
PeterChen13579
approved these changes
Jul 23, 2026
Contributor
There was a problem hiding this comment.
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
testSendOverdraftBulletproofthat 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
recipientsis 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 fromc2Vec/pkVecbelow, 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.
shawnxie999
reviewed
Jul 27, 2026
shawnxie999
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.