Skip to content

starknet_transaction_prover: add request body size limit tests - #14403

Merged
avi-starkware merged 1 commit into
main-v0.14.3from
avi/privacy/request-body-size-tests-v2
Jun 8, 2026
Merged

starknet_transaction_prover: add request body size limit tests#14403
avi-starkware merged 1 commit into
main-v0.14.3from
avi/privacy/request-body-size-tests-v2

Conversation

@avi-starkware

@avi-starkware avi-starkware commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Adds integration tests for the JSON-RPC server's max_request_body_size enforcement — previously untested at the prover-server level:

  • test_default_limit_accepts_5000_felt_calldata — a starknet_proveTransaction request carrying 5,000 full-width (Felt::MAX) calldata felts (~350 KiB body, the largest JSON encoding such calldata can produce) is accepted under the production-default 5 MiB limit. DEFAULT_MAX_REQUEST_BODY_SIZE is made pub(crate) so the test tracks the real default.
  • test_body_size_limit_boundary — the limit is inclusive: a body of exactly the configured size is served; one byte over is rejected with HTTP 413.

🤖 Generated with Claude Code

@cursor

cursor Bot commented Jun 7, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only change plus making a default constant visible to the crate; no production server logic changes.

Overview
Adds HTTP integration tests for jsonrpsee’s max_request_body_size on the transaction prover server, without changing runtime behavior.

DEFAULT_MAX_REQUEST_BODY_SIZE (5 MiB) is now pub(crate) so tests can assert against the same default the service uses. A new request_body_size_test module spins up a mock HTTP server via start_server and posts JSON-RPC bodies.

One test checks that a large starknet_proveTransaction payload (5,000 max-width calldata felts, ~350 KiB) succeeds under the default limit. Another uses rstest to confirm the limit is inclusive: a body padded to exactly the configured size returns 200, and one extra byte returns 413 Payload Too Large.

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

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@Yoni-Starkware Yoni-Starkware left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

:lgtm:

@Yoni-Starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on avi-starkware).

@avi-starkware
avi-starkware added this pull request to the merge queue Jun 8, 2026
Merged via the queue into main-v0.14.3 with commit 4d0357c Jun 8, 2026
30 of 38 checks passed
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.

3 participants