Skip to content

Conversation

@itamar-starkware
Copy link
Contributor

@itamar-starkware itamar-starkware commented Nov 19, 2025

Added support for properly disabling versioned constants overrides in configuration.

What changed?

  • Added a new ser_optional_sub_config function to handle optional configuration sections
  • Replaced manual handling of optional versioned constants with the new helper function in both batcher and gateway configs
  • Added a new #is_none flag in the config schema to explicitly disable versioned constants overrides
  • Updated the config pointers to propagate this flag to all components that use versioned constants

Why make this change?

This change improves the configuration system by providing a cleaner way to disable optional configuration sections. Previously, optional versioned constants were handled by unwrapping with a default value, which didn't properly represent when the section was intentionally disabled. The new approach with the #is_none flag makes it explicit when a configuration section should be disabled.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

itamar-starkware commented Nov 19, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

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

Copy link
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.

Reviewable status: 0 of 5 files reviewed, 3 unresolved discussions (waiting on @TzahiTaub)


crates/apollo_deployments/resources/app_configs/versioned_constants_overrides_config.json line 2 at r1 (raw file):

{
  "versioned_constants_overrides.#is_none": true,

This sets all of these params as optional in future deployments. Is that intentional?

Code quote:

true

crates/apollo_deployments/resources/app_configs/versioned_constants_overrides_config.json line 7 at r1 (raw file):

  "versioned_constants_overrides.max_recursion_depth": 50,
  "versioned_constants_overrides.validate_max_n_steps": 1000000
}

Please keep the new line 🙏

Code quote:

 

crates/apollo_node_config/src/node_config.rs line 163 at r1 (raw file):

                "gateway_config.stateful_tx_validator_config.versioned_constants_overrides.#is_none",
            ]),
        ),

I think you get this "for free" from the following, could you please check?

    let mut common_execution_config = generate_struct_pointer(
        "versioned_constants_overrides".to_owned(),
        &VersionedConstantsOverrides::default(),
        set_pointing_param_paths(&[
            "batcher_config.block_builder_config.versioned_constants_overrides",
            "gateway_config.stateful_tx_validator_config.versioned_constants_overrides",
        ]),
    );

If the "versioned_constants_overrides.#is_none": is added to the config schema without this chunk then we can just drop it

Code quote:

        (
            ser_pointer_target_param(
                "versioned_constants_overrides.#is_none",
                &false,
                "Flag to disable versioned_constants_overrides for all components.",
            ),
            set_pointing_param_paths(&[
                "batcher_config.block_builder_config.versioned_constants_overrides.#is_none",
                "gateway_config.stateful_tx_validator_config.versioned_constants_overrides.#is_none",
            ]),
        ),

@itamar-starkware itamar-starkware force-pushed the 11-19-apollo_node_config_make_top_level_version_constant_overrides_optional branch from 0653c5f to 3436445 Compare November 24, 2025 06:47
@itamar-starkware itamar-starkware force-pushed the 11-19-apollo_gateway_insert_optional_versioned_constant_overrides_to_batcher branch from 74b46eb to 21939ad Compare November 24, 2025 06:47
@itamar-starkware
Copy link
Contributor Author

crates/apollo_node_config/src/node_config.rs line 163 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

I think you get this "for free" from the following, could you please check?

    let mut common_execution_config = generate_struct_pointer(
        "versioned_constants_overrides".to_owned(),
        &VersionedConstantsOverrides::default(),
        set_pointing_param_paths(&[
            "batcher_config.block_builder_config.versioned_constants_overrides",
            "gateway_config.stateful_tx_validator_config.versioned_constants_overrides",
        ]),
    );

If the "versioned_constants_overrides.#is_none": is added to the config schema without this chunk then we can just drop it

Without this chunk:

        (
            ser_pointer_target_param(
                "versioned_constants_overrides.#is_none",
                &false,
                "Flag to disable versioned_constants_overrides for all components.",
            ),
            set_pointing_param_paths(&[
                "batcher_config.block_builder_config.versioned_constants_overrides.#is_none",
                "gateway_config.stateful_tx_validator_config.versioned_constants_overrides.#is_none",
            ]),
        ),

Those lines do not appear in the config_schema:

  "versioned_constants_overrides.#is_none": {
    "description": "Flag to disable versioned_constants_overrides for all components.",
    "privacy": "TemporaryValue",
    "value": false
  },

And the lines of the other is_none config become independent (without pointerTarget):

  "batcher_config.block_builder_config.versioned_constants_overrides.#is_none": {
    "description": "Flag for an optional field.",
    "privacy": "TemporaryValue",
    "value": false
  }, ...
  "gateway_config.stateful_tx_validator_config.versioned_constants_overrides.#is_none": {
    "description": "Flag for an optional field.",
    "privacy": "TemporaryValue",
    "value": false
  },

@itamar-starkware itamar-starkware force-pushed the 11-19-apollo_node_config_make_top_level_version_constant_overrides_optional branch from 3436445 to 905a1f5 Compare November 24, 2025 07:51
@itamar-starkware
Copy link
Contributor Author

crates/apollo_deployments/resources/app_configs/versioned_constants_overrides_config.json line 7 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

Please keep the new line 🙏

Done

@itamar-starkware
Copy link
Contributor Author

crates/apollo_deployments/resources/app_configs/versioned_constants_overrides_config.json line 2 at r1 (raw file):

Previously, Itay-Tsabary-Starkware wrote…

This sets all of these params as optional in future deployments. Is that intentional?

Yes, please verify me here. @TzahiTaub

@itamar-starkware itamar-starkware force-pushed the 11-19-apollo_node_config_make_top_level_version_constant_overrides_optional branch from 905a1f5 to ccd11b8 Compare November 24, 2025 11:34
@itamar-starkware itamar-starkware force-pushed the 11-19-apollo_gateway_insert_optional_versioned_constant_overrides_to_batcher branch from 21939ad to c8e15be Compare November 24, 2025 11:34
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 2 of 3 files at r2, all commit messages.
Reviewable status: 2 of 5 files reviewed, 3 unresolved discussions (waiting on @itamar-starkware and @Itay-Tsabary-Starkware)


crates/apollo_deployments/resources/app_configs/versioned_constants_overrides_config.json line 2 at r1 (raw file):

Previously, itamar-starkware wrote…

Yes, please verify me here. @TzahiTaub

Correct

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

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

@Yoni-Starkware reviewed all commit messages.
Reviewable status: 2 of 5 files reviewed, 3 unresolved discussions (waiting on @itamar-starkware and @Itay-Tsabary-Starkware)

@itamar-starkware itamar-starkware force-pushed the 11-19-apollo_gateway_insert_optional_versioned_constant_overrides_to_batcher branch from c8e15be to ca29fcc Compare November 26, 2025 14:01
@itamar-starkware itamar-starkware force-pushed the 11-19-apollo_node_config_make_top_level_version_constant_overrides_optional branch from ccd11b8 to c47330a Compare November 26, 2025 14:01
Copy link
Collaborator

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

@ShahakShama reviewed 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Itay-Tsabary-Starkware)


crates/apollo_deployments/resources/app_configs/replacer_versioned_constants_overrides_config.json line 2 at r3 (raw file):

{
  "versioned_constants_overrides.#is_none": true,

@Itay-Tsabary-Starkware please make sure that this is false for potc

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 3 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @itamar-starkware and @Itay-Tsabary-Starkware)

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.

7 participants