Skip to content

Conversation

@ArniStarkware
Copy link
Contributor

@ArniStarkware ArniStarkware commented Feb 8, 2026

Note

Low Risk
Small, localized config + routing change that only affects request size handling; main risk is inadvertently rejecting/allowing larger requests due to misconfiguration.

Overview
Adds a new static HTTP server config max_request_body_size (default 5MB) and exposes it through config dumping/schema and deployment app config templates.

Updates the Axum router so POST endpoints (/gateway/add_transaction and /gateway/add_rpc_transaction) enforce the configured request body limit via DefaultBodyLimit.

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

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

ArniStarkware commented Feb 8, 2026

@ArniStarkware ArniStarkware marked this pull request as ready for review February 8, 2026 12:54
@ArniStarkware ArniStarkware force-pushed the arni/gateway_http_server/max_request_body_size_config branch from 47b53af to 4f57e64 Compare February 8, 2026 14:05
@ArniStarkware ArniStarkware force-pushed the arni/gateway_http_server/max_request_body_size_config branch from 4f57e64 to 2a03207 Compare February 8, 2026 15:10
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.

Copy link
Collaborator

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

@meship-starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: 3 of 5 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware and @TzahiTaub).


crates/apollo_http_server_config/src/config.rs line 15 at r2 (raw file):

// The value is chosen to be much larger than the transaction size limit as enforced by the Starknet
// protocol.
const DEFAULT_MAX_REQUEST_BODY_SIZE: usize = 5 * 1024 * 1024; // 5MB

This is not the constraint, right? As for now, transactions with proof can reach 6MB; we aim to lower it, but for the test env we need a larger margin.

Code quote:

const DEFAULT_MAX_REQUEST_BODY_SIZE: usize = 5 * 1024 * 1024; // 5MB

Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

@TzahiTaub made 1 comment.
Reviewable status: 3 of 5 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @eitanm-starkware, @meship-starkware, and @ob1337).


crates/apollo_http_server_config/src/config.rs line 15 at r2 (raw file):

Previously, meship-starkware (Meshi Peled) wrote…

This is not the constraint, right? As for now, transactions with proof can reach 6MB; we aim to lower it, but for the test env we need a larger margin.

@ob1337 @eitanm-starkware

@ArniStarkware ArniStarkware force-pushed the arni/gateway_http_server/max_request_body_size_config branch 3 times, most recently from 57eaeb6 to 8efb25f Compare February 9, 2026 13:31
Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

@TzahiTaub reviewed 5 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware).


a discussion (no related file):
Please add a check (or TODO here) when polling the dynamic config, that max_sierra_program_size > max_request_body_size and log a warning if it isn't.

Copy link
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

@ArniStarkware made 1 comment.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @TzahiTaub).


a discussion (no related file):

Previously, TzahiTaub (Tzahi) wrote…

Please add a check (or TODO here) when polling the dynamic config, that max_sierra_program_size > max_request_body_size and log a warning if it isn't.

Done, Addressed in #12438

Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

@TzahiTaub reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware).

@ArniStarkware ArniStarkware added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main-v0.14.1-committer with commit 4188396 Feb 10, 2026
17 of 24 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.

4 participants