Skip to content

blockifier: set missing config validations#12695

Merged
ArniStarkware merged 1 commit intomain-v0.14.2from
arni/blockifier/validate_config/set_missing_config_validations
Feb 22, 2026
Merged

blockifier: set missing config validations#12695
ArniStarkware merged 1 commit intomain-v0.14.2from
arni/blockifier/validate_config/set_missing_config_validations

Conversation

@ArniStarkware
Copy link
Copy Markdown
Contributor

@ArniStarkware ArniStarkware commented Feb 18, 2026

Note

Low Risk
Config-only validation changes; main risk is newly enforced validation causing previously-accepted configs to fail at startup.

Overview
Adds missing validator support and nested validation to ensure ContractClassManagerConfig and its native_compiler_config are validated when included in higher-level configs.

Updates BatcherStaticConfig and GatewayStaticConfig to mark contract_class_manager_config as #[validate(nested)], and updates blockifier to derive Validate for ContractClassManagerConfig (plus adds the validator dependency).

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

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

ArniStarkware commented Feb 18, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ArniStarkware ArniStarkware marked this pull request as ready for review February 18, 2026 11:16
@ArniStarkware ArniStarkware requested a review from a team as a code owner February 18, 2026 11:16
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/native_class_manager/get_runnable_for_readablity branch from e19f5e5 to f250931 Compare February 18, 2026 12:40
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/validate_config/set_missing_config_validations branch from e3dc405 to 16ac2a2 Compare February 18, 2026 12:40
@ArniStarkware ArniStarkware changed the base branch from arni/blockifier/native_class_manager/get_runnable_for_readablity to graphite-base/12695 February 18, 2026 13:10
Copy link
Copy Markdown
Collaborator

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

@avi-starkware reviewed 5 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ArniStarkware and nadin-Starkware).


crates/blockifier/Cargo.toml line 49 at r1 (raw file):

cairo-native = { workspace = true, optional = true }
cairo-vm.workspace = true
dashmap.workspace = true

Why is dashmap needed?

Code quote:

dashmap.workspace = true

crates/blockifier/src/blockifier/config.rs line 143 at r1 (raw file):

pub struct ContractClassManagerConfig {
    pub cairo_native_run_config: CairoNativeRunConfig,
    #[validate(range(min = 1, message = "`contract_cache_size` must be greater than 0"))]

Can we just have an assertion instead?
(In the constructor of the class manager)

Code quote:

    #[validate(range(min = 1, message = "`contract_cache_size` must be greater than 0"))]

@ArniStarkware
Copy link
Copy Markdown
Contributor Author

crates/blockifier/Cargo.toml line 49 at r1 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Why is dashmap needed?

is was moved (alphabetized).

@ArniStarkware
Copy link
Copy Markdown
Contributor Author

@avi-starkware, a short explanation regarding the validator::Validate trait.
Whenever a config is being fed into the infra, the validate schema is run on it. It will not allow the SRE person to load an invalid config.

@ArniStarkware ArniStarkware force-pushed the arni/blockifier/validate_config/set_missing_config_validations branch from 16ac2a2 to ef2714e Compare February 18, 2026 18:17
Copy link
Copy Markdown
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: all files reviewed, 2 unresolved discussions (waiting on avi-starkware and nadin-Starkware).


crates/blockifier/src/blockifier/config.rs line 143 at r1 (raw file):

Previously, avi-starkware (Avi Cohen) wrote…

Can we just have an assertion instead?
(In the constructor of the class manager)

I can remove this validation. We can discuss it in a different context.
It never existed, and it worked just fine.

@ArniStarkware ArniStarkware changed the base branch from graphite-base/12695 to arni/blockifier/native_class_manager/get_runnable_for_readablity February 18, 2026 18:17
@ArniStarkware
Copy link
Copy Markdown
Contributor Author

crates/blockifier/src/blockifier/config.rs line 143 at r1 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

I can remove this validation. We can discuss it in a different context.
It never existed, and it worked just fine.

reverted.

@ArniStarkware ArniStarkware force-pushed the arni/blockifier/native_class_manager/get_runnable_for_readablity branch from 2450e69 to 2d428b5 Compare February 18, 2026 19:00
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/validate_config/set_missing_config_validations branch from ef2714e to cd4cd2f Compare February 18, 2026 19:00
@ArniStarkware ArniStarkware changed the base branch from arni/blockifier/native_class_manager/get_runnable_for_readablity to graphite-base/12695 February 19, 2026 07:57
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/validate_config/set_missing_config_validations branch from cd4cd2f to 5047911 Compare February 19, 2026 07:57
@ArniStarkware ArniStarkware changed the base branch from graphite-base/12695 to main-v0.14.2 February 19, 2026 07:57
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/validate_config/set_missing_config_validations branch from 5047911 to 432618e Compare February 19, 2026 12:03
Copy link
Copy Markdown
Collaborator

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

Copy link
Copy Markdown
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArniStarkware and nadin-Starkware).


crates/apollo_batcher_config/src/config.rs line 240 at r2 (raw file):

    pub contract_class_manager_config: ContractClassManagerConfig,
    pub commitment_manager_config: CommitmentManagerConfig,
    pub max_l1_handler_txs_per_block_proposal: usize,

Why aren't all the fields validated?

Code quote:

pub struct BatcherStaticConfig {
    // TODO(Arni): Set nested validation for storage config.
    pub storage: StorageConfig,
    pub outstream_content_buffer_size: usize,
    pub input_stream_content_buffer_size: usize,
    pub block_builder_config: BlockBuilderConfig,
    pub pre_confirmed_block_writer_config: PreconfirmedBlockWriterConfig,
    #[validate(nested)]
    pub contract_class_manager_config: ContractClassManagerConfig,
    pub commitment_manager_config: CommitmentManagerConfig,
    pub max_l1_handler_txs_per_block_proposal: usize,

@ArniStarkware
Copy link
Copy Markdown
Contributor Author

crates/apollo_batcher_config/src/config.rs line 240 at r2 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Why aren't all the fields validated?

Spectacular question.

I partially answered it in #12703.

@ArniStarkware
Copy link
Copy Markdown
Contributor Author

crates/apollo_batcher_config/src/config.rs line 240 at r2 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

Spectacular question.

I partially answered it in #12703.

pub storage: StorageConfig, - Addressed in #12703
pub outstream_content_buffer_size: usize, - buffer size. Should we validate
pub input_stream_content_buffer_size: usize,  - buffer size. Should we validate 
pub block_builder_config: BlockBuilderConfig, - Has no current validation on it, and this struct is complicated.
pub pre_confirmed_block_writer_config: PreconfirmedBlockWriterConfig, - Has no current validation on it, but it has uszie and u64 as members. 
pub contract_class_manager_config: ContractClassManagerConfig, - validated as of this PR.
pub commitment_manager_config: CommitmentManagerConfig, - Has no current validation on it, but it holds two usizes as members.
pub max_l1_handler_txs_per_block_proposal: usize, - not validated. Not sure what the value should be.... If there is a lower bound or an upper bound.... I can imagine a case where this number is zero.

Copy link
Copy Markdown
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

@Itay-Tsabary-Starkware resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on nadin-Starkware).

Copy link
Copy Markdown
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-Starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

@Itay-Tsabary-Starkware reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on nadin-Starkware).

@ArniStarkware ArniStarkware added this pull request to the merge queue Feb 22, 2026
Merged via the queue into main-v0.14.2 with commit dd82207 Feb 22, 2026
27 of 29 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants