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

check prior fork consistently #9255

Merged
merged 7 commits into from
Feb 2, 2024

Conversation

zhiqiangxu
Copy link
Contributor

@zhiqiangxu zhiqiangxu commented Jan 30, 2024

I see this check on DeployConfig, if it holds, then the same should hold for fork times inside the rollup config since initially these fork times are generated from DeployConfig.

This check keeps users from manually modifying the fork times inconsistently after initially generated from DeployConfig.

@zhiqiangxu zhiqiangxu requested a review from a team as a code owner January 30, 2024 16:21
@zhiqiangxu zhiqiangxu requested a review from tynes January 30, 2024 16:21
Copy link
Contributor

coderabbitai bot commented Jan 30, 2024

Walkthrough

Walkthrough

The update enhances the validation process in the Config type's Check method by introducing new checks for the CanyonTime and RegolithTime fields within the Rollup configuration. It ensures that both CanyonTime and RegolithTime are present and correctly sequenced in relation to EcotoneTime and CanyonTime, respectively, thereby improving configuration integrity and preventing potential misconfigurations.

Changes

File(s) Change Summary
op-node/node/config.go, op-node/rollup/types.go Updated Check method to include checks for CanyonTime, EcotoneTime, DeltaTime, and RegolithTime in the Rollup configuration, ensuring their presence and correct sequencing.
op-conductor/conductor/service_test.go Added RegolithTime field to Config struct with a reference to the now variable.
op-node/rollup/types_test.go Introduced a new test suite forkTests within the TestConfig_Check function to check for various forking scenarios in the Config struct, validating error conditions and expected behavior.

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.
  • 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 from git 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.

op-node/node/config.go Outdated Show resolved Hide resolved
op-node/node/config.go Outdated Show resolved Hide resolved
op-node/rollup/types.go Outdated Show resolved Hide resolved
op-node/rollup/types.go Outdated Show resolved Hide resolved
Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

Thanks for picking up this ticket. There's a little bit more work to get this merged.

op-node/rollup/types.go Outdated Show resolved Hide resolved
Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

Code LGTM, last thing is to add a test case for these additions. We have scaffolding here:

func TestConfig_Check(t *testing.T) {

@zhiqiangxu
Copy link
Contributor Author

zhiqiangxu commented Feb 1, 2024

Code LGTM, last thing is to add a test case for these additions. We have scaffolding here:

func TestConfig_Check(t *testing.T) {

I added some test cases for forks in another loop since the error returned by checkFork is not a named one.

Copy link
Contributor

@trianglesphere trianglesphere left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for fixing this.

@trianglesphere trianglesphere added this pull request to the merge queue Feb 1, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 1, 2024
* check prior fork

* move inside cfg.Rollup.Check

* reuse checkFork logic

* fix testcase

* move checkFork to top level

* add testcases
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 1, 2024
@tynes
Copy link
Contributor

tynes commented Feb 2, 2024

Looks like this is stuck on shell-check - could this be due to renaming the job?

@ajsutton
Copy link
Contributor

ajsutton commented Feb 2, 2024

It very likely doesn't have the rename in this branch but the job is now required - pull in the latest changes from develop and it should be good to go.

@trianglesphere trianglesphere added this pull request to the merge queue Feb 2, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 2, 2024
@tynes tynes added this pull request to the merge queue Feb 2, 2024
Merged via the queue into ethereum-optimism:develop with commit 0b33f33 Feb 2, 2024
64 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