Skip to content

Conversation

XinyuCRO
Copy link
Contributor

@XinyuCRO XinyuCRO commented Aug 20, 2025

ethermint pr: crypto-org-chain/ethermint#702

Summary by CodeRabbit

  • Documentation

    • Updated UNRELEASED notes to document default CancunTime and PragueTime and minor formatting cleanup.
  • Chores

    • Bumped a core dependency snapshot and updated its lock/hash.
    • Set default Cancun/Prague values and added blob scheduling entries in genesis configuration.
  • Tests

    • Added helpers to fund test accounts and to remove Cancun/Prague params via governance.
    • Expanded integration tests for pre- and post-Cancun SELFDESTRUCT behavior.
  • Contracts (tests)

    • Added payable receive handlers to test contracts to support new suicide tests.

@XinyuCRO XinyuCRO requested a review from a team as a code owner August 20, 2025 11:15
@XinyuCRO XinyuCRO requested review from JayT106 and calvinaco and removed request for a team August 20, 2025 11:15
Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

Walkthrough

Adds docs note about default Cancun/Prague times, bumps an ethermint dependency and its nix hash, modifies genesis to set cancun/prague times and add blobSchedule, introduces test helpers (funding + governance param removal), updates SELFDESTRUCT integration tests for pre/post-Cancun behavior, and adds receive handlers to test contracts.

Changes

Cohort / File(s) Summary
Changelog / docs
CHANGELOG.md
Added an Improvements bullet about default CancunTime and PragueTime in chain config; minor formatting blank-line change.
Dependency bump: ethermint
go.mod, gomod2nix.toml
Updated github.com/evmos/ethermint replace/version to v0.6.1-0.20250820110050-d940a537fb81 and updated the corresponding sha256 in gomod2nix.toml.
Genesis / chain config
scripts/geth-genesis.json
Set cancunTime and pragueTime from null to 0; added blobSchedule with cancun and prague target/max/baseFeeUpdateFraction entries.
Integration tests — governance param flow
integration_tests/test_gov_update_params.py, integration_tests/utils.py
Added remove_cancun_prague_params(cronos) helper; test_evm_update_param now removes cancun_time and prague_time from chain_config before submitting an update and asserts their absence after execution.
Integration tests — funding & suicide tests
integration_tests/utils.py, integration_tests/test_basic.py, integration_tests/contracts/.../TestSuicide.sol
Added fund_acc(w3, acc, fund=...) helper; replaced test_suicide(cluster)test_suicide_pre_cancun(cronos) and added test_suicide_post_cancun(cluster) to cover pre/post-Cancun SELFDESTRUCT semantics; added receive() external payable {} to Destroyee and Destroyer contracts.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Test as Integration Test
    participant Utils as utils.remove_cancun_prague_params
    participant Node as Cronos Node (RPC)
    participant Gov as Governance Module
    participant Params as Chain Params Store

    Note over Test,Utils: remove_cancun_prague_params flow
    Test->>Utils: call remove_cancun_prague_params(cronos)
    Utils->>Node: query current chain_config
    Node->>Utils: return chain_config (includes cancun_time/prague_time)
    Utils->>Gov: submit MsgUpdateParams with cancun_time/prague_time removed
    Gov->>Node: propose & execute param update (async)
    Node->>Params: apply updated chain_config
    Params->>Node: updated params confirmed
    Node->>Utils: fetch params
    Utils->>Test: assert cancun_time/prague_time absent
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • JayT106
  • calvinaco
  • yihuang

Poem

I nibble bytes beneath the starlit log,
I set Cancún and Prague on the testnet bog.
I fund a wallet, tweak a governance rhyme,
Contracts listen, then wake at runtime. 🐇✨

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.


📜 Recent 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 611942e and 8aab643.

📒 Files selected for processing (1)
  • integration_tests/utils.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • integration_tests/utils.py
⏰ 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-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: unittest
  • GitHub Check: gomod2nix
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

socket-security bot commented Aug 20, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​crypto-org-chain/​ethermint@​v0.6.1-0.20250819081101-9a03795ec96b ⏵ v0.6.1-0.20250820110050-d940a537fb8175 +110010010070

View full report

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 cde48ef and 6947704.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • go.mod (1 hunks)
  • gomod2nix.toml (1 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: gomod2nix
  • GitHub Check: build (macos-14)
  • GitHub Check: build (macos-latest)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: unittest
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: Run golangci-lint
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
CHANGELOG.md (1)

13-13: Whitespace consistency looks good.

Adding a blank line after the “Improvements” heading matches the formatting used in other sections.

go.mod (1)

308-308: Verified ethermint version bump

  • go.mod and gomod2nix.toml both reference v0.6.1-0.20250820110050-d940a537fb81
  • Commit d940a537fb81 message confirms “add Cancun and Prague fork default value (#702)”

All checks pass.

gomod2nix.toml (1)

317-319: gomod2nix pinned to the new ethermint version and hash; good alignment.

The module entry matches the go.mod replace and includes the updated sha256. Assuming CI’s nix build passes, this looks solid.

Copy link

codecov bot commented Aug 20, 2025

Codecov Report

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

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1851       +/-   ##
===========================================
+ Coverage   16.87%   35.81%   +18.94%     
===========================================
  Files          72      127       +55     
  Lines        6163    11812     +5649     
===========================================
+ Hits         1040     4231     +3191     
- Misses       5000     7158     +2158     
- Partials      123      423      +300     

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
integration_tests/test_gov_update_params.py (1)

53-55: Syntax error in params dict: broken string literal and missing comma.

The ibc_cro_denom value is split across lines and missing a trailing comma, which will prevent the test file from parsing.

Apply this fix:

-        "ibc_cro_denom": "ibc/6411AE2ADA1E73DB59DB151"
-        "A8988F9B7D5E7E233D8414DB6817F8F1A01600000",
-        "ibc_timeout": "96400000000000",
+        "ibc_cro_denom": "ibc/6411AE2ADA1E73DB59DB151A8988F9B7D5E7E233D8414DB6817F8F1A01600000",
+        "ibc_timeout": "96400000000000",
🧹 Nitpick comments (3)
integration_tests/test_gov_update_params.py (3)

18-21: Prefer tolerant removals for future-proofing (avoid KeyError).

Direct del raises if any key is missing on certain Ethermint versions. Use a single loop with pop(..., None) to keep the test resilient while preserving intent.

-    del p["chain_config"]["merge_netsplit_block"]
-    del p["chain_config"]["shanghai_time"]
-    del p["chain_config"]["cancun_time"]
-    del p["chain_config"]["prague_time"]
+    for k in ("merge_netsplit_block", "shanghai_time", "cancun_time", "prague_time"):
+        p["chain_config"].pop(k, None)

36-39: Assert presence plus defaulted value to validate the “default value” contract.

The goal is to confirm the params are present and defaulted, not merely falsy. This also makes the intent explicit and avoids ambiguity if types ever change.

-    assert not p["chain_config"]["merge_netsplit_block"]
-    assert not p["chain_config"]["shanghai_time"]
-    assert not p["chain_config"]["cancun_time"]
-    assert not p["chain_config"]["prague_time"]
+    for k in ("merge_netsplit_block", "shanghai_time", "cancun_time", "prague_time"):
+        assert k in p["chain_config"], f"{k} missing from chain_config"
+        assert not p["chain_config"][k]

If merge_netsplit_block is not boolean on your chain (e.g., an int), consider replacing the last assert with explicit equality checks (e.g., == 0) after confirming types from cli.query_params("evm").


40-46: Make the error-message assertion robust to node/runtime variations.

Error strings can vary slightly across geth/Ethermint versions. Matching case-insensitively on the opcode is less brittle.

-    invalid_msg = "invalid opcode: PUSH0"
+    invalid_msg = "push0"
     with pytest.raises(ValueError) as e_info:
         contract.caller.randomTokenId()
-    assert invalid_msg in str(e_info.value)
+    assert invalid_msg in str(e_info.value).lower()
     with pytest.raises(ValueError) as e_info:
         deploy_contract(cronos.w3, CONTRACTS["Greeter"])
-    assert invalid_msg in str(e_info.value)
+    assert invalid_msg in str(e_info.value).lower()
📜 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 6947704 and 2f62414.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • integration_tests/test_gov_update_params.py (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
⏰ 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). (16)
  • GitHub Check: Run golangci-lint
  • GitHub Check: build (macos-14)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: unittest
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (unmarked)

@github-actions github-actions bot added the build label Aug 21, 2025
Copy link
Contributor

@calvinaco calvinaco left a comment

Choose a reason for hiding this comment

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

Left a comment on the test

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

♻️ Duplicate comments (1)
integration_tests/test_basic.py (1)

674-681: Pre-Cancun gating via governance is the right approach; thanks for splitting tests

This addresses the earlier suggestion to have separate pre-/post-EIP-6780 tests by explicitly disabling Cancun/Prague via governance before running the pre-Cancun assertions.

🧹 Nitpick comments (4)
scripts/geth-genesis.json (1)

20-31: Confirm blobSchedule schema/values match the client you run in CI

The blobSchedule section (target=3, max=6, baseFeeUpdateFraction=3338477) looks intentional, but these keys and the update fraction are client/version-specific. Two quick checks I recommend:

  • Ensure your pinned Geth in CI accepts this exact schema.
  • Document (or reference) where 3338477 comes from (upstream default or Ethermint override) to help future maintainers keep Cronos/Geth/Ethermint in sync.

If desired, I can add a short README note next to this genesis explaining the rationale.

integration_tests/contracts/contracts/TestSuicide.sol (1)

23-23: Destroyer’s receive() is optional for SELFDESTRUCT funds

SELFDESTRUCT transfers value without invoking fallback/receive on the beneficiary, so this is not strictly required. Keeping it is harmless and may help future scenarios where Destroyer is funded via normal transfers. If you prefer minimal bytecode, you could drop it.

-    receive() external payable {}
+    // receive() not required for SELFDESTRUCT; keep only if you expect normal transfers.
+    // receive() external payable {}
integration_tests/utils.py (1)

851-857: Fund helper works; consider making it resilient to pre-funded addresses and explicit about desired balance

Current behavior funds only when balance==0 and then asserts exact equality with fund. That matches your tests (newly deployed contracts). If you want this utility to be reusable elsewhere, consider topping up to a target balance and tolerating pre-funded accounts.

Optional, if you want that behavior:

-def fund_acc(w3, acc, fund=3000000000000000000):
-    addr = acc.address
-    if w3.eth.get_balance(addr, "latest") == 0:
-        tx = {"to": addr, "value": fund, "gasPrice": w3.eth.gas_price}
-        send_transaction(w3, tx)
-        assert w3.eth.get_balance(addr, "latest") == fund
+def fund_acc(w3, acc, fund=3000000000000000000):
+    addr = acc.address
+    bal = w3.eth.get_balance(addr, "latest")
+    if bal < fund:
+        # top up to target
+        delta = fund - bal
+        tx = {"to": addr, "value": delta, "gasPrice": w3.eth.gas_price}
+        send_transaction(w3, tx)
+        assert w3.eth.get_balance(addr, "latest") >= fund
integration_tests/test_basic.py (1)

702-736: Post-Cancun assertions look correct; minor readability nit

The checks reflect EIP-6780 semantics (funds recovered, code intact). For readability, consider using to_wei to express 1 ETH.

-    balance_wanted = 1000000000000000000
+    balance_wanted = web3.Web3.to_wei(1, "ether")

Optional additional coverage: add a case where a contract is created and selfdestructs in the same transaction (the exception in EIP-6780), asserting code deletion in that specific scenario. I can provide a small Factory contract and test if useful.

📜 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 2f62414 and 80f829b.

📒 Files selected for processing (4)
  • integration_tests/contracts/contracts/TestSuicide.sol (2 hunks)
  • integration_tests/test_basic.py (3 hunks)
  • integration_tests/utils.py (1 hunks)
  • scripts/geth-genesis.json (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
integration_tests/utils.py (3)
integration_tests/network.py (3)
  • w3 (39-42)
  • cosmos_cli (56-57)
  • cosmos_cli (81-82)
testground/benchmark/benchmark/testnet.py (1)
  • fund (36-76)
integration_tests/cosmoscli.py (4)
  • address (302-312)
  • query_params (1115-1126)
  • module_address (37-44)
  • submit_gov_proposal (1267-1347)
integration_tests/test_basic.py (1)
integration_tests/utils.py (5)
  • fund_acc (851-856)
  • remove_cancun_prague_params (859-879)
  • deploy_contract (414-434)
  • contract_path (69-75)
  • send_transaction (459-462)
⏰ 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: integration_tests (ibc_rly_evm)
  • GitHub Check: gomod2nix
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: build (macos-14)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: unittest
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: Run golangci-lint
  • GitHub Check: build (macos-latest)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
scripts/geth-genesis.json (1)

18-19: Cancun/Prague set to activate at genesis looks correct and aligns with PR intent

Setting cancunTime and pragueTime to 0 ensures both forks are active from genesis in the Geth-based test cluster, which matches the test split between pre/post semantics (Cronos disables via gov, Geth stays enabled). LGTM.

integration_tests/contracts/contracts/TestSuicide.sol (1)

9-9: Adding a payable receive() on Destroyee is necessary for clean ETH funding

This unblocks direct value transfers in tests prior to SELFDESTRUCT. Good addition.

integration_tests/test_basic.py (1)

28-35: Good import split to externalize helpers

Importing fund_acc and remove_cancun_prague_params from utils keeps tests concise and DRY. LGTM.

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

♻️ Duplicate comments (1)
integration_tests/utils.py (1)

859-880: Make Cancun/Prague param removal idempotent and assertions robust (absent vs. zero).

Using del raises on missing keys and post-conditions via direct subscripting fail if the API omits fields or returns "0" (string). Use pop with defaults and assert on None/0/"0". This mirrors an earlier review; re-flagging here for completeness.

-def remove_cancun_prague_params(cronos):
-    from .cosmoscli import module_address as cosmos_module_address
+def remove_cancun_prague_params(cronos):
     cli = cronos.cosmos_cli()
     p = cli.query_params("evm")
-    del p["chain_config"]["cancun_time"]
-    del p["chain_config"]["prague_time"]
+    # Tolerate missing keys to avoid KeyError and keep tests idempotent
+    cfg = p.get("chain_config") or {}
+    cfg.pop("cancun_time", None)
+    cfg.pop("prague_time", None)
     authority = cosmos_module_address("gov")
     msg = "/ethermint.evm.v1.MsgUpdateParams"
     submit_gov_proposal(
         cronos,
         msg,
         messages=[
             {
                 "@type": msg,
                 "authority": authority,
                 "params": p,
             }
         ],
     )
-    p = cli.query_params("evm")
-    assert not p["chain_config"]["cancun_time"]
-    assert not p["chain_config"]["prague_time"]
+    cfg = cli.query_params("evm").get("chain_config") or {}
+    # Accept either absent or zero values (int or string)
+    assert cfg.get("cancun_time") in (None, 0, "0"), cfg
+    assert cfg.get("prague_time") in (None, 0, "0"), cfg

Additionally, Black flagged this hunk (BLK100). One likely fix is to move the import out of the function (see next comment).

🧹 Nitpick comments (2)
integration_tests/utils.py (2)

851-856: Top up to a target balance; avoid forcing legacy gasPrice.

Current logic only funds when the balance is exactly zero and unconditionally sets gasPrice. For more resilient tests:

  • Top up the difference when the balance is below the target.
  • Let Web3 fill EIP-1559 fee fields (or legacy on non-1559 chains) by omitting gasPrice.
-def fund_acc(w3, acc, fund=3000000000000000000):
-    addr = acc.address
-    if w3.eth.get_balance(addr, "latest") == 0:
-        tx = {"to": addr, "value": fund, "gasPrice": w3.eth.gas_price}
-        send_transaction(w3, tx)
-        assert w3.eth.get_balance(addr, "latest") == fund
+def fund_acc(w3, acc, fund=3000000000000000000):
+    addr = acc.address
+    bal = w3.eth.get_balance(addr, "latest")
+    if bal < fund:
+        # Rely on node defaults (EIP-1559 on supported chains, legacy otherwise).
+        tx = {"to": addr, "value": fund - bal}
+        send_transaction(w3, tx)
+        assert w3.eth.get_balance(addr, "latest") == fund

860-860: Move local import to module scope to satisfy Black and avoid runtime import overhead.

Static analysis shows BLK100 on this block. Importing at module level also clarifies intent since a same-named helper exists in this file. Remove the in-function import and add this at the top with other imports:

from .cosmoscli import module_address as cosmos_module_address

And delete Line 860 inside the function:

-    from .cosmoscli import module_address as cosmos_module_address
📜 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 80f829b and 611942e.

📒 Files selected for processing (1)
  • integration_tests/utils.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
integration_tests/utils.py (2)
integration_tests/network.py (3)
  • w3 (39-42)
  • cosmos_cli (56-57)
  • cosmos_cli (81-82)
integration_tests/cosmoscli.py (4)
  • address (302-312)
  • module_address (37-44)
  • query_params (1115-1126)
  • submit_gov_proposal (1267-1347)
🪛 GitHub Check: Lint python
integration_tests/utils.py

[failure] 861-861:
./integration_tests/utils.py:861:1: BLK100 Black would make changes.

⏰ 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: integration_tests (ica)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: gomod2nix
  • GitHub Check: unittest
  • GitHub Check: Run golangci-lint
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

Copy link
Contributor

@calvinaco calvinaco left a comment

Choose a reason for hiding this comment

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

LGTM

@XinyuCRO XinyuCRO added this pull request to the merge queue Aug 21, 2025
Merged via the queue into crypto-org-chain:main with commit 1f80cb2 Aug 21, 2025
42 checks passed
@XinyuCRO XinyuCRO deleted the fix/chain-config branch August 21, 2025 14:59
@coderabbitai coderabbitai bot mentioned this pull request Sep 4, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants