Skip to content

feat: nested multi-sign tests and review fixes#4

Merged
RichardAH merged 13 commits into
RichardAH:nested-multi-sign-rippledfrom
sublimator:nested-multi-sign-rippled
Feb 13, 2026
Merged

feat: nested multi-sign tests and review fixes#4
RichardAH merged 13 commits into
RichardAH:nested-multi-sign-rippledfrom
sublimator:nested-multi-sign-rippled

Conversation

@sublimator
Copy link
Copy Markdown

No description provided.

RichardAH and others added 12 commits February 10, 2026 12:44
Transplant 3 xahaud review-fix commits (dbd5903e8, 23fd210e2, 8d9a38e44)
on top of the initial rippled backport (0b5220b).

- Add shared helper functions (isLeafSigner, isNestedSigner,
  isValidSignerEntry, countPresentFields) and depth constants
  (nestedMultiSignMaxDepth, legacyMultiSignMaxDepth) to STTx.h
- Rewrite Transactor::checkMultiSign with recursive validation,
  cycle detection via ancestors set, and cyclic lockout relaxation
- Update calculateBaseFee with depth guard and helper usage
- Refactor STTx.cpp multiSignHelper to use helpers and add
  malformed signer entry detection
- Replace TransactionSign.cpp signer validation with recursive
  validateSignersRecursive using helpers
- Add test_countPresentFields unit test and nested fee calculation
  test cases (Test Cases 16-17)
- Update STTx_test.cpp for optional sfSigningPubKey with
  validation-layer helper checks
- Fix feature-disabled test expectation (telENV_RPC_FAILED)
- fix nested signer array bounds check using wrong variable (signers vs
  signersArray) in STTx.cpp multiSignHelper
- move auth check before cyclic skip in Transactor.cpp so unauthorized
  cyclic signer entries are rejected instead of silently ignored
- add tests for nested array cardinality (empty/oversized)
- add tests for unauthorized vs authorized cyclic signer entries
Add testNestedMultiSignEdgeCases with 10 tests targeting uncovered
code paths across the three validation layers: multiSignHelper
(depth overflow, corrupt pubkey, malformed entries, unsorted signers),
Transactor::checkMultiSign (fee calculation, non-phantom signers,
cyclic quorum), and transactionSubmitMultiSigned (RPC shape and depth
validation). Includes a direct checkSign test for the depth-exceeded
path using manually-constructed STObjects.
Add nestedMultiSignMaxLeafSigners (64) to bound worst-case signature
verification cost. The leaf counter in multiSignHelper increments
before each verify() call and rejects with "Too many leaf signers."
when exceeded. Only enforced when featureNestedMultiSign is enabled.

Tests: leaf cap exceeded (65 leaves → temMALFORMED) and at-cap
succeeds (64 leaves via 2×32 nested tree → tesSUCCESS).
checkSign rejects >64 leaves before the transaction enters the
engine, so env() cannot extract a TER code and returns
telENV_RPC_FAILED rather than temMALFORMED.
Plain assert is compiled out in release builds, dropping these
consensus-critical invariant checks in production.
@RichardAH RichardAH force-pushed the nested-multi-sign-rippled branch from 0b5220b to e45514f Compare February 13, 2026 04:00
@RichardAH RichardAH marked this pull request as ready for review February 13, 2026 04:07
@RichardAH RichardAH merged commit ca52307 into RichardAH:nested-multi-sign-rippled Feb 13, 2026
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