zksync-era
zksync-era copied to clipboard
fix(Validium): Make `l1_batch_commit_data_generator_mode` a non-mandatory attribute
Description
This pull request addresses the issue regarding the l1_batch_commit_data_generator_mode
field in the StateKeeperConfig
struct. The issue stems from the absence of an explicit default value and the lack of Option
marking, potentially causing the node to enter a crash loop if deployed to an existing environment without prior configuration updates.
Resolves #168.
Proposed Solution
To resolve this issue, the following changes have been implemented:
-
Using
serde
with Default Value: Theserde
attribute has been applied to theL1BatchCommitDataGeneratorMode
enum, settingRollup
as the default value. This ensures that if the field is not explicitly provided in the configuration,Rollup
will be used by default. -
Backward Compatibility: The solution is designed to be backward-compatible, ensuring a smooth transition for existing environments. This is achieved by providing a default value and utilizing
serde
for serialization and deserialization.
Changes Made
- Updated the
StateKeeperConfig
struct to utilizeserde(default)
with the default value attribute.
Testing
zk test rust --package zksync_env_config --lib -j 1 -- chain::tests::default_state_keeper_mode
Impact
This PR aims to resolve the issue while maintaining backward compatibility. It ensures that the l1_batch_commit_data_generator_mode
field is properly handled, preventing potential crash loops in existing environments.
Checklist
- [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via
zk fmt
andzk lint
. - [ ] Spellcheck has been run via
zk spellcheck
. - [ ] Linkcheck has been run via
zk linkcheck
.