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: add Kroma Burgundy upgrade time #268

Closed
wants to merge 1 commit into from
Closed

Conversation

Pangssu
Copy link
Contributor

@Pangssu Pangssu commented Mar 11, 2024

The Kroma Burgundy upgrade activates the governance token.
This PR includes the implementation of configurations for the Burgundy upgrade.

Summary by CodeRabbit

  • New Features

    • Introduced predeploy configuration management for Ethereum smart contracts.
    • Added a new L2GenesisBurgundyTimeOffset field to control the activation time of the Kroma Burgundy hard fork.
    • Implemented methods to calculate and set the Kroma Burgundy hard fork activation time.
    • Enhanced network upgrade functionality with the Kroma Burgundy update, including new configuration fields and methods.
  • Refactor

    • Updated file permissions for enhanced security in writing JWT secret.
  • Chores

    • Adjusted setup configurations to handle new Burgundy time offset.

@Pangssu Pangssu requested a review from a team as a code owner March 11, 2024 05:57
Copy link
Contributor

coderabbitai bot commented Mar 11, 2024

Walkthrough

These updates introduce new functionalities and configurations for Ethereum smart contracts, specifically focusing on the Kroma Burgundy network upgrade. A new file adds predeploy configurations for smart contracts, while other changes incorporate the Kroma Burgundy time offset and activation into the system. This includes adjustments to genesis configurations, the setup process for end-to-end tests, and rollup type configurations, ensuring seamless integration and activation of the Kroma Burgundy hard fork.

Changes

File(s) Summary
kroma-bindings/predeploys/predeploy.go Introduces predeploy configurations for Ethereum smart contracts, including governance and address-specific settings.
kroma-chain-ops/genesis/config.go, .../genesis/genesis.go, op-e2e/e2eutils/setup.go Adds L2GenesisBurgundyTimeOffset and BurgundyTime to manage the Kroma Burgundy hard fork activation timing.
op-node/rollup/types.go Updates rollup configurations with BurgundyTime and methods for the Kroma Burgundy network upgrade.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@Pangssu Pangssu requested review from a team and removed request for a team March 11, 2024 05:58
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 646eb95 and 7762631.
Files ignored due to path filters (3)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
  • ops-devnet/docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (5)
  • kroma-bindings/predeploys/predeploy.go (1 hunks)
  • kroma-chain-ops/genesis/config.go (3 hunks)
  • kroma-chain-ops/genesis/genesis.go (1 hunks)
  • op-e2e/e2eutils/setup.go (4 hunks)
  • op-node/rollup/types.go (4 hunks)
Additional comments: 10
kroma-bindings/predeploys/predeploy.go (2)
  • 7-11: The DeployConfig interface defines methods for governance and timing configurations. It's crucial to ensure that these methods are implemented correctly in all concrete types that satisfy this interface. The inclusion of CanyonTime and BurgundyTime methods indicates support for specific network upgrades, which is a good practice for future-proofing the codebase.
  • 13-17: The Predeploy struct is well-defined, encapsulating the necessary information for a predeployed contract, including its address, a flag for proxy disablement, and a function to determine its enabled state based on the deployment configuration. This struct is a good example of encapsulating contract-related data in a clear and maintainable manner.
kroma-chain-ops/genesis/genesis.go (1)
  • 67-67: The addition of BurgundyTime to the kromaChainConfig within the NewL2Genesis function is a critical update for the Burgundy upgrade. It ensures that the activation time of the Burgundy hard fork is correctly set based on the block time and the specified offset. This change is essential for the smooth transition and activation process of the upgrade.
op-e2e/e2eutils/setup.go (2)
  • 27-27: Changing the file permission to 0o600 for writing the JWT secret enhances security by ensuring that the file is only accessible to the user who created it. This is a good practice for handling sensitive information.
  • 216-222: The addition of the BurgundyTimeOffset function is a thoughtful update to manage the time offset for the Burgundy upgrade during setup. This ensures that the testing environments can accurately simulate the timing requirements of the upgrade, which is crucial for thorough and effective testing.
op-node/rollup/types.go (3)
  • 112-114: The addition of the BurgundyTime field to the Config struct is a key update for supporting the Kroma Burgundy network upgrade. This field allows for the activation time of the upgrade to be set and checked against the block timestamp, which is essential for conditional activation of new features or changes.
  • 317-320: The IsBurgundy method provides a straightforward way to check if the Burgundy hardfork is active based on the current timestamp. This method is crucial for conditional logic that depends on whether the Burgundy upgrade has been activated. It's implemented correctly and follows the pattern established by other upgrade checks.
  • 357-358: Updating the description output to include the Burgundy network upgrade is a valuable addition for logging and debugging purposes. It ensures that the configuration related to the Burgundy upgrade is visible and easily accessible, which can be helpful for operators and developers.
kroma-chain-ops/genesis/config.go (2)
  • 257-259: The addition of the L2GenesisBurgundyTimeOffset field to the DeployConfig struct is correctly implemented. It follows the existing pattern for time offset fields related to other hard forks, allowing for the control of the activation time of the Kroma Burgundy hard fork through an offset. This change is consistent with the PR objectives and aligns with the existing code structure.
  • 600-609: The implementation of the BurgundyTime method is correct and follows the pattern established by similar methods for calculating the activation time of hard forks based on the genesis time and a specified offset. The method correctly handles the case where the L2GenesisBurgundyTimeOffset is nil, indicating that the Burgundy hard fork is disabled, by returning nil. This ensures that the method's behavior is consistent with the expectations for hard fork activation time calculations.

@kangsorang
Copy link
Contributor

While not currently used, it would be nice to have the flag code in the Op-e2e descendant for consistency. (setup.go)

Copy link
Contributor

@sm-stack sm-stack left a comment

Choose a reason for hiding this comment

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

LGTM

@Pangssu Pangssu force-pushed the feat/add-kroma-burgundy branch from 7762631 to ec57fdd Compare March 15, 2024 06:41
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 646eb95 and ec57fdd.
Files ignored due to path filters (3)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
  • ops-devnet/docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (6)
  • kroma-bindings/predeploys/predeploy.go (1 hunks)
  • kroma-chain-ops/genesis/config.go (3 hunks)
  • kroma-chain-ops/genesis/genesis.go (1 hunks)
  • op-e2e/e2eutils/setup.go (3 hunks)
  • op-e2e/setup.go (2 hunks)
  • op-node/rollup/types.go (4 hunks)
Files skipped from review as they are similar to previous changes (5)
  • kroma-bindings/predeploys/predeploy.go
  • kroma-chain-ops/genesis/config.go
  • kroma-chain-ops/genesis/genesis.go
  • op-e2e/e2eutils/setup.go
  • op-node/rollup/types.go
Additional comments: 4
op-e2e/setup.go (4)
  • 73-73: The removal of var ( and ) around the testingJWTSecret declaration simplifies the variable declaration. This change is straightforward and improves readability.
  • 486-486: The addition of the BurgundyTime field initialization in the Start function is crucial for the Kroma Burgundy upgrade. Ensure that the DeployConfig.BurgundyTime method correctly calculates the Burgundy hard fork activation time based on the provided timestamp.
Verification successful

The DeployConfig.BurgundyTime method correctly calculates the Burgundy hard fork activation time based on the provided genesisTime and an offset (L2GenesisBurgundyTimeOffset). It returns nil if no offset is set, indicating no specific Burgundy time, and otherwise calculates the activation time by adding the offset to the genesisTime. This aligns with the requirements for the Kroma Burgundy upgrade.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify the DeployConfig.BurgundyTime method's correctness.
# This script is a placeholder for the verification process and should be replaced with actual verification steps.
echo "Verify DeployConfig.BurgundyTime method's correctness."

Length of output: 121



Script:

#!/bin/bash
# Search for the DeployConfig.BurgundyTime method within the codebase to verify its implementation.
rg "func \(.*DeployConfig.*\) BurgundyTime" -A 10

Length of output: 677

* 70-76: > 📝 **NOTE** > This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]

Ensure the package declaration and imports are correctly organized and that there are no unused imports. This helps maintain code cleanliness and readability.

Consider running a linter or formatter to automatically organize imports and remove unused ones.

  • 486-486: Adding the BurgundyTime field to the rollup configuration is essential for the upgrade. However, ensure that all dependent configurations and systems are also updated to recognize and use this new field appropriately.
Verification successful

The verification process has revealed that the BurgundyTime field has been integrated across various parts of the codebase, including rollup configuration-related files, types definitions, and genesis configurations. This indicates that dependent configurations and systems have been updated to recognize and use the new field appropriately. Based on this evidence, the review comment is verified as the necessary updates appear to have been made.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that all configurations and systems that depend on the rollup configuration are updated to use BurgundyTime.
echo "Check for dependencies on the rollup configuration that need to be updated to use BurgundyTime."

Length of output: 200



Script:

#!/bin/bash
# Search for references to the rollup configuration and specifically the usage of the BurgundyTime field across the codebase.
echo "Searching for references to the rollup configuration..."
rg "rollup configuration" --context 5
echo "Searching for usage of the BurgundyTime field..."
rg "BurgundyTime" --context 5

Length of output: 14116

op-e2e/setup.go Show resolved Hide resolved
Copy link
Contributor

@kangsorang kangsorang left a comment

Choose a reason for hiding this comment

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

LGTM

@Pangssu Pangssu self-assigned this Mar 18, 2024
@@ -64,6 +64,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
// [Kroma: START]
// kroma-geth is not yet ready. it should be upstream to v1.101304.2
// InteropTime: config.InteropTime(block.Time()),
BurgundyTime: config.BurgundyTime(block.Time()),
//
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//

ops-devnet/docker-compose.yml Show resolved Hide resolved
go.mod Show resolved Hide resolved
Copy link
Contributor

@0xHansLee 0xHansLee left a comment

Choose a reason for hiding this comment

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

2 things I wanna say:

  1. Do we need override flag for Burgundy? If so, it should be added to op-node/flags/flags.go.
  2. Why don't we add BurgundyTime to rollup config for both mainnet and sepolia as nil in op-node/chaincfg/chains.go?

op-e2e/e2eutils/setup.go Show resolved Hide resolved
@Pangssu Pangssu force-pushed the feat/add-kroma-burgundy branch from ec57fdd to 2e1afdb Compare March 20, 2024 05:15
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between b5621b2 and 2e1afdb.
Files ignored due to path filters (3)
  • go.mod is excluded by: !**/*.mod
  • go.sum is excluded by: !**/*.sum
  • ops-devnet/docker-compose.yml is excluded by: !**/*.yml
Files selected for processing (6)
  • kroma-bindings/predeploys/predeploy.go (1 hunks)
  • kroma-chain-ops/genesis/config.go (3 hunks)
  • kroma-chain-ops/genesis/genesis.go (1 hunks)
  • op-e2e/e2eutils/setup.go (3 hunks)
  • op-e2e/setup.go (2 hunks)
  • op-node/rollup/types.go (4 hunks)
Files skipped from review as they are similar to previous changes (6)
  • kroma-bindings/predeploys/predeploy.go
  • kroma-chain-ops/genesis/config.go
  • kroma-chain-ops/genesis/genesis.go
  • op-e2e/e2eutils/setup.go
  • op-e2e/setup.go
  • op-node/rollup/types.go

@Pangssu Pangssu marked this pull request as draft March 20, 2024 09:14
@Pangssu
Copy link
Contributor Author

Pangssu commented Mar 20, 2024

Closing this PR because our team have made an internal decision to not create MintTokenTx, and the network upgrade is no longer needed.

@Pangssu Pangssu closed this Mar 20, 2024
@Pangssu Pangssu deleted the feat/add-kroma-burgundy branch March 21, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants