You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(api): skip malformed notes during shielded scans - #65
Skip notes with unsupported plaintext headers or negative decoded values in both note decryption paths. Add regression coverage for native shielded and TRC20 IVK/OVK scans, including valid notes before and after malformed entries.
Why are these changes required?
An authenticated but malformed note currently throws during decoding or value validation and aborts the entire requested scan range. Returning an empty result for that note lets scanning continue while preserving commitment checks and errors for invalid API inputs.
This PR has been tested by:
JDK 8 direct compilation of the current Note, NoteEncryption and Wallet sources against an existing local FullNode build, followed by JUnit: all 5 new regression tests and 2 existing SaplingNoteTest tests passed. Against the original Note implementation, 4 of the 5 new tests failed.
Direct Checkstyle 8.7 validation of both changed files using the repository configuration passed; the forbidden Math usage check and git diff whitespace check passed.
Offline Gradle clean build, full tests, focused tests and the CI Checkstyle task set were blocked during dependency resolution by missing cached commons-lang3:3.20.0, javax.annotation-api:1.3.2, httpclient:4.5.13 and httpcore:4.4.13. The direct tests do not replace a clean build or full-suite validation.
Follow up
Require successful standard build, tests and CI checks before merging. A complete signed-transaction-to-block-to-scan integration test has not been run.
Extra details
Limited to scan-time note decryption and regression tests. Public Note.decode behavior and consensus transaction validation are unchanged. The scanner tests use real note encryption with mocked block and transaction-info retrieval.
Summary by cubic
Skips malformed notes during shielded note scans so a single bad note no longer aborts the entire requested range. Notes with unsupported plaintext headers or negative decoded values are now discarded in both IVK and OVK decryption paths, while valid scan results, commitment checks, and errors for invalid API inputs are preserved.
Adds regression tests for native shielded and TRC20 IVK/OVK scans, covering valid notes on both sides of malformed entries.
Public Note.decode behavior and consensus transaction validation are unchanged.
Written for commit a7a1b45. Summary will update on new commits.
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: d2a98954-f430-4e32-b826-df457ce5b5cc
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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.
What does this PR do?
Skip notes with unsupported plaintext headers or negative decoded values in both note decryption paths. Add regression coverage for native shielded and TRC20 IVK/OVK scans, including valid notes before and after malformed entries.
Why are these changes required?
An authenticated but malformed note currently throws during decoding or value validation and aborts the entire requested scan range. Returning an empty result for that note lets scanning continue while preserving commitment checks and errors for invalid API inputs.
This PR has been tested by:
Follow up
Require successful standard build, tests and CI checks before merging. A complete signed-transaction-to-block-to-scan integration test has not been run.
Extra details
Limited to scan-time note decryption and regression tests. Public Note.decode behavior and consensus transaction validation are unchanged. The scanner tests use real note encryption with mocked block and transaction-info retrieval.
Summary by cubic
Skips malformed notes during shielded note scans so a single bad note no longer aborts the entire requested range. Notes with unsupported plaintext headers or negative decoded values are now discarded in both IVK and OVK decryption paths, while valid scan results, commitment checks, and errors for invalid API inputs are preserved.
Note.decodebehavior and consensus transaction validation are unchanged.Written for commit a7a1b45. Summary will update on new commits.