Skip to content

starknet_transaction_prover: add prover input validation unit tests#14047

Open
avi-starkware wants to merge 1 commit into
avi/privacy/committer-utils-tests-v2from
avi/privacy/prover-input-validation-tests-v2
Open

starknet_transaction_prover: add prover input validation unit tests#14047
avi-starkware wants to merge 1 commit into
avi/privacy/committer-utils-tests-v2from
avi/privacy/prover-input-validation-tests-v2

Conversation

@avi-starkware

Copy link
Copy Markdown
Collaborator

Adds unit tests for VirtualSnosProver input validation: pending block
rejection, DeployAccount rejection, proof/proof_facts field rejection,
non-zero fee field rejection (with the validation knob respected when
disabled), and a happy-path test that asserts a valid invoke reaches
the runner.

Adds two test runners — UnreachableRunner (panics on invocation, for
tests where validation must reject the input) and FailingRunner (returns
an error, for tests that must verify the runner is reached without
needing a real node).

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@avi-starkware avi-starkware marked this pull request as ready for review May 17, 2026 15:42
@cursor

cursor Bot commented May 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only and pub(crate) constructor refactors; production ProverConfig behavior is unchanged.

Overview
Adds unit tests for VirtualSnosProver::prove_transaction input validation without a real RPC node, using mock VirtualSnosRunner implementations.

Prover test hooks: from_runner / from_runner_with_blocking_check now delegate to a shared from_runner_with_options that sets validate_zero_fee_fields. A new from_runner_without_fee_validation lets tests send non-zero fee fields and still reach the runner when exercising other gates.

Test doubles: UnreachableRunner panics if invoked (assert validation rejected early); FailingRunner returns a fixed RunnerError so tests can prove the runner was reached.

Coverage: Rejects pending blocks, DeployAccount, non-empty proof / proof_facts, and non-zero fee fields when validation is on; with validation off, non-zero resource bounds pass through to the runner; a valid invoke is shown to hit the runner. Also adds an ignored Sepolia balanceOf integration test and small shared helpers (valid_invoke, dummy_account).

Reviewed by Cursor Bugbot for commit 6141678. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit 62bd425. Configure here.

@avi-starkware avi-starkware force-pushed the avi/privacy/committer-utils-tests-v2 branch from 55fbb37 to a142608 Compare May 17, 2026 17:39
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 62bd425 to e7ccb94 Compare May 17, 2026 17:39
@avi-starkware avi-starkware force-pushed the avi/privacy/committer-utils-tests-v2 branch from a142608 to ad656d1 Compare May 17, 2026 19:07
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from e7ccb94 to 0523284 Compare May 17, 2026 19:07
@avi-starkware avi-starkware force-pushed the avi/privacy/committer-utils-tests-v2 branch from ad656d1 to 7a2f45c Compare May 20, 2026 08:33
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 0523284 to 3275e20 Compare May 20, 2026 08:33
@avi-starkware avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 3275e20 to 63d5c0b Compare May 31, 2026 10:39
@avi-starkware avi-starkware force-pushed the avi/privacy/committer-utils-tests-v2 branch from 7a2f45c to 257e70a Compare May 31, 2026 10:39
Adds unit tests for VirtualSnosProver input validation: pending block
rejection, DeployAccount rejection, proof/proof_facts field rejection,
non-zero fee field rejection (with the validation knob respected when
disabled), and a happy-path test that asserts a valid invoke reaches
the runner.

Adds two test runners — UnreachableRunner (panics on invocation, for
tests where validation must reject the input) and FailingRunner (returns
an error, for tests that must verify the runner is reached without
needing a real node).
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