Skip to content

feat(msc-steps): add SetConfigStep for runtime config mutation - #187

Merged
EtienneWallet merged 6 commits into
developfrom
feat/set_config_option
Jun 4, 2026
Merged

feat(msc-steps): add SetConfigStep for runtime config mutation#187
EtienneWallet merged 6 commits into
developfrom
feat/set_config_option

Conversation

@EtienneWallet

Copy link
Copy Markdown
Contributor

Summary

Adds SetConfigStep, a new step that allows users to change configuration options at runtime for the current network. This enables dynamic control of options like AUTO_GENERATE_BLOCKS mid-scene, switching between MxOps-driven block production and simulator auto-production.

Changes

Implementation

  • New SetConfigStep dataclass in mxops/execution/steps/msc.py with option and value fields
  • Validates option names against the current network's known options, raising UnknownConfigOption on typos to prevent silent no-ops
  • New exception UnknownConfigOption in mxops/errors.py
  • Exported in mxops/execution/steps/__init__.py; resolves from YAML via both SetConfig and SetConfigStep type names

Testing

  • Three new unit tests in tests/test_msc_steps.py:
    • Basic config mutation (TX_TIMEOUT)
    • Block generation toggle (AUTO_GENERATE_BLOCKS) with chain_simulator_network fixture
    • Validation that unknown option names raise UnknownConfigOption
  • SetConfig entry added to tests/data/all_steps.yaml to exercise the YAML factory path

Documentation

  • New "Set Config Step" section in docs/source/user_documentation/steps.md with example toggle, notes on scope (current network only, process-only), string coercion caveat, and warning that only fresh-read options (e.g., AUTO_GENERATE_BLOCKS) take effect mid-scene—cached options like PROXY/PROXY_TIMEOUT cannot be changed after the network provider is instantiated
  • Cross-reference added to docs/source/user_documentation/chain_simulator.md Block generation section
  • Changelog entry in docs/source/dev_documentation/changelog.md
  • Step counts and All Step Types list updated in CLAUDE.md (bumped to 32 types); also restored two previously-missing steps (ChainSimulatorSetState, ChainSimulatorSetTokenBalance) to the prose inventory

Testing

  • Unit tests: test_set_config_step, test_set_config_step_toggles_block_generation, test_set_config_step_unknown_option_raises
  • Factory instantiation test: test_instantiate_all_steps (via all_steps.yaml entry)
  • Full suite: 309 tests pass
  • Code quality: bandit, flake8 (max-line-length=88), ruff, pylint ≥ 9.5 all pass

Notes

  • Values are strings (configparser stores strings). YAML scalars like value: false are coerced to "False" via SmartStr; documentation recommends quoting for clarity.
  • Option validation is case-insensitive (option.upper() vs. get_options()) following configparser conventions.
  • Only options re-read on every use (e.g., should_generate_blocks() for AUTO_GENERATE_BLOCKS) take effect mid-scene; caching of connection-level options (PROXY, PROXY_TIMEOUT) prevents runtime changes to those.
  • Changes are process-only; each mxops execute run reloads the configuration from file.

EtienneWallet and others added 6 commits June 4, 2026 20:48
Allows users to change config options at runtime for the current network, with validation to catch typos. Introduces UnknownConfigOption exception for invalid option names.
Add three tests: basic config setting (TX_TIMEOUT), toggle block generation (AUTO_GENERATE_BLOCKS), and validation of unknown options. Include SetConfig entry in all_steps.yaml factory test.
Add 'Set Config Step' section to steps.md with toggle example, notes on current-network/process-only scope, string coercion, and warning that only fresh-read options (not cached ones like PROXY/PROXY_TIMEOUT) take effect mid-scene. Cross-reference SetConfig from chain_simulator.md Block generation section.
Add SetConfigStep to Unreleased changelog. Bump step counts from 28/29 to 32 in CLAUDE.md directory table and All Step Types section. Add SetConfig to Control group. Include two previously-missing setup steps (ChainSimulatorSetState, ChainSimulatorSetTokenBalance) in the prose list to match actual step inventory.
@EtienneWallet
EtienneWallet merged commit 39db0d9 into develop Jun 4, 2026
@EtienneWallet
EtienneWallet deleted the feat/set_config_option branch June 4, 2026 18:53
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.

1 participant