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(abigen): Add solc binary fallback for Apple Silicon #3455

Closed

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 12, 2024

Improves solc binary management with better error handling and context propagation.

Link to Devin run: https://app.devin.ai/sessions/73d247fe22324ab89be91a315e5ff41f

- Add architecture detection for Apple Silicon
- Implement solc binary download with checksum verification
- Add caching in ~/.cache/solc/
- Update documentation

Fixes #3366

Co-Authored-By: [email protected] <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Add "(aside)" to your comment to have me ignore it.

Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes in this pull request enhance the abigen tool's documentation and functionality, particularly for users on Apple Silicon Macs. The documentation clarifies usage instructions and expands on the fallback mechanism for compiling Solidity contracts. The code modifications introduce a binary manager for Solidity compiler binaries, improve error handling, and implement a caching system. New functions and tests are added to ensure robust management of the compilation process and to verify the integrity of downloaded binaries.

Changes

File Path Change Summary
tools/abigen/README.md Updated documentation for abigen, clarifying usage instructions, improving compatibility for Apple Silicon, and expanding on error handling related to go.mod package updates. Added details on WASM support.
tools/abigen/internal/generate.go Enhanced Solidity contract compilation functionality, added new compilation strategies, improved error handling, and introduced helper functions for file operations. Renamed optimizerRuns to optimizeRuns.
tools/abigen/internal/solc/binary.go Introduced functionality for managing Solidity compiler binaries, including downloading, caching, and verifying binaries across platforms. Defined structures and methods for binary management.
tools/abigen/internal/solc/binary_test.go Added unit tests for the solc package, validating the functionality of the BinaryManager and related methods, ensuring robust testing of binary management features.

Assessment against linked issues

Objective Addressed Explanation
Implement a fallback mechanism for solc downloads (3366)
Cache downloaded versions to avoid repeated downloads (3366)
Verify checksums for security (3366)
Support version selection similar to Docker implementation (3366) No explicit version selection mechanism was introduced in the changes.

Possibly related PRs

  • platform bump [SLT-452] #3365: Addresses issues related to Docker-based tools on macOS with Apple Silicon, relevant to the updates on compatibility and fallback mechanisms in this PR.

Suggested labels

size/xs

Poem

In the meadow where the code does play,
A rabbit hops, brightening the day.
With binaries cached and checksums tight,
Apple Silicon shines, oh what a sight!
The abigen tool now leaps with grace,
Compiling contracts at a faster pace! 🐇✨


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

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.

@github-actions github-actions bot added go Pull requests that update Go code size/m labels Dec 12, 2024
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Project coverage is 22.00038%. Comparing base (40cd70b) to head (b0f0d41).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
core/commandline/shell.go 0.00000% 7 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (40cd70b) and HEAD (b0f0d41). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (40cd70b) HEAD (b0f0d41)
cctp-relayer 2 1
scribe 2 1
Additional details and impacted files
@@                 Coverage Diff                  @@
##              master       #3455          +/-   ##
====================================================
- Coverage   34.04255%   22.00038%   -12.04217%     
====================================================
  Files            388         502         +114     
  Lines          24581       41922       +17341     
====================================================
+ Hits            8368        9223         +855     
- Misses         15472       31762       +16290     
- Partials         741         937         +196     
Flag Coverage Δ
cctp-relayer 31.97848% <ø> (ø)
core 58.76168% <0.00000%> (-0.01718%) ⬇️
ethergo 47.30531% <ø> (-0.05272%) ⬇️
explorer 4.93656% <ø> (?)
git-changes-action 23.48315% <ø> (ø)
omnirpc 32.65401% <ø> (ø)
opbot 0.18282% <ø> (ø)
promexporter 6.81642% <ø> (ø)
screener-api 29.95090% <ø> (+0.49099%) ⬆️
scribe 18.18182% <ø> (ø)

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.

Copy link

cloudflare-workers-and-pages bot commented Dec 12, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: b0f0d41
Status: ✅  Deploy successful!
Preview URL: https://15e86d99.sanguine-fe.pages.dev
Branch Preview URL: https://devin-1733968581-apple-silic.sanguine-fe.pages.dev

View logs

@trajan0x
Copy link
Contributor

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions bot added size/l and removed size/m labels Dec 12, 2024
Copy link

github-actions bot commented Jan 3, 2025

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jan 3, 2025
@github-actions github-actions bot closed this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant