feat(msc-steps): add SetConfigStep for runtime config mutation - #187
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 likeAUTO_GENERATE_BLOCKSmid-scene, switching between MxOps-driven block production and simulator auto-production.Changes
Implementation
SetConfigStepdataclass inmxops/execution/steps/msc.pywithoptionandvaluefieldsUnknownConfigOptionon typos to prevent silent no-opsUnknownConfigOptioninmxops/errors.pymxops/execution/steps/__init__.py; resolves from YAML via bothSetConfigandSetConfigSteptype namesTesting
tests/test_msc_steps.py:TX_TIMEOUT)AUTO_GENERATE_BLOCKS) withchain_simulator_networkfixtureUnknownConfigOptionSetConfigentry added totests/data/all_steps.yamlto exercise the YAML factory pathDocumentation
docs/source/user_documentation/steps.mdwith 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 likePROXY/PROXY_TIMEOUTcannot be changed after the network provider is instantiateddocs/source/user_documentation/chain_simulator.mdBlock generation sectiondocs/source/dev_documentation/changelog.mdCLAUDE.md(bumped to 32 types); also restored two previously-missing steps (ChainSimulatorSetState,ChainSimulatorSetTokenBalance) to the prose inventoryTesting
test_set_config_step,test_set_config_step_toggles_block_generation,test_set_config_step_unknown_option_raisestest_instantiate_all_steps(viaall_steps.yamlentry)Notes
value: falseare coerced to"False"viaSmartStr; documentation recommends quoting for clarity.option.upper()vs.get_options()) following configparser conventions.should_generate_blocks()forAUTO_GENERATE_BLOCKS) take effect mid-scene; caching of connection-level options (PROXY,PROXY_TIMEOUT) prevents runtime changes to those.mxops executerun reloads the configuration from file.