From 66a55ac8b193df0b2801950207251f47fce1de85 Mon Sep 17 00:00:00 2001 From: Nimrod Weiss Date: Thu, 25 Jun 2026 11:02:32 +0300 Subject: [PATCH] deployment: add native config layers for the testing overlays Under the native config path an overlay's config comes from sequencer_config.jsonnet layers (YAML sequencerConfig is ignored). The testing/node-0 and testing/all-constructs overlays (synthed by the cdk8s-test and hybrid-system-test CI jobs) had no native layer, so native synth aborted on unconditionally-read overrides.* keys (validator_id, the outer committer cache_size, ...). - testing/node-0: full value-parity native layer (the folded translation of its combined YAML sequencerConfig). It is deployed live by hybrid_system_test, so values are load-bearing; guarded by a strict mirror test (test_node0_layer_jsonnet_mirrors_combined_yaml). - testing/all-constructs: a structure-validation stub supplying exactly the unconditional overrides.* reads the base layer does not provide, with clearly-dummy immaterial values (its synth is only kubectl-validated for manifest structure); guarded by a synth-success test (test_all_constructs_native_config_synthesizes). This lets every CI-synthed overlay build under native, before the default flip. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../all-constructs/sequencer_config.jsonnet | 96 +++++++++++ .../testing/node-0/sequencer_config.jsonnet | 155 ++++++++++++++++++ .../sequencer/test/test_native_config.py | 40 ++++- 3 files changed, 290 insertions(+), 1 deletion(-) create mode 100644 deployments/sequencer/configs/overlays/hybrid/testing/all-constructs/sequencer_config.jsonnet create mode 100644 deployments/sequencer/configs/overlays/hybrid/testing/node-0/sequencer_config.jsonnet diff --git a/deployments/sequencer/configs/overlays/hybrid/testing/all-constructs/sequencer_config.jsonnet b/deployments/sequencer/configs/overlays/hybrid/testing/all-constructs/sequencer_config.jsonnet new file mode 100644 index 00000000000..e4213731ab5 --- /dev/null +++ b/deployments/sequencer/configs/overlays/hybrid/testing/all-constructs/sequencer_config.jsonnet @@ -0,0 +1,96 @@ +// Overrides layer for the `testing/all-constructs` overlay (hybrid layout). +// +// `all-constructs` is a STRUCTURE-validation stub: the cdk8s synth it feeds is only `kubectl +// validate`d for manifest structure, never for config content. Its YAML `config.sequencerConfig` +// carries no real applicative values (only `components.fake_field`, which folds away). Native synth, +// however, hard-requires the per-environment `overrides.*` reads that `applicative_config.libsonnet` +// performs unconditionally and that the base `common` layer does not already supply (every service's +// component config is assembled, including the l1/batcher/state-sync paths). This layer supplies the +// minimum for `build()` to succeed with clearly-dummy values; NONE of these values are deployed +// anywhere, so they are immaterial. +// +// Because this layer intentionally carries fields its YAMLs lack, it is NOT subject to the strict +// per-layer YAML-mirror invariant the env/dummy layers obey; the regression test for it only asserts +// that native synth succeeds (see `test_all_constructs_native_config_synthesizes`). +{ + chain_id: 'SN_DUMMY', + native_classes_whitelist: 'All', + recorder_url: 'http://dummy-recorder/', + starknet_url: 'http://dummy-starknet/', + validator_id: '0x64', + + base_layer_config: { + bpo1_start_block_number: 0, + bpo2_start_block_number: 0, + fusaka_no_bpo_start_block_number: 0, + starknet_contract_address: '0x0', + }, + + batcher_config: { + dynamic_config: { + n_concurrent_txs: 1, + }, + static_config: { + block_builder_config: { + bouncer_config: { + block_max_capacity: { + state_diff_size: 4000, + }, + }, + execute_config: { + n_workers: 1, + }, + }, + first_block_with_partial_block_hash: null, + }, + }, + + committer_config: { + storage_config: { + cache_size: 1000000, + }, + }, + + consensus_manager_config: { + context_config: { + dynamic_config: { + min_l2_gas_price_per_height: '', + }, + }, + network_config: { + advertised_multiaddr: null, + bootstrap_peer_multiaddr: null, + }, + staking_manager_config: { + dynamic_config: { + default_committee: '0,10:0x64,1,0x1,true', + }, + }, + }, + + gateway_config: { + static_config: { + proof_archive_writer_config: { + bucket_name: '', + }, + }, + }, + + mempool_p2p_config: { + network_config: { + advertised_multiaddr: null, + bootstrap_peer_multiaddr: null, + }, + }, + + sierra_compiler_config: { + audited_libfuncs_only: false, + }, + + state_sync_config: { + static_config: { + central_sync_client_config: null, + network_config: null, + }, + }, +} diff --git a/deployments/sequencer/configs/overlays/hybrid/testing/node-0/sequencer_config.jsonnet b/deployments/sequencer/configs/overlays/hybrid/testing/node-0/sequencer_config.jsonnet new file mode 100644 index 00000000000..1cf7570ad95 --- /dev/null +++ b/deployments/sequencer/configs/overlays/hybrid/testing/node-0/sequencer_config.jsonnet @@ -0,0 +1,155 @@ +// Overrides layer for the `testing/node-0` overlay (hybrid layout). +// Full value-parity translation of the combined `config.sequencerConfig` across this overlay's +// `common.yaml` + `services/*.yaml` (folded: `#is_none` applied, `components.*` dropped). This is a +// FUNCTIONAL overlay deployed live by `hybrid_system_test.yaml`, so the values are load-bearing and +// must stay byte-for-byte aligned with the YAMLs (enforced by `test_native_config.py`). +{ + chain_id: 'CHAIN_ID_SUBDIR', + eth_fee_token_address: '0x1001', + native_classes_whitelist: 'All', + recorder_url: 'http://dummy-recorder-service.dummy-recorder.svc.cluster.local:8080', + starknet_url: 'https://integration-sepolia.starknet.io/', + strk_fee_token_address: '0x1002', + validator_id: '0x64', + versioned_constants_overrides: null, + + base_layer_config: { + bpo1_start_block_number: 13205504, + bpo2_start_block_number: 13410304, + fusaka_no_bpo_start_block_number: 13164544, + starknet_contract_address: '0x5FbDB2315678afecb367f032d93F642f64180aa3', + }, + + batcher_config: { + dynamic_config: { + n_concurrent_txs: 100, + proposer_idle_detection_delay_millis: 2000, + }, + static_config: { + block_builder_config: { + bouncer_config: { + block_max_capacity: { + n_events: 5000, + receipt_l2_gas: 5800000000, + state_diff_size: 4000, + }, + }, + execute_config: { + n_workers: 28, + }, + }, + first_block_with_partial_block_hash: null, + }, + }, + + class_manager_config: { + static_config: { + class_manager_config: { + max_compiled_contract_class_object_size: 4089446, + }, + }, + }, + + committer_config: { + storage_config: { + cache_size: 1000000, + inner_storage_config: { + cache_size: 8589934592, + }, + }, + verify_state_diff_hash: true, + }, + + consensus_manager_config: { + consensus_manager_config: { + dynamic_config: { + require_virtual_proposer_vote: false, + timeouts: { + proposal: { + base: 9.1, + max: 15.0, + }, + }, + }, + }, + context_config: { + dynamic_config: { + build_proposal_margin_millis: 1000, + compare_retrospective_block_hash: false, + min_l2_gas_price_per_height: '', + override_eth_to_fri_rate: null, + override_l1_data_gas_price_fri: null, + override_l1_gas_price_fri: null, + override_l2_gas_price_fri: null, + }, + }, + network_config: { + advertised_multiaddr: null, + bootstrap_peer_multiaddr: null, + port: 53080, + }, + staking_manager_config: { + dynamic_config: { + default_committee: '0,100:0x64,1,0x1,true', + override_committee: null, + }, + }, + }, + + gateway_config: { + static_config: { + authorized_declarer_accounts: null, + proof_archive_writer_config: { + bucket_name: '', + }, + stateful_tx_validator_config: { + max_allowed_nonce_gap: 200, + }, + stateless_tx_validator_config: { + max_contract_bytecode_size: 81920, + min_gas_price: 3000000000, + }, + }, + }, + + http_server_config: { + static_config: { + port: 8080, + }, + }, + + mempool_config: { + dynamic_config: { + transaction_ttl: 300, + }, + }, + + mempool_p2p_config: { + network_config: { + advertised_multiaddr: null, + bootstrap_peer_multiaddr: null, + port: 53200, + }, + }, + + monitoring_endpoint_config: { + port: 8082, + }, + + sierra_compiler_config: { + audited_libfuncs_only: false, + max_bytecode_size: 81920, + }, + + state_sync_config: { + static_config: { + central_sync_client_config: null, + network_config: { + port: 55010, + }, + rpc_config: { + port: 8090, + }, + }, + }, +} diff --git a/deployments/sequencer/test/test_native_config.py b/deployments/sequencer/test/test_native_config.py index 732c85d2773..0beca975562 100644 --- a/deployments/sequencer/test/test_native_config.py +++ b/deployments/sequencer/test/test_native_config.py @@ -11,11 +11,12 @@ import _jsonnet import yaml -from src.config.native import JSONNET_DIR, deep_merge_preserving_null +from src.config.native import JSONNET_DIR, build_native_config, deep_merge_preserving_null DEPLOYMENTS_SEQUENCER = Path(__file__).resolve().parents[1] LAYOUT = "hybrid" +CORE_SERVICE = "core" # Per-layer override-file dirs: each layer holds a `sequencer_config.jsonnet` that must mirror the # combined `config.sequencerConfig` of the YAMLs in the same dir (see @@ -26,6 +27,13 @@ SEPOLIA_ALPHA_LAYER_DIR = HYBRID_OVERLAYS_DIR / "sepolia-alpha" MAINNET_LAYER_DIR = HYBRID_OVERLAYS_DIR / "mainnet" DUMMY_FOR_TESTING_LAYER_DIR = HYBRID_OVERLAYS_DIR / "common" / "dummy_for_testing" +# Functional testing overlay deployed live by `hybrid_system_test.yaml`; its native layer is a full +# value-parity translation of its YAMLs (subject to the strict YAML-mirror invariant below). +NODE0_LAYER_DIR = HYBRID_OVERLAYS_DIR / "testing" / "node-0" +# Structure-validation overlay (cdk8s `kubectl validate` only); its native layer is a synth-only stub +# carrying dummy `overrides.*` values its YAMLs lack, so it is NOT a YAML-mirror layer (see +# `test_all_constructs_native_config_synthesizes`). +ALL_CONSTRUCTS_OVERLAYS = ["hybrid.testing.all-constructs"] def test_deep_merge_preserves_explicit_null(): @@ -195,3 +203,33 @@ def test_dummy_for_testing_layer_jsonnet_mirrors_combined_yaml(): mirror the combined YAMLs like the env layers do. """ _assert_layer_jsonnet_mirrors_combined_yaml(DUMMY_FOR_TESTING_LAYER_DIR) + + +def test_node0_layer_jsonnet_mirrors_combined_yaml(): + """REGRESSION: same invariant for the `testing/node-0` overlay layer. + + `node-0` is a FUNCTIONAL overlay deployed live by `hybrid_system_test.yaml`, so its native + override jsonnet is a full value-parity translation of its YAMLs and must mirror the combined + `config.sequencerConfig` (folded) exactly, like the env layers do. + """ + _assert_layer_jsonnet_mirrors_combined_yaml(NODE0_LAYER_DIR) + + +def test_all_constructs_native_config_synthesizes(): + """REGRESSION: the `testing/all-constructs` overlay synthesizes a native config. + + Unlike the env/dummy layers, `all-constructs` is a STRUCTURE-validation stub: its cdk8s output is + only `kubectl validate`d for manifest structure, never for config content, and its YAML + `config.sequencerConfig` folds to empty. It is therefore NOT a YAML-mirror layer; its native + layer instead supplies the minimum dummy `overrides.*` values `build()` reads unconditionally. The + only invariant we assert is that native synth SUCCEEDS and yields a nested config (the CI + `sequencer_cdk8s-test.yml` job synths this overlay under `--config-format native`). + """ + native_nested = build_native_config( + service_name=CORE_SERVICE, + layout=LAYOUT, + overlays=ALL_CONSTRUCTS_OVERLAYS, + ) + assert isinstance(native_nested, dict) and native_nested + # A nested SequencerNodeConfig (not the flat dotted preset form): top-level component sections. + assert any(isinstance(value, dict) for value in native_nested.values())