Skip to content

Comments

feat: add solc to coordinator docker image#1615

Closed
omerfirmak wants to merge 2 commits intodevelopfrom
omerfirmak/solc-coordinator
Closed

feat: add solc to coordinator docker image#1615
omerfirmak wants to merge 2 commits intodevelopfrom
omerfirmak/solc-coordinator

Conversation

@omerfirmak
Copy link
Contributor

@omerfirmak omerfirmak commented Mar 10, 2025

Purpose or design rationale of this PR

Describe your change. Make sure to answer these three questions: What does this PR do? Why does it do it? How does it do it?

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:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

Deployment tag versioning

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

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • New Features

    • Enhanced the backend container environment by including additional utilities for streamlined file retrieval.
    • Now provides a pre-installed Solidity compiler, enabling improved support for smart contract development workflows.
  • Version Update

    • Updated the software version from v4.4.93 to v4.4.94.

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2025

Walkthrough

The coordinator API Dockerfile has been updated to modify the installation and setup process. The changes include installing the wget package, creating the /usr/local/bin directory, downloading the Solidity compiler (solc) from a GitHub release, and setting its executable permissions using chmod. Additionally, the version tag in the common/version/version.go file has been updated from "v4.4.93" to "v4.4.94".

Changes

File Change Summary
build/.../coordinator-api.Dockerfile Updated package installation to include wget; added commands to create /usr/local/bin, download solc, and set executable permissions
common/version/version.go Updated version tag from "v4.4.93" to "v4.4.94"

Suggested reviewers

  • georgehao
  • jonastheis
  • colinlyguo

Poem

I'm a bunny on the run, under code's bright sun,
Hopping through Docker steps, ensuring build's well done.
With wget in my paw and directories in stride,
I fetch solc from GitHub with a joyful bunny glide.
Leaping through the changes, I celebrate in fun!
🐇🎉

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.62.2)

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 bc8c5b1 and 00a2007.

📒 Files selected for processing (1)
  • common/version/version.go (1 hunks)
🔇 Additional comments (1)
common/version/version.go (1)

8-8: Version increment looks good.

The version tag has been appropriately incremented from "v4.4.93" to "v4.4.94". This patch version update aligns with the nature of the change (adding solc to the coordinator Docker image), which is a non-breaking enhancement to the build environment.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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 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.

colinlyguo
colinlyguo previously approved these changes Mar 10, 2025
Copy link

@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)
build/dockerfiles/coordinator-api.Dockerfile (2)

43-43: Enhance Package Installation Command

Including wget in the apt install command is essential for downloading the Solidity compiler. However, the command also installs several additional utilities (e.g., vim, netcat-openbsd, net-tools, curl, jq) which may not be strictly necessary in a production coordinator image. Consider reviewing whether all these packages are required. Also, it would be beneficial to clean up apt caches afterward to reduce the final image size.

 RUN apt update && apt install vim netcat-openbsd net-tools curl jq wget -y
+RUN apt clean && rm -rf /var/lib/apt/lists/*

46-46: Download Solidity Compiler with Version Considerations

Downloading solc from a specific GitHub release ensures a consistent environment. For future maintainability, consider parameterizing the Solidity compiler version via a build argument so that updating becomes simpler without modifying the Dockerfile directly. For example:

- RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.19/solc-static-linux -O /usr/local/bin/solc
+ ARG SOLC_VERSION=v0.8.19
+ RUN wget https://github.com/ethereum/solidity/releases/download/$SOLC_VERSION/solc-static-linux -O /usr/local/bin/solc
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 69a7339 and bc8c5b1.

📒 Files selected for processing (1)
  • build/dockerfiles/coordinator-api.Dockerfile (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: tests
  • GitHub Check: rollup_relayer
  • GitHub Check: gas_oracle
🔇 Additional comments (2)
build/dockerfiles/coordinator-api.Dockerfile (2)

45-45: Ensure Directory Exists for Binary Installation

The addition of RUN mkdir -p /usr/local/bin guarantees that the target directory exists for placing the solc binary. This is a good practice that prevents potential errors during the download step.


47-47: Set Executable Permission for solc

Using chmod +x /usr/local/bin/solc correctly ensures that the downloaded Solidity compiler is executable. This command is appropriate and well-placed.

@omerfirmak omerfirmak added the bump-version Bump the version tag for deployment label Mar 10, 2025
@omerfirmak omerfirmak closed this Mar 10, 2025
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.

3 participants