Skip to content

Split expensive tests based on n={1, 2, 3}#194

Merged
automergerpr-permission-manager[bot] merged 6 commits intoproofsfrom
mk/spli-n-versions
Apr 15, 2026
Merged

Split expensive tests based on n={1, 2, 3}#194
automergerpr-permission-manager[bot] merged 6 commits intoproofsfrom
mk/spli-n-versions

Conversation

@mariaKt
Copy link
Copy Markdown

@mariaKt mariaKt commented Apr 14, 2026

This PR adds test functions with assumptions in order to split expensive multisig proofs into per-N variants (n=1, n=2, n=3)

The most expensive multisig proof tests (burn, burn_checked, transfer, transfer_checked, set_authority_account, set_authority_mint) each explore all three values of N (number of registered signers) in a single proof. The validate_owner signer-checking loop produces an N=1/N=2/N=3 cascade, multiplying the combinatorial path count and making these proofs very large (40+ hours, high memory usage).

This PR adds _n1, _n2, _n3 variants of each test function that constrain multisig.n to a specific value instead of the range 1..MAX_SIGNERS. Each variant replaces:

if multisig.n < 1 || multisig.n > MAX_SIGNERS_U8 {
    return Ok(());
}

with:

if multisig.n != 1 {  // or 2, or 3
    return Ok(());
}

The rest of the function body is identical. The three per-N proofs together cover the same state space as the original combined proof.

Functions added (18 total, 3 per test):

  • test_process_burn_multisig_n1/n2/n3
  • test_process_burn_checked_multisig_n1/n2/n3
  • test_process_transfer_multisig_n1/n2/n3
  • test_process_transfer_checked_multisig_n1/n2/n3
  • test_process_set_authority_account_multisig_n1/n2/n3
  • test_process_set_authority_mint_multisig_n1/n2/n3

Each variant is added to the same spec file as the original function and referenced in use_tests in both p-token and spl-token entrypoints to ensure inclusion in the smir json.

Expected benefits:

  • The n=3 path is definitely the most expensive, but each per-N proof is definitely more manageable compared to the combined proof (fewer splits, less memory)
  • Per-N proofs can run in parallel on the online server
  • Individual proofs are less likely to OOM
  • The M threshold remains symbolic (1..MAX_SIGNERS) in all variants, but we could choose to further reduce branching by restricting this in favor of more variants as well.

Original functions are preserved — the combined test_process_*_multisig functions remain unchanged, for dispatch.

Also included: A minor fix adding a missing doc comment on MAX_SIGNERS in interface/src/instruction.rs (pre-existing lint error for spl-token builds).

@mariaKt mariaKt requested a review from Stevengre April 14, 2026 14:21
@mariaKt mariaKt force-pushed the mk/spli-n-versions branch from 4443daf to f4b06c4 Compare April 14, 2026 23:14
@automergerpr-permission-manager automergerpr-permission-manager Bot merged commit 3f0d70d into proofs Apr 15, 2026
2 checks passed
@mariaKt mariaKt deleted the mk/spli-n-versions branch April 15, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants