Skip to content

starknet_transaction_prover: add prover input validation unit tests#13133

Open
avi-starkware wants to merge 1 commit intoavi/privacy/error-sanitizationfrom
avi/privacy/prover-input-validation-tests
Open

starknet_transaction_prover: add prover input validation unit tests#13133
avi-starkware wants to merge 1 commit intoavi/privacy/error-sanitizationfrom
avi/privacy/prover-input-validation-tests

Conversation

@avi-starkware
Copy link
Collaborator

@avi-starkware avi-starkware commented Mar 10, 2026

Summary

  • Add 7 unit tests for validate_transaction_input: pending block rejection, non-invoke transaction types, proof/proof_facts field checks, fee field enforcement, and fee validation toggle
  • Add test-only with_fee_validation builder method on VirtualSnosProver

Test plan

  • SEED=0 cargo test -p starknet_transaction_prover -- virtual_snos_prover_test — 7 pass, 2 ignored (integration)

🤖 Generated with Claude Code


Note

Low Risk
Low risk because changes are test-only plus a test-time toggle for fee-field validation; no production proving logic is modified beyond how tests construct the prover.

Overview
Adds a focused set of unit tests around VirtualSnosProver::prove_transaction input validation (rejects Pending block IDs, non-InvokeV3 tx types, non-empty proof/proof_facts, and non-zero fee-related fields when validation is enabled).

Introduces lightweight mock runners (UnreachableRunner, FailingRunner) to assert whether validation short-circuits before OS execution, and updates the ignored Sepolia integration tests to call .disable_fee_validation() so they exercise the full pipeline without fee-field constraints.

Written by Cursor Bugbot for commit 0fca6ef. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from 43d4c74 to ee5e11d Compare March 10, 2026 14:27
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch 2 times, most recently from 7982e54 to b748325 Compare March 10, 2026 14:36
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from ee5e11d to 4bda7e3 Compare March 10, 2026 14:36
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from b748325 to 79d53a0 Compare March 10, 2026 14:55
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch 2 times, most recently from 02d25e3 to 5225da0 Compare March 10, 2026 15:07
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from 79d53a0 to 74372d3 Compare March 10, 2026 15:07
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from 5225da0 to e6f2c6f Compare March 10, 2026 16:39
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from 74372d3 to 8ad5806 Compare March 10, 2026 16:39
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from e6f2c6f to f7e548f Compare March 10, 2026 17:16
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch 2 times, most recently from d60783c to f370546 Compare March 10, 2026 18:01
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from f7e548f to 87684b7 Compare March 10, 2026 18:01
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from 87684b7 to 5967250 Compare March 10, 2026 19:58
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from f370546 to a0eca5b Compare March 10, 2026 19:58
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from 5967250 to e1bf622 Compare March 11, 2026 05:58
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from a0eca5b to 6848848 Compare March 11, 2026 05:58
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from e1bf622 to 872a9ae Compare March 11, 2026 07:18
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from 6848848 to 8440f7b Compare March 11, 2026 07:18
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from 872a9ae to f2904ac Compare March 11, 2026 08:01
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from 8440f7b to b174fa7 Compare March 11, 2026 08:01
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from b174fa7 to ae858d3 Compare March 11, 2026 08:38
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from f2904ac to 21a9f20 Compare March 11, 2026 08:38
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from ae858d3 to 7d0dc27 Compare March 11, 2026 12:23
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from 21a9f20 to 55dc3f7 Compare March 11, 2026 12:23
Add 7 unit tests for validate_transaction_input covering pending block
rejection, non-invoke transaction types, proof/proof_facts fields,
fee field enforcement, and fee validation toggle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avi-starkware avi-starkware force-pushed the avi/privacy/error-sanitization branch from 55dc3f7 to 9e21cc4 Compare March 11, 2026 13:33
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests branch from 7d0dc27 to 0fca6ef Compare March 11, 2026 13:33
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