Skip to content

fix(coordinator): support darwin chunk provers #1640

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
Apr 9, 2025

Conversation

colinlyguo
Copy link
Member

@colinlyguo colinlyguo commented Apr 9, 2025

Purpose or design rationale of this PR

PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • fix: A bug fix

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change

Summary by CodeRabbit

  • Chores
    • Updated the application version to v4.5.1.
  • New Features
    • Enhanced compatibility for legacy prover configurations by introducing dedicated handling for a specific operational mode.
    • Improved task processing to ensure certain operations are executed correctly under supported conditions.

@colinlyguo colinlyguo added the bump-version Bump the version tag for deployment label Apr 9, 2025
@colinlyguo colinlyguo requested review from georgehao and yiweichi April 9, 2025 10:34
Copy link

coderabbitai bot commented Apr 9, 2025

Walkthrough

This pull request updates the version tag in the common version file and introduces new conditional checks in two coordinator logic files. The version update in common/version/version.go changes the tag from "v4.5.0" to "v4.5.1". In the login logic, a new branch specifically returns "darwin" for prover version "v4.4.56". Similarly, in the prover task logic, an early return is introduced (for darwin chunk prover conditions) when the version is "v4.4.56". No changes were made to public entity declarations.

Changes

File(s) Change Summary
common/version/version.go Updated the version tag from "v4.5.0" to "v4.5.1".
coordinator/internal/logic/(auth/login.go, provertask/prover_task.go) Added new conditional checks for prover version "v4.4.56": in login.go, returns "darwin" in ProverHardForkName; in prover_task.go, allows an early return for tasks with "darwinV2".

Sequence Diagram(s)

sequenceDiagram
    participant LoginClient as Login Client
    participant LoginLogic as Login Logic
    LoginClient->>LoginLogic: Request hard fork name (prover version "v4.4.56")
    alt Version is "v4.4.56"
      LoginLogic-->>LoginClient: Return "darwin"
    else Other version flow
      LoginLogic-->>LoginClient: Retrieve fork name via map lookup
    end
Loading
sequenceDiagram
    participant TaskClient as Task Dispatcher
    participant TaskHandler as Prover Task Handler
    TaskClient->>TaskHandler: Process task (ProofTypeChunk, "darwinV2", version "v4.4.56")
    alt Conditions met (ProofTypeChunk and "darwinV2")
      TaskHandler-->>TaskClient: Return hardForkName early
    else Default validation
      TaskHandler-->>TaskClient: Validate hardForkName via map
    end
Loading

Possibly related PRs

Suggested reviewers

  • georgehao
  • jonastheis
  • omerfirmak
  • yiweichi

Poem

I'm a little rabbit, hopping through the code,
Version bumped to shine, lightening my ode.
A special check leaps in with a joyful bound,
Logic flows refined, a tougher bug to hound.
With twitching nose and ASCII cheer,
I celebrate the fix with a happy ear!
🐇🌟

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (1.64.8)

level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildir: failed to load package zstd: could not load export data: no export data for "github.com/scroll-tech/da-codec/encoding/zstd""
level=error msg="Running error: can't run linter goanalysis_metalinter\nbuildir: failed to load package zstd: could not load export data: no export data for "github.com/scroll-tech/da-codec/encoding/zstd""


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0578aab and 2e7827e.

📒 Files selected for processing (3)
  • common/version/version.go (1 hunks)
  • coordinator/internal/logic/auth/login.go (1 hunks)
  • coordinator/internal/logic/provertask/prover_task.go (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
coordinator/internal/logic/provertask/prover_task.go (2)
common/types/message/message.go (1)
  • ProofTypeChunk (41-41)
coordinator/internal/types/auth.go (1)
  • ProverVersion (20-20)
🔇 Additional comments (3)
common/version/version.go (1)

8-8: Version bump verified for implementing Darwin chunk prover support.

The version tag has been correctly updated from v4.5.0 to v4.5.1 to reflect the introduction of Darwin chunk prover support, following semantic versioning principles.

coordinator/internal/logic/auth/login.go (1)

142-146: Special case handling for Darwin provers.

This special case allows Darwin provers with version "v4.4.56" to be recognized even when the system is using the newer DarwinV2 hard fork. This ensures backward compatibility so that existing Darwin provers can continue to function with the coordinator.

coordinator/internal/logic/provertask/prover_task.go (1)

124-127:

✅ Verification successful

Special case to support backward compatibility with Darwin provers.

This change complements the login.go modification by allowing Darwin chunk provers (v4.4.56) to process DarwinV2 chunk tasks. This maintains backward compatibility for users with Darwin provers.

Let's verify that this is the correct implementation by checking the expected workflow:


🏁 Script executed:

#!/bin/bash
# Verify the flow of Darwin provers handling DarwinV2 tasks

# Check if there are any tests or other code that relies on this behavior
rg -A 5 -B 5 "darwinV2" --type go

# Check for any other places where v4.4.56 version is referenced
rg -A 3 -B 3 "v4.4.56" --type go

Length of output: 10729


Backward Compatibility for Darwin Chunk Provers Verified

The special-case handling in coordinator/internal/logic/provertask/prover_task.go for vintage Darwin provers (v4.4.56) to support DarwinV2 chunk tasks has been confirmed. The tests across the codebase—in files such as login.go, orm_test.go, and verifier_test.go—demonstrate that legacy Darwin provers are correctly routed for DarwinV2 workloads, and the existing behavior matches the intended backward compatibility.

No further changes are required.

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 41.42%. Comparing base (0578aab) to head (2e7827e).

Files with missing lines Patch % Lines
coordinator/internal/logic/auth/login.go 40.00% 2 Missing and 1 partial ⚠️
...ordinator/internal/logic/provertask/prover_task.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1640   +/-   ##
========================================
  Coverage    41.41%   41.42%           
========================================
  Files          222      222           
  Lines        18311    18319    +8     
========================================
+ Hits          7584     7589    +5     
- Misses        9985     9987    +2     
- Partials       742      743    +1     
Flag Coverage Δ
coordinator 34.41% <25.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@yiweichi yiweichi left a comment

Choose a reason for hiding this comment

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

LGTM

@colinlyguo colinlyguo merged commit a34c01d into develop Apr 9, 2025
6 checks passed
@colinlyguo colinlyguo deleted the fix/coordinator-support-darwin-chunk-provers branch April 9, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-version Bump the version tag for deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants