Skip to content

starknet_transaction_prover: add ServiceConfig validation tests - #14049

Open
avi-starkware wants to merge 1 commit into
avi/privacy/cors-tests-v2from
avi/privacy/config-validation-tests-v2
Open

starknet_transaction_prover: add ServiceConfig validation tests#14049
avi-starkware wants to merge 1 commit into
avi/privacy/cors-tests-v2from
avi/privacy/config-validation-tests-v2

Conversation

@avi-starkware

@avi-starkware avi-starkware commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Adds unit tests for ServiceConfig::from_args: missing rpc_url, zero
max_concurrent_requests / max_connections, mutual exclusion of --no-cors
and --cors-allow-origin, --no-cors clearing config-file origins,
--skip-fee-field-validation reaching ProverConfig, config-file values used
when CLI flags are absent, and CLI flags overriding config-file values.

The CORS cases here cover only the wiring — that from_args routes origins
through normalize_cors_allow_origins and propagates its rejection — plus
wildcard_ignores_invalid, which has no counterpart at the other layer.
cors_test.rs (#14048) owns the normalization matrix itself; duplicating it here
meant two places to update for one behaviour.

tls_config_validation loses a case column that was None in every case, and
gains the shape it was evidently there for: a config file supplying
tls_cert_file with no CLI key, which the CLI-only cases cannot express.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor

cursor Bot commented May 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Changes are limited to unit tests; they document existing validation behavior without modifying server config logic.

Overview
Test-only expansion and cleanup around ServiceConfig::from_args in config_test.rs—no production behavior changes.

New coverage pins required rpc_node_url, rejection of zero limits (max_concurrent_requests, max_connections, max_request_body_size), invalid parses (IP, fee token address, blocking check URL), mutual exclusion of --no-cors and --cors-allow-origin, --skip-fee-field-validation affecting ProverConfig, and config-file vs CLI precedence (including --no-cors clearing file origins). TLS tests drop a redundant rstest column and add config_file_tls_cert_without_key_is_rejected for partial TLS from JSON only.

CORS wiring tests are slimmed down so cors_test.rs holds the full normalization matrix; here they only assert that from_args routes through normalization and propagates rejections. Assertions increasingly use assert_matches for clearer error expectations.

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

@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 3bf5954 to 8600ded Compare May 17, 2026 17:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 8aa40a1 to b5dba94 Compare May 17, 2026 17:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 8600ded to 96bf8d9 Compare May 17, 2026 19:07
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch 2 times, most recently from 9636c86 to 20c98e9 Compare May 20, 2026 08:33
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 96bf8d9 to 056f406 Compare May 20, 2026 08:33
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 20c98e9 to d437078 Compare May 31, 2026 10:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 056f406 to 3a5608b Compare May 31, 2026 10:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from d437078 to 8342ce5 Compare June 7, 2026 11:46
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 3a5608b to 38dd27c Compare June 7, 2026 11:46
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 44f2584 to f05b07f Compare July 9, 2026 13:03
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch 2 times, most recently from 5584d93 to 95ab04d Compare July 9, 2026 13:57
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from f05b07f to 44eccac Compare July 9, 2026 13:57
@github-actions github-actions Bot removed the stale label Jul 10, 2026
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 95ab04d to dde27e4 Compare July 12, 2026 10:09
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch 2 times, most recently from 31f18eb to bef2115 Compare July 12, 2026 12:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from dde27e4 to 68f6fc1 Compare July 12, 2026 12:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from bef2115 to b5aa7f0 Compare July 19, 2026 13:25
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 68f6fc1 to 474fba7 Compare July 19, 2026 13:25
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from b5aa7f0 to c86b17e Compare August 25, 2026 19:33
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 474fba7 to 591cf1b Compare August 25, 2026 19:33
Adds unit tests for ServiceConfig::from_args covering: missing rpc_url
rejection, zero max_concurrent_requests / max_connections rejection,
mutual exclusion of --no-cors and --cors-allow-origin, --no-cors
clearing config-file origins, --skip-fee-field-validation propagating
to ProverConfig, config-file values being used when CLI flags are
absent, CLI flags overriding config-file values, and additional CORS
scheme/userinfo rejection at the config layer.
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from c86b17e to c9610b9 Compare August 25, 2026 20:01
@avi-starkware
avi-starkware force-pushed the avi/privacy/config-validation-tests-v2 branch from 591cf1b to 6445447 Compare August 25, 2026 20:01
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