10000 feat: merge dev into main by seolaoh · Pull Request #426 · kroma-network/kroma · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: merge dev into main #426

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

Merged
merged 5 commits into from
Jan 24, 2025
Merged

feat: merge dev into main #426

merged 5 commits into from
Jan 24, 2025

Conversation

seolaoh
Copy link
Contributor
@seolaoh seolaoh commented Jan 24, 2025

Description

This PR is for v2.1.1 release.

seolaoh and others added 5 commits January 17, 2025 15:29
* chore(hardhat-deploy-config): add Sepolia deploy configs for v2.1.0

* chore(contracts): add v2.1.0 deployments on Sepolia
Prevents KromaMPT block from being handled as unsafe payload over P2P.
This ensures that nodes can continue the migration process, even if they
receive a new unsafe payload from the sequencer before receiving the batch
containing the KromaMPT parent block, allowing them to still process the
safe attribute.
Fix incorrect error message in checkL1BlockAddrAndData function
* chore: add v2.1.1 deployment config on mainnet

* chore: add v2.1.1 deployments on Mainnet
@seolaoh seolaoh self-assigned this Jan 24, 2025
@seolaoh seolaoh requested a review from a team as a code owner January 24, 2025 07:19
Copy link
Contributor
coderabbitai bot commented Jan 24, 2025

Walkthrough

The pull request introduces changes related to the Kroma MPT (Merkle Patricia Tree) upgrade across multiple components of the Kroma blockchain infrastructure. The modifications primarily focus on error handling, configuration updates, and payload processing logic. Key changes include updating error messages, adding new error variables, modifying configuration timestamps, and implementing a new method to check KromaMPT activation blocks. These changes aim to provide more precise handling and reporting of events surrounding the KromaMPT upgrade.

Changes

File Change Summary
kroma-chain-ops/cmd/check-kroma-mpt/main.go Updated error message to clarify MPT-related error context
op-batcher/batcher/channel_builder.go Added new error variables ErrReachedKromaMPTParentBlock and ErrReachedKromaMPTBlock
Removed ErrJustBeforeKromaMPTTime
op-batcher/batcher/channel_manager_test.go Renamed test function
Updated import statements
Modified error assertions
op-node/chaincfg/chains.go Set KromaMPTTime for Mainnet to 1739250001
op-node/chaincfg/chains_test.go Updated mainnetCfg KromaMPTTime to 1739250001
op-node/node/node.go Added conditional check to ignore payloads for KromaMPT activation blocks
op-node/rollup/types.go Added new method IsKromaMPTActivationBlock to Config struct

Sequence Diagram

sequenceDiagram
    participant Node as OpNode
    participant Payload as L2 Payload
    participant MPTCheck as KromaMPT Activation Check

    Node->>MPTCheck: Check payload timestamp
    MPTCheck-->>Node: Is KromaMPT Activation Block?
    alt Is Activation Block
        Node->>Node: Log and Ignore Payload
    else Not Activation Block
        Node->>Payload: Process Payload Normally
    end
Loading

The sequence diagram illustrates the new payload processing logic added to the OpNode, specifically the check for KromaMPT activation blocks before payload processing.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

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>, please review it.
    • Generate unit testing code 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 testing code 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
nx-cloud bot commented Jan 24, 2025

View your CI Pipeline Execution ↗ for commit c41ac14.

Command Status Duration Result
nx run-many --target=test ✅ Succeeded <1s View ↗
nx run-many --target=build ✅ Succeeded 2s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-24 07:36:41 UTC

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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
op-batcher/batcher/channel_builder.go (1)

24-25: Consider using typed errors for maintainability.
Defining these new error variables is a step forward in clarity. However, you might consider creating custom typed errors (e.g., type KromaMPTError struct { ... }) in the future for even more structured error handling and to incorporate additional contextual data.

op-batcher/batcher/channel_manager_test.go (1)

538-538: Assert the correct ActivationBlock error.
ErrReachedKromaMPTBlock clarifies that the code handles the exact Kroma MPT block. Double-check that the error logic won’t overlap or conflict with earlier blocks that cross the threshold.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 202e98b and c41ac14.

⛔ Files ignored due to path filters (16)
  • go.mod is excluded by !**/*.mod
  • go.sum is excluded by !**/*.sum, !**/*.sum
  • ops-devnet/docker-compose.yml is excluded by !**/*.yml
  • packages/contracts/deploy-config/mainnet.json is excluded by !**/*.json
  • packages/contracts/deploy-config/sepolia.json is excluded by !**/*.json
  • packages/contracts/deployments/mainnet/Colosseum.json is excluded by !**/*.json
  • packages/contracts/deployments/mainnet/KromaPortal.json is excluded by !**/*.json
  • packages/contracts/deployments/mainnet/ValidatorManager.json is excluded by !**/*.json
  • packages/contracts/deployments/mainnet/ZKProofVerifier.json is excluded by !**/*.json
  • packages/contracts/deployments/mainnet/ZKProofVerifierProxy.json is excluded by !**/*.json
  • packages/contracts/deployments/sepolia/Colosseum.json is excluded by !**/*.json
  • packages/contracts/deployments/sepolia/KromaPortal.json is excluded by !**/*.json
  • packages/contracts/deployments/sepolia/ValidatorManager.json is excluded by !**/*.json
  • packages/contracts/deployments/sepolia/ZKProofVerifier.json is excluded by !**/*.json
  • packages/contracts/deployments/sepolia/ZKProofVerifierProxy.json is excluded by !**/*.json
  • packages/contracts/deployments/sepolia/solcInputs/9e0b1e1e73ac46b8a3d915d840fa123d.json is excluded by !**/*.json
📒 Files selected for processing (7)
  • kroma-chain-ops/cmd/check-kroma-mpt/main.go (1 hunks)
  • op-batcher/batcher/channel_builder.go (2 hunks)
  • op-batcher/batcher/channel_manager_test.go (3 hunks)
  • op-node/chaincfg/chains.go (1 hunks)
  • op-node/chaincfg/chains_test.go (1 hunks)
  • op-node/node/node.go (1 hunks)
  • op-node/rollup/types.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • kroma-chain-ops/cmd/check-kroma-mpt/main.go
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Run tests
🔇 Additional comments (9)
op-node/chaincfg/chains.go (1)

45-45: Confirm KromaMPTTime correctness.
Assigning KromaMPTTime to 1739250001 looks fine, but please ensure that this timestamp aligns with your intended activation schedule. Any off-by-one or environment-specific discrepancy could cause unexpected behaviors around upgrade time.

Would you like me to generate a shell script to scan for all references to KromaMPTTime across the codebase to confirm usage?

op-node/chaincfg/chains_test.go (1)

72-72: Maintain consistency in tests.
Good job keeping KromaMPTTime consistent between the production config and test config. Just verify that your tests are indeed covering the logic exposed by this timestamp (e.g., boundary cases around 1739250001).

op-batcher/batcher/channel_builder.go (1)

184-187: Validate block time checks.
Using IsKromaMPTParentBlock and IsKromaMPTActivationBlock provides more precise error reporting. Be sure these checks handle edge cases (e.g., clock skew or bridging logic). Potential off-by-one issues around the activation boundary can lead to unexpected channel closures.

op-batcher/batcher/channel_manager_test.go (4)

10-14: Reorganized imports.
The updated imports seem correct for the newly introduced logic and error checks. Just confirm that no references to removed packages remain.


489-489: Clearer test naming.
Renaming TestChannelManager_Close_BeforeMPTBlock to TestChannelManager_CheckFullErrorsOnKromaMPT appropriately clarifies the scope of the test. Nice improvement for readability.


528-528: Check coverage for 3rd block addition.
Adding the 3rd L2 block (mptBlock) is critical for verifying edge conditions. Ensure that your test includes boundary checks around the Kroma MPT activation (e.g. just before and exactly at the activation time).


533-533: Assert the correct ParentBlock error.
ErrReachedKromaMPTParentBlock ensures granular distinction for the block just before the Kroma MPT activation. This improves error clarity, but ensure that IsKromaMPTParentBlock indeed triggers only at the correct boundary.

op-node/rollup/types.go (1)

374-380: Ensure edge-case coverage for activation logic.
This method follows the same pattern as IsEcotoneActivationBlock and appears logically sound for skipping Genesis. It properly checks l2BlockTime >= c.BlockTime to avoid incorrectly evaluating negative wrap-around under uint64. However, please ensure the test suite covers edge cases where l2BlockTime < c.BlockTime and KromaMPTTime is zero or absent, so we don’t inadvertently treat an all-genesis scenario as activation.

op-node/node/node.go (1)

597-603: Confirm the correctness of ignoring KromaMPT activation blocks.
The approach to ignore payloads at KromaMPT activation blocks (logging and returning early) is consistent with the intention to skip special-processing blocks. This prevents potential double-processing or inconsistent state transitions. Ensure that you have test coverage verifying that the node handles activation-block payloads in the intended manner (ignoring them) and transitions cleanly afterward.

@seolaoh seolaoh merged commit 8674390 into main Jan 24, 2025
8 checks passed
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
0