Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Validium): Make l1_batch_commit_data_generator_mode a non-mandatory attribute #1236

Conversation

ilitteri
Copy link
Member

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:

  1. Using serde with Default Value: The serde attribute has been applied to the L1BatchCommitDataGeneratorMode enum, setting Rollup as the default value. This ensures that if the field is not explicitly provided in the configuration, Rollup will be used by default.

  2. 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 utilize serde(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 and zk lint.
  • Spellcheck has been run via zk spellcheck.
  • Linkcheck has been run via zk linkcheck.

@ilitteri ilitteri merged commit c6e3fe8 into matter-labs:feat_validium_pubdata_abstraction Feb 28, 2024
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants