Skip to content

Conversation

randy-cro
Copy link
Contributor

@randy-cro randy-cro commented Aug 15, 2025

main changes in:

  1. go-ethereum: chore: remove active precompiles from vm context go-ethereum#21
  2. ethermint: chore: remove active precompiles from vm context ethermint#691

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • Documentation
    • Changelog updated to document a state-machine breaking change: removal of active precompiles from the execution context; review upgrade guidance and contract assumptions.
  • Chores
    • Multiple dependency versions and dependency mapping/hashes updated for improved security, stability, and compatibility.

@randy-cro randy-cro requested a review from a team as a code owner August 15, 2025 04:07
@randy-cro randy-cro requested review from XinyuCRO and calvinaco and removed request for a team August 15, 2025 04:07
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Walkthrough

Adds an UNRELEASED changelog entry documenting removal of active precompiles from VMContext and updates Go dependency versions and gomod2nix hashes, including replaced forks for go-ethereum and ethermint.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added UNRELEASED > State Machine Breaking entry: “Remove active precompiles from VMContext” (references PR 1845).
Go module
go.mod
Bumped direct requires: golang.org/x/crypto v0.40.0 → v0.41.0, google.golang.org/protobuf v1.36.6 → v1.36.7; bumped indirect modules (x/net, x/sys, x/term, x/text); updated replace directives pointing go-ethereum and ethermint to crypto-org-chain fork pseudo-versions.
Nix / mapping
gomod2nix.toml
Updated versions and sha256 hashes to match go.mod bumps and updated replace revisions for go-ethereum and ethermint; no other config changes.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant VMContext_before as VMContext (before)
    participant VMContext_after as VMContext (after)
    participant Precompile

    Caller->>VMContext_before: Invoke call that may use precompile
    VMContext_before->>Precompile: Check/activate precompile
    Precompile-->>Caller: Return result

    Caller->>VMContext_after: Invoke same call
    VMContext_after-->>Caller: Handle call without active precompile check
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • thomas-nguy
  • mmsqe

Poem

I hop through changelogs in the night,
Precompiles tucked away from sight.
Versions climb and hashes sing,
A nimble rabbit changes a string. 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/remove-active-precompiles-from-vm-context

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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
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)
CHANGELOG.md (2)

8-8: Fix PR number label to match the linked PR (typo).

The square-bracket label shows [#1731] but links to PR 1845. Align the label with the link.

-* [#1731](https://github.com/crypto-org-chain/cronos/pull/1845) Remove active precompiles from VMContext
+* [#1845](https://github.com/crypto-org-chain/cronos/pull/1845) Remove active precompiles from VMContext

5-9: Consider adding minimal migration notes for this state-machine breaking change.

A one-liner on impact (e.g., behavior change around precompile activation, any param migrations, or upgrade handler expectations) will help operators plan upgrades.

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9dfd15c and 246acf3.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • go.mod (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (18)
  • GitHub Check: Run golangci-lint
  • GitHub Check: gomod2nix
  • GitHub Check: unittest
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (4)
go.mod (4)

42-42: LGTM: x/crypto patch bump.

Safe, non-breaking update.


45-45: LGTM: protobuf patch bump.

No concerns.


266-272: LGTM: indirect dependency patch bumps.

x/net, x/sys, x/term, x/text are all minor patch bumps; low risk.


308-308: Confirmed: commit 567b9faf5406 includes the VMContext / precompiles change

Commit 567b9faf54067bd07b5ff13d01a0cd25ac5e8fcc (message: "refactor: remove unnecessary activeCompiles field in VMContext") updates VMContext and precompiles usage — e.g. it replaces:
precompiles := vm.DefaultActivePrecompiles(rules)
with:
precompiles := vm.ActivePrecompiles(cfg.Rules(big.NewInt(height), cfg.MergeNetsplitBlock != nil, timestamp))

Changed files of interest:

  • go.mod, go.sum
  • x/evm/keeper/keeper.go
  • x/evm/keeper/state_transition.go
  • x/evm/keeper/state_transition_test.go
  • x/evm/types/tracer.go

No further action required on the replace entry.

Copy link

socket-security bot commented Aug 15, 2025

@thomas-nguy
Copy link
Collaborator

thomas-nguy commented Aug 15, 2025

Since you are updating the dependencies (go.mod), you also need to update the nix files with gomod2nix command

nix develop -c gomod2nix or install https://github.com/nix-community/gomod2nix/tree/master

The integration tests are using the file to setup the environment

@thomas-nguy thomas-nguy changed the title refactor: remove active-precompiles-from-vm-context chore: remove active-precompiles-from-vm-context Aug 15, 2025
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: 1

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a402af9 and ac0fcd0.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod (3 hunks)
  • gomod2nix.toml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: build (macos-14)
  • GitHub Check: gomod2nix
  • GitHub Check: build (macos-latest)
  • GitHub Check: unittest
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: Run golangci-lint
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
gomod2nix.toml (1)

755-756: Dependency bumps in x/ and protobuf — versions in gomod2nix.toml match go.mod; please regenerate gomod2nix to confirm sha256s*

Quick verification (from the provided script) — all toml entries present and either match go.mod or are indirect:

  • golang.org/x/crypto — v0.41.0 — OK
  • golang.org/x/net — v0.43.0 — OK (not found in go.mod; likely indirect)
  • golang.org/x/sys — v0.35.0 — OK (not found in go.mod; likely indirect)
  • golang.org/x/term — v0.34.0 — OK (not found in go.mod; likely indirect)
  • golang.org/x/text — v0.28.0 — OK (not found in go.mod; likely indirect)
  • google.golang.org/protobuf — v1.36.7 — OK

Next step (required): please rerun gomod2nix and confirm there are no nix diffs:

  • Run: nix develop -c gomod2nix
  • If it produces diffs, regenerate gomod2nix.toml and commit the updated file so the sha256 values are correct.

Locations to check:

  • gomod2nix.toml — lines: 755-756, 761-762, 770-771, 773-774, 776-777, 797-798

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 (1)
gomod2nix.toml (1)

755-777: x/crypto, x/net, x/sys, x/term, x/text bumps mirror go.mod

All versions and hashes reflect the go.mod updates. Consider adding a lightweight CI check to prevent future drift.

If desired, I can provide a small script/CI job to fail the build when gomod2nix.toml is not consistent with go.mod for selected modules.

📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5cb7147 and 2f4cff8.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod (3 hunks)
  • gomod2nix.toml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: build (macos-latest)
  • GitHub Check: gomod2nix
  • GitHub Check: unittest
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: Run golangci-lint
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (7)
go.mod (4)

42-42: Bump x/crypto to v0.41.0 looks good and matches gomod2nix

Dependency upgrade is reasonable and is mirrored in gomod2nix.toml.


45-45: protobuf v1.36.7 bump approved

Upgrade aligns with gomod2nix and typical gRPC ecosystem compatibility.


266-271: x/net, x/sys, x/term, x/text indirect bumps are consistent

All four indirect x/* updates are reflected in gomod2nix.toml with matching versions and new hashes.


306-309: Replacements verified: go.mod/gomod2nix consistent and commit SHAs exist in forks

I checked the replace entries and gomod2nix mappings and used the GitHub API to confirm the pseudo-version commits exist.

  • go.mod replace block (lines ~300–340):
    • github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.20-0.20250815065500-a4fbafcae0dd
    • github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.6.1-0.20250815070734-9e6b13895396
  • gomod2nix.toml: entries for both modules have matching version and replaced fields.
  • GitHub commits confirmed:

If you also need explicit confirmation that those commits contain the exact changes from upstream PRs (go-ethereum PR #21 and ethermint PR #691), say so and I can check the PR/commit association next.

gomod2nix.toml (3)

310-312: Updated geth fork version/hash match go.mod replacement

The pseudo-version and sha256 appear in sync with go.mod. Good pinning to a specific commit.


317-319: Updated ethermint fork version/hash match go.mod replacement

Aligned with go.mod and addresses previous out-of-sync feedback. Nice.


797-798: protobuf v1.36.7 hash and version update confirmed

Matches go.mod; no issues.

@randy-cro randy-cro added this pull request to the merge queue Aug 15, 2025
Merged via the queue into main with commit ff9422f Aug 15, 2025
37 checks passed
@thomas-nguy thomas-nguy deleted the refactor/remove-active-precompiles-from-vm-context branch August 18, 2025 03:37
@coderabbitai coderabbitai bot mentioned this pull request Oct 3, 2025
13 tasks
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.

3 participants