Skip to content

feat: support tx replacement #1840

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

Merged

Conversation

thomas-nguy
Copy link
Collaborator

@thomas-nguy thomas-nguy commented Aug 1, 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 support for replacing pending transactions with higher fees (same nonce).
  • Improvements
    • Enhanced transaction processing performance with caching tied to mempool size.
    • Clearer startup logs indicating the active mempool mode.
    • Enabled unordered transaction handling for better throughput.
  • Tests
    • Added integration test validating transaction replacement behavior.
  • Documentation
    • Updated changelog with “Tx replacement support.”
  • Chores
    • Updated Ethermint dependency versions and related build metadata.

@thomas-nguy thomas-nguy requested a review from a team as a code owner August 1, 2025 06:40
@thomas-nguy thomas-nguy requested review from JayT106 and songgaoye and removed request for a team August 1, 2025 06:40
@thomas-nguy thomas-nguy marked this pull request as draft August 1, 2025 06:40
Copy link
Contributor

coderabbitai bot commented Aug 1, 2025

Walkthrough

Introduces AnteCache into the ante handler and wires mempoolMaxTxs through app initialization. Adds UnsafeUnorderedTx option in a nix patch. Updates Ethermint replace target/version. Adds integration tests and utilities for transaction replacement. Updates changelog.

Changes

Cohort / File(s) Summary
Mempool and Ante Handler Integration
app/app.go, nix/testground-cronosd.patch
App now initializes PriorityNonceMempool when enabled, passes mempoolMaxTxs into setAnteHandler, and configures evmante with AnteCache(cache.NewAnteCache(mempoolMaxTxs)); nix patch also sets UnsafeUnorderedTx: true and AnteCache in evmante options.
Dependency Update
go.mod, gomod2nix.toml
Bumps Ethermint replace target to crypto-org-chain/ethermint pseudo-version 67a47478d691; syncs gomod2nix entry and hash.
Integration Tests and Utils for Tx Replacement
integration_tests/test_basic.py, integration_tests/utils.py
Adds test_tx_replacement and utility functions get_account_nonce, replace_transaction. Inserts a duplicate, incomplete cronos_address_from_mnemonics definition (no return) alongside existing implementation.
Docs
CHANGELOG.md
Notes “[#1840] Tx replacement support” under UNRELEASED Improvements.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Web3
  participant Node
  participant Mempool
  participant Consensus

  User->>Web3: sendTransaction(oldTx)
  Web3->>Node: eth_sendRawTransaction(oldTx)
  Node->>Mempool: enqueue oldTx (nonce N)
  User->>Web3: replace_transaction(oldTxHash, newTx)
  Web3->>Node: eth_replaceTransaction(...)
  Node->>Mempool: replace oldTx with newTx (same nonce, higher gasPrice)
  Mempool->>Consensus: propose newTx
  Consensus-->>User: receipt for newTx
Loading
sequenceDiagram
  participant Client
  participant Mempool
  participant AnteHandler
  participant AnteCache

  Client->>Mempool: CheckTx(tx)
  Mempool->>AnteHandler: run ante checks
  AnteHandler->>AnteCache: get(tx, mempoolMaxTxs)
  alt cache hit
    AnteCache-->>AnteHandler: result
  else cache miss
    AnteHandler->>AnteCache: put(tx, result)
  end
  AnteHandler-->>Mempool: validation result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • calvinaco
  • JayT106
  • mmsqe

Poem

I hopped through mempools, nonce by nonce,
Replaced a tx—swift, not once but once!
Ante cached my carrot stash,
Unordered hops in lightning flash.
New hash mined, I thump with glee—
A rabbit’s block, confirmed for me. 🥕✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1303c0a and 950c067.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • CHANGELOG.md (1 hunks)
  • app/app.go (5 hunks)
  • go.mod (1 hunks)
  • gomod2nix.toml (1 hunks)
  • integration_tests/test_basic.py (2 hunks)
  • integration_tests/utils.py (1 hunks)
  • nix/testground-cronosd.patch (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (4)
  • go.mod
  • gomod2nix.toml
  • nix/testground-cronosd.patch
  • integration_tests/utils.py
🧰 Additional context used
🧬 Code Graph Analysis (1)
integration_tests/test_basic.py (1)
integration_tests/utils.py (3)
  • get_account_nonce (454-456)
  • replace_transaction (465-469)
  • 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: build (macos-latest)
  • GitHub Check: unittest
  • GitHub Check: build (macos-14)
  • GitHub Check: gomod2nix
  • GitHub Check: integration_tests (gov)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: Analyze (go)
  • GitHub Check: Run golangci-lint
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (7)
integration_tests/test_basic.py (3)

28-28: Import addition looks good.

The import of get_account_nonce aligns with its usage in the new test function.


33-33: Import addition looks good.

The import of replace_transaction aligns with its usage in the new test function.


1035-1077: Test implementation is correct and comprehensive.

The test_tx_replacement function properly tests transaction replacement scenarios:

  • Successfully replaces an in-flight transaction with higher gas price
  • Verifies the replacement transaction is mined with correct values
  • Tests that already-mined transactions cannot be replaced
  • Confirms proper error handling

The test logic correctly uses the utility functions and validates both the success and failure cases.

app/app.go (4)

65-65: Cache import added correctly.

The import of "github.com/evmos/ethermint/ante/cache" is necessary for the AnteCache functionality.


383-383: Logging message improves observability.

The logging statement makes it clear when the priority mempool is enabled based on configuration.


390-390: Logging message improves observability.

The logging statement makes it clear when the no-op mempool is enabled.


968-968: Function signature updated correctly.

The mempoolMaxTxs parameter has been properly added to both the function call (Line 968) and function definition (Line 1043).

Also applies to: 1043-1043

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

This comment has been minimized.

Copy link

codecov bot commented Aug 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 35.79%. Comparing base (a3c2f70) to head (950c067).
⚠️ Report is 93 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #1840       +/-   ##
===========================================
+ Coverage   16.87%   35.79%   +18.91%     
===========================================
  Files          72      127       +55     
  Lines        6163    11812     +5649     
===========================================
+ Hits         1040     4228     +3188     
- Misses       5000     7161     +2161     
- 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.

@thomas-nguy thomas-nguy marked this pull request as ready for review August 7, 2025 23:38
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

🔭 Outside diff range comments (1)
app/app.go (1)

629-644: Add validation for query gas limit parameter.

The query gas limit is directly cast from app options without validation. Consider adding bounds checking to ensure it's within reasonable limits.

+    queryGasLimit := cast.ToUint64(appOpts.Get(server.FlagQueryGasLimit))
+    if queryGasLimit == 0 {
+        queryGasLimit = 50_000_000 // Set a default if not specified
+    }
     app.EvmKeeper = evmkeeper.NewKeeper(
         appCodec,
         keys[evmtypes.StoreKey], okeys[evmtypes.ObjectStoreKey], authtypes.NewModuleAddress(govtypes.ModuleName),
         app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.FeeMarketKeeper,
         tracer,
         evmS,
         []evmkeeper.CustomContractFn{
             func(_ sdk.Context, rules ethparams.Rules) vm.PrecompiledContract {
                 return cronosprecompiles.NewRelayerContract(app.IBCKeeper, appCodec, rules, app.Logger())
             },
             func(ctx sdk.Context, rules ethparams.Rules) vm.PrecompiledContract {
                 return cronosprecompiles.NewIcaContract(ctx, app.ICAControllerKeeper, &app.CronosKeeper, appCodec, gasConfig)
             },
         },
-        cast.ToUint64(appOpts.Get(server.FlagQueryGasLimit)),
+        queryGasLimit,
     )
🧹 Nitpick comments (1)
integration_tests/test_basic.py (1)

1035-1060: Consider adding more comprehensive test coverage for transaction replacement.

The test correctly verifies basic transaction replacement functionality. Consider enhancing it with:

  1. Explicit verification that the original transaction was replaced (compare transaction hashes)
  2. Negative test cases (e.g., replacement with insufficient gas price increase)
  3. Verification of the gas price in the final transaction

Example enhancement:

def test_tx_replacement(cronos):
    w3 = cronos.w3
    gas_price = w3.eth.gas_price
    nonce = get_account_nonce(w3)
    initial_balance = w3.eth.get_balance(ADDRS["community"])
-    txhash = replace_transaction(
+    result = replace_transaction(
        w3,
        {
            "to": ADDRS["community"],
            "value": 1,
            "gasPrice": gas_price,
            "nonce": nonce,
            "from": ADDRS["validator"],
        },
        {
            "to": ADDRS["community"],
            "value": 5,
            "gasPrice": gas_price * 2,
            "nonce": nonce,
            "from": ADDRS["validator"],
        },
        KEYS["validator"],
-    )["transactionHash"]
+    )
+    txhash = result["transactionHash"]
    tx1 = w3.eth.get_transaction(txhash)
    assert tx1["transactionIndex"] == 0
+    assert tx1["gasPrice"] == gas_price * 2, "Gas price should be doubled for replacement"
    assert w3.eth.get_balance(ADDRS["community"]) == initial_balance + 5
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 28bc916 and 1eb6732.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • app/app.go (5 hunks)
  • app/sim_test.go (1 hunks)
  • app/test_helpers.go (2 hunks)
  • go.mod (8 hunks)
  • gomod2nix.toml (14 hunks)
  • integration_tests/test_basic.py (2 hunks)
  • integration_tests/utils.py (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-10-08T19:00:42.142Z
Learnt from: yihuang
PR: crypto-org-chain/cronos#1618
File: memiavl/db_test.go:193-194
Timestamp: 2024-10-08T19:00:42.142Z
Learning: In Go version 1.21 and later, the `max` function is defined and available.

Applied to files:

  • gomod2nix.toml
  • go.mod
🧬 Code Graph Analysis (1)
integration_tests/utils.py (2)
integration_tests/network.py (1)
  • w3 (39-42)
integration_tests/cosmoscli.py (1)
  • address (302-312)
🔇 Additional comments (14)
gomod2nix.toml (3)

5-77: LGTM - Cosmos SDK dependency updates look good.

The cosmossdk.io module version bumps appear to be appropriate patch/minor version updates with corresponding hash changes. The addition of cosmossdk.io/schema v1.1.0 aligns with the broader codebase changes.


151-663: Verify the necessity of new performance-oriented dependencies.

Several new modules have been added that appear to be performance optimizations:

  • github.com/bytedance/sonic - High-performance JSON library
  • github.com/cloudwego/base64x - Optimized base64 encoding
  • github.com/klauspost/cpuid/v2 - CPU feature detection
  • github.com/twitchyliquid64/golang-asm - Assembly utilities

Please verify these dependencies are intentionally added and align with the project's performance optimization goals.


302-304: Verify personal ethermint fork in gomod2nix.toml

The replacement for the ethermint module has been updated in gomod2nix.toml (from lines 302–304) from the organization’s repo to a personal fork:

• File: gomod2nix.toml, lines 302–304
• New entries:

- replaced = "github.com/crypto-org-chain/ethermint"
+ replaced = "github.com/thomas-nguy/ethermint"
  version  = "v0.4.2-0.20250807144210-5566b126ea2e"
  hash     = "sha256-hzYos7zLb4zBhnnl03zxGEL/XYd92T4FMFM/c9HqCt4="

Please confirm:

  1. Is switching to the personal fork intentional (e.g., for testing or specific features)?
  2. What fixes or enhancements does this fork include?
  3. Do you plan to revert this to the official crypto-org-chain/ethermint repo before release?
go.mod (2)

8-47: LGTM - Standard dependency updates.

The direct dependency updates appear to be routine maintenance, including appropriate version bumps for cosmossdk.io modules and golang.org/x packages.


297-297: Critical: Justify Ethermint fork replacement

The ethermint module has been redirected from the organization’s upstream to a personal fork in both dependency manifests. Before approving, please confirm and document why this change is necessary:

• go.mod (line 297)

github.com/evmos/ethermint => github.com/thomas-nguy/ethermint v0.4.2-0.20250807144210-5566b126ea2e

• gomod2nix.toml (line 304)

replaced = "github.com/thomas-nguy/ethermint"

– What fixes or features does the personal fork provide over the official crypto-org-chain/ethermint release?
– Is the forked code under active maintenance, and will it be kept up-to-date with security patches?
– Can these changes be upstreamed or merged back into the main project?

Please add justification and consider whether this replacement should remain or be reverted to the canonical repository.

app/sim_test.go (1)

18-18: LGTM - Import path update aligns with architectural changes.

The import path change from app/ante to evmd/ante is consistent with the broader refactoring to consolidate EVM functionality into the evmd package structure.

app/test_helpers.go (1)

19-19: LGTM - Consistent import and usage update for evmd package.

The import path change and corresponding usage update (evmd.DefaultNodeHome) are consistent with the architectural refactoring to use the evmd package structure.

Also applies to: 73-73

integration_tests/utils.py (2)

454-456: LGTM - Clean and correct nonce retrieval utility.

The get_account_nonce function is well-implemented, using the standard w3.eth.get_transaction_count method with appropriate account derivation from the private key.


465-469: LGTM - Well-implemented transaction replacement utility.

The replace_transaction function correctly implements the transaction replacement flow:

  1. Signs and sends the original transaction to obtain its hash
  2. Uses w3.eth.replace_transaction with the old hash and new transaction
  3. Waits for the replacement transaction receipt

This implementation is appropriate for testing transaction replacement scenarios.

integration_tests/test_basic.py (1)

28-33: LGTM!

The new utility function imports are correctly placed and follow the existing import pattern.

app/app.go (4)

65-69: LGTM!

Import paths correctly updated to use the new evmd submodule structure, consistent with the refactoring objectives.


383-391: LGTM!

Good addition of logging statements for mempool configuration visibility. The SignerExtractor correctly migrated to use the evmd package.


1025-1036: LGTM!

Transaction executor setup correctly migrated to use evmd package executors while preserving the conditional logic for block-stm mode.


1070-1091: Unable to Locate AnteCache Implementation—Please Verify Memory Bounds

I wasn’t able to find the cache package or the NewAnteCache definition in the repo. Before landing this change, please manually confirm that the AnteCache you’re instantiating:

  • Has a configurable/bounded size (or sensible defaults)
  • Implements eviction or TTL to prevent unbounded memory growth
  • Includes any other resource‐management safeguards appropriate for long‐lived caches

@github-actions github-actions bot added the nix label Aug 8, 2025
Copy link

socket-security bot commented Aug 8, 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.20250812033036-79e177241f87 ⏵ v0.6.1-0.20250812061456-67a47478d69175 +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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1eb6732 and 5c65a46.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • app/app.go (7 hunks)
  • go.mod (8 hunks)
  • gomod2nix.toml (14 hunks)
  • nix/testground-cronosd.patch (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • go.mod
  • gomod2nix.toml
⏰ 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: Run golangci-lint
  • GitHub Check: gomod2nix
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: unittest
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (8)
nix/testground-cronosd.patch (1)

10-11: Review Testground ante handler divergence and cache sizing

  • UnsafeUnorderedTx is enabled here but remains unset in the default app/app.go. Please confirm this test-only divergence is intentional; otherwise align with the main handler or gate it behind a flag.
  • cache.NewAnteCache(mempoolMaxTxs) may receive a negative value (e.g. -1 in a NoOp mempool). Consider clamping or disabling the cache when inputs are negative to avoid unexpected behavior.

Suggested clamp pattern before building options:

effectiveMempoolMaxTxs := mempoolMaxTxs
if effectiveMempoolMaxTxs < 0 {
    // disable ante-cache when mempool size is negative
    effectiveMempoolMaxTxs = 0
}
// …
AnteCache:       cache.NewAnteCache(effectiveMempoolMaxTxs),
app/app.go (7)

65-70: Confirm ante/cache import path consistency with evmd reorg

You're importing:

  • evmante from github.com/evmos/ethermint/evmd/ante
  • cache from github.com/evmos/ethermint/ante/cache

If ante/cache also moved under evmd, adjust to evmd/ante/cache to avoid mismatched versions. If it remained at the root ante/, keep as-is. Please verify against the current Ethermint tree.

If needed:

-	"github.com/evmos/ethermint/ante/cache"
+	"github.com/evmos/ethermint/evmd/ante/cache"

115-115: LGTM: sdk mempool import

No issues spotted with switching to types/mempool.


383-388: Priority mempool + evmd signer extractor — confirm compatibility

Switching SignerExtractor to evmd.NewEthSignerExtractionAdapter should make the PriorityNonceMempool correctly extract account/nonce from Ethereum txs. Confirm it handles all supported tx types (legacy, EIP-1559, blob/4844 if enabled) and that priority ordering remains deterministic across rechecks.


390-392: LGTM: NoOp mempool branch logging

Good to have explicit logs; helps in diagnosing environment-specific behavior.


1034-1037: LGTM: switch to evmd Tx executors

STMTxExecutor/DefaultTxExecutor migration looks correct. Using GetStoreKeys() (sorted) is appropriate for deterministic key ordering.


1043-1043: Method signature change: ensure all call sites updated

setAnteHandler now requires mempoolMaxTxs. All internal callers appear updated here; verify any test helpers or app variants (e.g., sim/test helpers) also pass the new arg.


643-644: Confirm safe handling of zero query gas limit in EVM keeper

I wasn’t able to locate the EVM keeper implementation in this repo’s code to verify how a zero value is treated. Please ensure that passing

cast.ToUint64(appOpts.Get(server.FlagQueryGasLimit))

into evmkeeper.NewKeeper(...) with a value of 0 is interpreted as “no cap” or otherwise safe. If a zero value would disable queries or underflow gas accounting, add a guard and default, for example:

qgl := cast.ToUint64(appOpts.Get(server.FlagQueryGasLimit))
if qgl == 0 {
    qgl = evmtypes.DefaultQueryGasLimit
}
app.EvmKeeper = evmkeeper.NewKeeper(…, qgl)

• Location: app/app.go:643–644

@thomas-nguy thomas-nguy force-pushed the thomas/support-tx-replacement branch from 1303c0a to 8c6551d Compare August 12, 2025 07:14
@thomas-nguy thomas-nguy added this pull request to the merge queue Aug 12, 2025
Merged via the queue into crypto-org-chain:main with commit 842c681 Aug 12, 2025
46 checks passed
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.

2 participants