Skip to content

Conversation

@thomas-nguy
Copy link
Collaborator

@thomas-nguy thomas-nguy commented Jan 5, 2026

👮🏻👮🏻👮🏻 !!!! 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

  • Bug Fixes

    • Fixed preinstall behavior to allow preinstall when an account has an existing balance
  • Tests

    • Expanded integration tests to set up balances, submit preinstall registration, and verify preinstall code and transaction outcomes
  • Chores

    • Modernized and bumped numerous dependencies and module references for security and stability
  • Documentation

    • Added a changelog entry noting the preinstall fix

✏️ Tip: You can customize this high-level summary in your review settings.

@thomas-nguy thomas-nguy requested a review from a team as a code owner January 5, 2026 04:36
@thomas-nguy thomas-nguy requested review from JayT106 and songgaoye and removed request for a team January 5, 2026 04:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

Warning

Rate limit exceeded

@thomas-nguy has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7ddfd67 and 8c4c4f7.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod
📝 Walkthrough

Walkthrough

Updates dependency versions and lockfile hashes, adds a changelog entry, and expands the preinstall integration test to fund the preinstall address, register a Create2 preinstall via governance, and verify deployment behavior when the account has a balance.

Changes

Cohort / File(s) Change Summary
Dependency Version & Replace Updates
go.mod
Multiple dependency bumps and replace adjustments (e.g., cosmos/ibc-go/v10 v10.4.0→v10.5.0, golang.org/x/crypto v0.41.0→v0.44.0, google.golang.org/grpc v1.75.1→v1.78.0, OpenTelemetry stack v1.37.x→v1.38.x, Envoy/XDS updates); broad transitive updates.
gomod2nix lock/hash sync
gomod2nix.toml
Updated module entries and hashes to match bumped versions in go.mod (multiple modules updated: cloud/google, x/*, genproto, envoy, ibc-go, etc.).
Preinstall Integration Test
integration_tests/test_preinstall.py
Adds ADDRS import, transfers 5 wei from validator to preinstall address, waits for receipt and asserts status + gasUsed (21000), checks preinstall address code empty, submits gov proposal to register Create2 preinstall, and verifies expected Create2 code.
Changelog
CHANGELOG.md
Added UNRELEASED entry: "Fix: allow preinstall in case account has a balance" (PR #1946).

Sequence Diagram(s)

(omitted — changes are dependency updates, lockfile sync, changelog, and an integration test augmentation; no new multi-component runtime control flow requiring visualization)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

cronos, nix

Suggested reviewers

  • songgaoye
  • JayT106

Poem

🐰 I hopped through modules, hashes in tow,
A five-wei whisper where preinstalls grow,
Gov proposal filed, Create2 springs bright,
Hashes aligned beneath moonlight,
Hooray — the rabbit pats the chain goodnight ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: allow preinstall in case account has a balance' directly describes the main change - allowing preinstall functionality when an account has a balance, which is supported by CHANGELOG.md entry and code changes across multiple files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security
Copy link

socket-security bot commented Jan 5, 2026

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

Fix all issues with AI Agents 🤖
In @integration_tests/test_preinstall.py:
- Around line 15-26: Break the long call to w3.eth.send_transaction into
multiple shorter lines to satisfy the 88-character limit and replace direct use
of w3.eth.send_transaction with the existing send_transaction helper from utils
for consistency; keep the same behavior by assigning the returned tx hash to
txhash, awaiting the receipt via w3.eth.wait_for_transaction_receipt(txhash) and
asserting receipt.status == 1 and receipt.gasUsed == 21000 (refer to symbols:
w3.eth.send_transaction, send_transaction, txhash,
w3.eth.wait_for_transaction_receipt, receipt.gasUsed).
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1dd5388 and 6f85b50.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • CHANGELOG.md
  • go.mod
  • gomod2nix.toml
  • integration_tests/test_preinstall.py
🧰 Additional context used
🧬 Code graph analysis (1)
integration_tests/test_preinstall.py (2)
integration_tests/utils.py (2)
  • submit_gov_proposal (226-238)
  • send_transaction (468-471)
integration_tests/network.py (1)
  • w3 (39-42)
🪛 GitHub Check: Lint python
integration_tests/test_preinstall.py

[failure] 15-15:
./integration_tests/test_preinstall.py:15:89: E501 line too long (94 > 88 characters)

⏰ 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: build (ubuntu-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: build (macos-latest)
  • GitHub Check: gomod2nix
  • GitHub Check: integration_tests (evm)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: Run golangci-lint
🔇 Additional comments (7)
CHANGELOG.md (1)

16-16: LGTM! Changelog entry is clear and well-formatted.

The changelog entry accurately describes the fix for allowing preinstall when an account has a balance, consistent with the PR objective and test changes.

integration_tests/test_preinstall.py (2)

5-5: LGTM! Import addition supports the new test scenario.

The ADDRS import is correctly added to support funding the preinstall address in the test.


27-29: LGTM! Validation correctly ensures preinstall address starts empty.

The check confirms the preinstall address has no code before the governance proposal, which is essential for validating the test scenario.

gomod2nix.toml (1)

1-820: Auto-generated file is consistent with go.mod updates.

This file is auto-generated by gomod2nix and correctly reflects the dependency version updates from go.mod, including hash recalculations for:

  • cosmos/ibc-go/v10: v10.4.0 → v10.5.0
  • OpenTelemetry packages: v1.37.x → v1.38.0
  • grpc: v1.75.1 → v1.78.0
  • golang.org/x packages (crypto, net, oauth2, sync, sys, term, text)
  • Various cloud and telemetry dependencies

No manual review required for this generated content.

go.mod (3)

54-54: OpenTelemetry and transitive dependency updates look substantial.

The PR updates multiple indirect dependencies including:

  • OpenTelemetry stack: v1.37.x → v1.38.0 (across otel, otel/metric, otel/sdk, otel/trace)
  • golang.org/x packages: net (v0.43.0 → v0.47.0), oauth2 (v0.30.0 → v0.32.0), sys (v0.35.0 → v0.38.0), term (v0.34.0 → v0.37.0), text (v0.28.0 → v0.32.0), sync (v0.16.0 → v0.19.0)
  • Google Cloud: compute/metadata (v0.7.0 → v0.9.0), GCP detectors (v1.29.0 → v1.30.0)
  • Other: envoyproxy (v1.32.4 → v1.35.0), spiffe (v2.5.0 → v2.6.0)

These are primarily transitive dependencies. While generally safe, the large jump in golang.org/x/net (4 minor versions) and golang.org/x/sys (3 minor versions) should be tested to ensure no unexpected behavior changes, particularly around networking and system calls.

Please ensure integration tests pass successfully with these dependency updates, particularly:

  • Network-related operations (RPC, P2P, IBC)
  • OpenTelemetry instrumentation and metrics collection
  • Any code that directly interacts with updated packages

Also applies to: 66-66, 90-90, 126-126, 134-134, 214-214, 227-227, 250-258, 263-268, 272-272


306-306: Note: ethermint replace directive updated.

The ethermint dependency has been updated to a newer commit (v0.22.1-0.20260105042515-e5b2b4df9e8d). This aligns with the preinstall functionality changes in this PR.


26-26: Verify coordination requirement for ibc-go v10.5.0 upgrade.

The ibc-go v10.5.0 update introduces state-breaking changes (adds integrity validations for ProtoJSON-encoded ICA packets) and requires a coordinated chain upgrade. Since cronos actively uses ICA functionality (x/cronos/keeper/precompiles/ica.go), verify that the chain upgrade is properly coordinated and any necessary migration steps are documented.

The golang.org/x/crypto v0.44.0 update is a routine dependency refresh with no security fixes, deprecations, or API changes to address. The grpc v1.78.0 release includes a behavior change for unbracketed colons in hostnames (when using Go 1.26+), but cronos uses standard gRPC configuration, so this is unlikely to impact the current setup.

@codecov
Copy link

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.51%. Comparing base (a3c2f70) to head (8c4c4f7).
⚠️ Report is 133 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1946      +/-   ##
==========================================
+ Coverage   16.87%   25.51%   +8.63%     
==========================================
  Files          72       78       +6     
  Lines        6163     5150    -1013     
==========================================
+ Hits         1040     1314     +274     
+ Misses       5000     3673    -1327     
- Partials      123      163      +40     

see 73 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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)
integration_tests/test_preinstall.py (1)

15-26: Line length issue resolved; test logic correctly validates the PR objective.

The comment is now properly split across two lines, addressing the linter failure. The test correctly:

  • Funds the preinstall address with 5 wei
  • Verifies the transaction succeeds with standard gas usage (21000)
  • Ensures the address remains empty before governance registration

This validates that preinstall registration works even when the account has a non-zero balance, which aligns with the PR objective.

Note: The past review suggested using the send_transaction helper from utils for consistency with the codebase pattern, but this wasn't addressed. While the current direct usage is functionally correct, consider this for future refactoring if consistency is a priority.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6f85b50 and 7ddfd67.

📒 Files selected for processing (1)
  • integration_tests/test_preinstall.py
🧰 Additional context used
🧬 Code graph analysis (1)
integration_tests/test_preinstall.py (2)
integration_tests/utils.py (1)
  • submit_gov_proposal (226-238)
integration_tests/network.py (1)
  • w3 (39-42)
⏰ 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). (19)
  • GitHub Check: Run golangci-lint
  • GitHub Check: build (macos-14)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: gomod2nix
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (evm)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
integration_tests/test_preinstall.py (2)

5-5: LGTM - Import additions support the new test logic.

The addition of ADDRS and submit_gov_proposal imports is correct and both are properly utilized in the expanded test flow.


28-57: Excellent test coverage for the preinstall-with-balance scenario.

The test flow is well-structured and comprehensive:

  1. Fund the preinstall address
  2. Verify it's empty (comment at line 28 clarifies intent)
  3. Register the preinstall via governance
  4. Verify the code is correctly deployed

This thoroughly validates that preinstall registration succeeds when the account has a pre-existing balance, which is exactly what the PR aims to fix.

@thomas-nguy thomas-nguy enabled auto-merge January 7, 2026 03:02
@thomas-nguy thomas-nguy added this pull request to the merge queue Jan 7, 2026
Merged via the queue into crypto-org-chain:main with commit 6d59068 Jan 7, 2026
51 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.

2 participants