Skip to content

Conversation

@songgaoye
Copy link
Contributor

@songgaoye songgaoye commented Oct 20, 2025

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

  • New Features

    • Added batch transaction signing support for improved transaction handling
    • Added eth_getBlockReceipts JSON-RPC endpoint
    • Integrated optimistic execution and version database support
  • Bug Fixes

    • Fixed version database handling during chain upgrades
    • Improved idempotent commit writes for data reliability
    • Fixed data verification in version database operations
  • Documentation

    • Updated Ethereum JSON-RPC reference documentation links
    • Updated architectural decision record references
  • Chores

    • Updated Go to 1.23.3 and RocksDB to 9.8.4
    • Pinned GitHub Actions to specific versions for build reliability

@songgaoye songgaoye requested a review from a team as a code owner October 20, 2025 07:16
@songgaoye songgaoye requested review from JayT106 and thomas-nguy and removed request for a team October 20, 2025 07:16
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. 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

This PR updates GitHub Actions workflows by pinning external actions to specific commit SHAs, updates Go dependencies and build tooling (Nix, gomod2nix), adds legacy codec registration for historical transaction support, enhances memiavl and versiondb with batch writing and idempotency features, extends integration tests with batch transaction signing workflows, and adds documentation and configuration updates across the codebase.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow Updates
.github/workflows/build.yml, .github/workflows/container.yml, .github/workflows/gosec.yml, .github/workflows/linkchecker.yml, .github/workflows/lint.yml, .github/workflows/proto.yml, .github/workflows/release.yml, .github/workflows/sims.yml, .github/workflows/test.yml
Pin external GitHub Actions to specific commit SHAs instead of version tags (e.g., checkout v3→v4, cachix actions, codecov, artifact uploads); update action versions for consistency and reproducibility.
App Core Logic
app/app.go, app/upgrades.go, app/storeloader.go
Introduce optimistic execution flag and conditional memiavl cache enabling; update RegisterUpgradeHandlers to accept maxVersion parameter and return boolean; add MaxVersionStoreLoader and MaxVersionUpgradeStoreLoader helpers for versioned store loading with upgrade support.
Legacy Codec Registration
app/legacy.go, app/legacy/icaauth/types/codec.go, cmd/cronosd/cmd/root.go
Add legacy Amino codec and interface registration for ICA auth messages; register legacy support in CLI root command to enable decoding of historical transactions from removed modules.
App Tests
app/legacy_test.go
Add TestDecodeLegacyTx to verify legacy transaction decoding with registered codec and interfaces.
Memiavl Database
memiavl/db.go, memiavl/db_test.go, memiavl/multitree.go
Introduce reusable write batch in DB struct; refactor commit logic to use batch-based writing; add writeEntry helper for idempotent commits; update CatchupWAL with explicit endIndex handling and version clamping; add TestIdempotentWrite to verify consistency across sync and async commit modes.
VersionDB Store
versiondb/tsrocksdb/store.go
Optimize read options creation in GetAtVersionSlice and iteratorAtVersion; add dry-run support to FixData with timestamp-aware comparison for idempotency.
Integration Tests Core
integration_tests/utils.py, integration_tests/test_basic.py, integration_tests/test_upgrade.py, integration_tests/test_versiondb.py
Add build_batch_tx_signed for signed batch transactions; refactor build_batch_tx to use new helper; introduce batch transaction test cases with receipt validation via eth_getBlockReceipts; add transaction tracing and upgrade-flow version data fixes; add wait-for-blocks utility usage.
Integration Test Configuration
integration_tests/pytest.ini, integration_tests/cosmoscli.py, integration_tests/shell.nix, integration_tests/configs/default.jsonnet, integration_tests/configs/upgrade-test-package.nix
Update pytest file discovery pattern; add changeset_fixdata method to CosmosCLI; set TMPDIR in shell environment; add async-commit-buffer config; update released1_3 fetchFlake revision.
Integration Test Contracts
integration_tests/contracts/contracts/TestERC20Owner.sol
Add new ERC20 test contract with constructor-based minting.
Go Dependencies
go.mod, gomod2nix.toml
Update Go toolchain from 1.23.1 to 1.23.3; bump cosmos-sdk, ibc-go, cometbft, and related dependencies; update module replacements and indirect dependencies; sync vendor metadata in gomod2nix.toml.
Nix Build Configuration
flake.nix, nix/sources.json, default.nix
Migrate gomod2nix source from personal fork (obreitwi) to nix-community; update gomod2nix URL and revision; update default version from v1.4.0 to v1.4.11.
Nix Build Patches
nix/build_overlay.nix, nix/go_no_vendor_checks-1.23.patch
Refactor build overlay to use let-in expression with replaceLast helper; add GO_NO_VENDOR_CHECKS environment flag to bypass vendor checks for Go 1.23 compatibility.
Nix RocksDB & Env
nix/rocksdb.nix, nix/testenv.nix
Update RocksDB from 9.7.4 to 9.8.4 with corresponding hash; add isort to buildSystems in test environment.
Build & Scripts
Makefile, scripts/run-integration-tests
Change integration test execution from nix-shell with shell.nix to direct script invocation; update test timeouts (1800→6000 seconds); adjust directory navigation in test script.
TestGround Benchmark
testground/benchmark/flake.nix, testground/benchmark/overlay.nix
Change flake outputs from recursive to non-recursive attribute set; add isort to buildSystems override for poetry-core compatibility.
Documentation
docs/api/json-rpc/endpoints.md, docs/api/json-rpc/events.md, docs/api/json-rpc/server.md, docs/architecture/adr-001.md, docs/architecture/adr-008.md
Update JSON-RPC API reference URLs to new docs paths; add eth_getBlockReceipts endpoint; remove x/erc20 module reference from ADR-008; update ADR-001 in-place store migration link.
Changelog
CHANGELOG.md
Add UNRELEASED section and v1.4.9 release with bug fix entries and PR references.

Sequence Diagram(s)

sequenceDiagram
    participant App as App Startup
    participant Store as Store/Cache
    participant OptExec as Optimistic Execution
    participant VersionDB as VersionDB
    participant MemiAVL as MemiAVL

    Note over App: Initialize application
    App->>VersionDB: Check if versiondb.enable
    alt versiondb enabled
        VersionDB-->>App: setupVersionDB, capture qmsVersion
    else versiondb disabled
        App->>App: qmsVersion = 0
    end

    App->>OptExec: Check optimisticExecutionEnabled
    alt optimistic execution enabled
        OptExec-->>App: Enable in base app options
    end

    App->>Store: Decide on cache strategy
    alt block-stm or optimistic execution enabled
        Store->>MemiAVL: Skip memiavl cache
    else both disabled
        Store->>MemiAVL: Enable memiavl cache
    end

    App->>App: RegisterUpgradeHandlers(cdc, qmsVersion)
    App->>Store: Set appropriate loader (MaxVersionStoreLoader or default)
    Note over App: Loader selection based on version and upgrade metadata
    App-->>App: Application ready
Loading
sequenceDiagram
    participant Test as Integration Test
    participant CLI as CosmosCLI
    participant Node as Cronos Node
    participant Batch as Batch TX Builder
    participant Receipt as eth_getBlockReceipts

    Test->>Batch: Prepare deploy, transfer1, transfer2 transactions
    Batch->>Batch: Sign each transaction
    Test->>CLI: build_batch_tx_signed(signed_txs)
    CLI->>Node: Submit Cosmos batch transaction
    Node-->>CLI: tx hash
    
    Test->>Node: Wait for transaction confirmation
    Node-->>Test: Transaction receipts
    
    Test->>Receipt: Fetch block receipts via eth_getBlockReceipts
    Receipt-->>Test: Receipts with blockNumber, transactionIndex, cumulativeGasUsed
    
    Test->>Test: Validate receipt fields against expected values
    Note over Test: Assert transactionIndex alignment and gas tracking
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

The diff spans multiple disparate subsystems (workflows, app core logic, memiavl internals, integration tests, nix configuration, documentation) with heterogeneous change types (logic refactoring, new features, dependency bumps, test additions). While individual cohorts may be straightforward, the breadth and interconnections require careful cross-file reasoning to ensure consistency across app initialization, storage handling, upgrade semantics, and test coverage.

Possibly related PRs

Suggested labels

cronos, nix, ci, build, app, integration-tests, dependencies, docs

Suggested reviewers

  • leejw51crypto
  • mmsqe
  • JayT106

Poem

🐰 Whiskers twitching with delight
Actions pinned to commits, workflows tight,
Batches signed with cryptic grace,
VersionDB reigns in its rightful place,
Hops and bounds through legacy code,
Legacy codecs lighten the load! 🌟

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.04% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "fix: disable memiavl cache when optimistic execution is enabled" directly corresponds to a real and documented change in the changeset. Specifically, app/app.go introduces an optimisticExecutionEnabled flag and conditionally enables the memiavl cache only when neither block-stm nor optimistic execution is enabled. However, the changeset is extensive and includes numerous other significant changes across multiple domains: GitHub Actions workflow pinning, dependency version updates (go.mod, gomod2nix.toml), integration test enhancements, memiavl optimization changes, versiondb improvements, legacy codec support, documentation updates, and nix infrastructure changes. The title refers to a real part of the change but does not capture the main breadth of the changeset.

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.

@songgaoye songgaoye changed the base branch from main to release/v1.4.x October 20, 2025 07:16
app/app.go Outdated
})

blockSTMEnabled := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) == "block-stm"
optimisticExecutionEnabled := true
Copy link
Collaborator

Choose a reason for hiding this comment

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

should you set the boolean somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's always true( in L449 SetOptimisticExecution). I use this variable because I want to disable memiavl cache.

Copy link
Collaborator

Choose a reason for hiding this comment

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

alternatively, is there a way to disable optimistic execution?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch!. i can add a variable like srvflags.EVMBlockExecutor disable optimistic execution.

@randy-cro
Copy link
Contributor

randy-cro commented Oct 21, 2025

should the PR to release/v1.5.x instead?

app/app.go Outdated

// enable optimistic execution
baseAppOptions = append(baseAppOptions, baseapp.SetOptimisticExecution())
if optimisticExecutionEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

optimistic execution is crucial in enabling our quick blocktime though, would it be bad if we disable it?

Copy link
Collaborator

@thomas-nguy thomas-nguy Oct 23, 2025

Choose a reason for hiding this comment

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

We should not recommend it but there is no harm to provide the option

@songgaoye
Copy link
Contributor Author

should the PR to release/v1.5.x instead?

sure, will update.

@socket-security
Copy link

socket-security bot commented Oct 22, 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.20251021095308-b55c0f03f7a6 ⏵ v0.6.1-0.20251022025731-e501888cf64775 +110010010070

View full report

@songgaoye songgaoye changed the title fix: disable memiavl cache when optimistic execution is enabled fix: disable memiavl cache when optimistic execution is enabled(backport) Oct 22, 2025
@songgaoye songgaoye marked this pull request as draft October 22, 2025 02:53
@songgaoye songgaoye marked this pull request as ready for review October 22, 2025 03:58
@thomas-nguy
Copy link
Collaborator

please also update the changelog 🙏

app/app.go Outdated
})

blockSTMEnabled := cast.ToString(appOpts.Get(srvflags.EVMBlockExecutor)) == "block-stm"
// default enable optimisticExecution
Copy link
Contributor

@JayT106 JayT106 Oct 24, 2025

Choose a reason for hiding this comment

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

Prefer wording The default value of optimisticExecution is enabled.

@songgaoye
Copy link
Contributor Author

in favor of #1892, close it.

@songgaoye songgaoye closed this Oct 28, 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.

5 participants