feat: making l1_batch_commit_data_generator_mode
a non-mandatory attribute (Moved)
#177
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.
Description
This pull request addresses the issue regarding the
l1_batch_commit_data_generator_mode
field in theStateKeeperConfig
struct. The issue stems from the absence of an explicit default value and the lack ofOption
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
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.