Skip to content

fix: adopt Sapling recipient validation and JNI regressions - #25

Draft
Federico2014 wants to merge 4 commits into
tronprotocol:developfrom
Federico2014:fix/reject-degenerate-sapling-recipients
Draft

Federico2014 wants to merge 4 commits into
tronprotocol:developfrom
Federico2014:fix/reject-degenerate-sapling-recipients

Conversation

@Federico2014

@Federico2014 Federico2014 commented Nov 30, 2026 •

Copy link
Copy Markdown

Pin Rust to 88c01cfc29064c379e44637ff6235b1d91134dc7 to reject identity recipient public keys and zero ephemeral secrets during Sapling output proving. JNI returns the existing boolean false; Java and native signatures remain unchanged.

Add NativeRecipientTest with real initialized parameters: reject alternate identity encodings, order-four/malformed points and zero secrets, preserve outputs, retry a nonempty context, verify valid outputs and the final binding signature. Retain historical commitment and key-agreement behavior. Give the shared test fixture loader empty defaults for its optional properties.

This branch builds on #24; the final commit contains this integration and its tests. Only the mode-160000 Rust gitlink is updated, with no submodule sources copied.

Validation on macOS x86_64 / JDK 8:

  • Both new regression cases passed against normal release JNI, using SDK fixtures and separately java-tron's production parameters.
  • The rejection test fails against the previous normal release JNI.
  • 35 existing SDK tests passed.
  • Seven node tests passed with both old and rebuilt JNI, including both transaction builders, ordinary encryption/decryption and historical ciphertext reading.

Draft for release integration: the four bundled platform binaries are unchanged. Rebuild the combined fixes and verify the final JAR before release. See docs/recipient-validation.md for the opt-in native regression command.

Companion PRs: tronprotocol/librustzcash#18 and tronprotocol/java-tron#7133.

@BeforeClass
public static void initialize() throws Exception {
String path = System.getProperty("recipient.test.library");
Assume.assumeNotNull(path);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[SHOULD] Make both NativeRecipientTest cases mandatory for the four-platform release build.

Could we run both NativeRecipientTest cases against the normal JNI library that will be packaged in the final JAR on each of the four supported platforms?

Please explicitly set recipient.test.library to the freshly built JNI library and require both test cases to execute and pass on every platform. The release validation should fail if the test report is missing, either test case is skipped, or either test case fails.

This suite does not require a fault-injection build, so it can be included directly in the standard release workflow.

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.

2 participants