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

feat: making l1_batch_commit_data_generator_mode a non-mandatory attribute (Moved) #177

Open
wants to merge 4 commits into
base: feat_validium_pubdata_abstraction
Choose a base branch
from

Conversation

jordibonet-lambdaclass
Copy link

@jordibonet-lambdaclass jordibonet-lambdaclass commented Feb 22, 2024

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.

@jordibonet-lambdaclass jordibonet-lambdaclass marked this pull request as ready for review February 22, 2024 15:25
Copy link
Collaborator

@ilitteri ilitteri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jordibonet-lambdaclass jordibonet-lambdaclass marked this pull request as draft February 22, 2024 15:30
@jordibonet-lambdaclass jordibonet-lambdaclass marked this pull request as ready for review February 22, 2024 15:30
@lferrigno lferrigno changed the title feat: making l1_batch_commit_data_generator_mode a non-mandatory attribute feat: making l1_batch_commit_data_generator_mode a non-mandatory attribute (Moved) Feb 23, 2024
toni-calvin pushed a commit that referenced this pull request Aug 8, 2024
…ry (#177)

Co-authored-by: Vlad Bochok <41153528+vladbochok@users.noreply.github.com>
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.

make l1_batch_commit_data_generator_mode a non-mandatory attribute
3 participants