Skip to content

Disable EVM mempool#175

Merged
Thaleszh merged 23 commits into
mainfrom
fix/mempool-block-gas-from-flag
Dec 11, 2025
Merged

Disable EVM mempool#175
Thaleszh merged 23 commits into
mainfrom
fix/mempool-block-gas-from-flag

Conversation

@Thaleszh

@Thaleszh Thaleszh commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Description

The EVM mempool is currently bugged, its broadcast failing to public nodes.
The workarounds we tried only led to further issues in the broadcasting.

Type of change

  • Bugfix

How Has This Been Tested?

unit and e2e tests

@Thaleszh Thaleszh requested a review from jhelison as a code owner December 3, 2025 14:34
@coderabbitai

coderabbitai Bot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Inline EVM mempool setup was removed from NewKiichainApp and replaced by a disabled code path with explanatory comments. A new method, KiichainApp.SetupEVMMempool, was added in app/evm_mempool.go that builds an EVMMempoolConfig (using the app AnteHandler and a BlockGasLimit), creates an ExperimentalEVMMempool, assigns it to app.EVMMempool, sets the global mempool and app mempool, registers a CheckTx handler, and installs an ABCI prepare-proposal handler with an Ethereum signer adapter chain. CHANGELOG.md marks the mempool disabled (UNRELEASED). Several tests and docs were updated to disable or document the mempool-related tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Inspect app/evm_mempool.go: validate EVMMempoolConfig composition, ExperimentalEVMMempool construction, logger/context usage, and panic-on-error behavior for global mempool setting.
  • Verify wiring in KiichainApp: assignment to app.EVMMempool, call to app.SetMempool, and CheckTx handler registration.
  • Review ABCI prepare-proposal handler creation and Ethereum signer adapter chain integration.
  • Confirm NewKiichainApp changes: removed inline mempool setup and presence/clarity of disabled code/comments.
  • Check tests/docs updates: ensure commented-out tests and changelog accurately reflect behavior.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Disable EVM mempool' directly summarizes the main change—disabling the EVM mempool due to a bug—and is consistent with all the modifications across the codebase.
Description check ✅ Passed The description clearly explains the reason for the changes (broadcast failures to public nodes and failed workarounds) and identifies this as a bugfix, directly relating to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/mempool-block-gas-from-flag

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
app/evm_mempool.go (1)

29-35: Consider logging when global mempool is already set.

When GetGlobalEVMMempool() is not nil, the code silently skips setting the global mempool. This could lead to a subtle mismatch where the app's EVMMempool differs from the global one. Consider adding a debug log or warning when this condition occurs.

 	// Set the global mempool for RPC access
 	if evmmempool.GetGlobalEVMMempool() == nil {
 		if err := evmmempool.SetGlobalEVMMempool(evmMempool); err != nil {
 			panic(err)
 		}
+	} else {
+		logger.Debug("global EVM mempool already set, skipping")
 	}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d52338 and 299d70b.

📒 Files selected for processing (2)
  • app/app.go (1 hunks)
  • app/evm_mempool.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (5)
  • GitHub Check: tests
  • GitHub Check: Analyze
  • GitHub Check: golangci-lint
  • GitHub Check: liveness-test
  • GitHub Check: test-e2e
🔇 Additional comments (3)
app/app.go (1)

279-282: LGTM!

Clean refactoring that extracts the EVM mempool setup into a dedicated method, improving code organization while maintaining the existing conditional guard.

app/evm_mempool.go (2)

36-42: LGTM!

The mempool, CheckTxHandler, and ABCI proposal handler setup follows the expected wiring pattern.


80-94: LGTM!

The bounds checking, safe cast with the #nosec annotation, and debug logging are well implemented.

Comment thread app/evm_mempool.go Outdated
Comment thread app/evm_mempool.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/evm_mempool.go (1)

31-35: Potential TOCTOU race on global mempool initialization.

The check-then-set pattern between GetGlobalEVMMempool() and SetGlobalEVMMempool() is not atomic. If SetupEVMMempool is called concurrently (unlikely but possible in testing scenarios), a race condition could occur. Since this is initialization-time code typically called once, the practical risk is low.

Consider if the evmmempool package provides an atomic "set if nil" operation. If not and concurrent initialization is a concern, you could add synchronization or rely on SetGlobalEVMMempool to handle the "already set" case gracefully:

-	if evmmempool.GetGlobalEVMMempool() == nil {
-		if err := evmmempool.SetGlobalEVMMempool(evmMempool); err != nil {
-			panic(err)
-		}
+	if err := evmmempool.SetGlobalEVMMempool(evmMempool); err != nil {
+		// Only panic if not already set
+		if evmmempool.GetGlobalEVMMempool() == nil {
+			panic(err)
+		}
 	}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 75fe12b and 281937f.

📒 Files selected for processing (1)
  • app/evm_mempool.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (4)
  • GitHub Check: tests
  • GitHub Check: test-e2e
  • GitHub Check: golangci-lint
  • GitHub Check: Analyze
🔇 Additional comments (2)
app/evm_mempool.go (2)

1-18: LGTM!

The imports are well-organized and all appear to be utilized by the implementation.


47-51: LGTM on the fix for maxGas == -1 handling.

The previous review flagged that the log message said "using max uint64" but the code returned 0. This has been correctly fixed to return math.MaxUint64.

Comment thread app/evm_mempool.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
app/evm_mempool.go (1)

47-97: Genesis-based block gas limit handling is consistent and fixes prior edge cases.

The new GetBlockGasLimit logic:

  • Uses defaultBlockGasLimit for all configuration/genesis read failures and for invalid max_gas < -1.
  • Correctly maps max_gas == -1 to math.MaxUint64 for “unlimited” and logs that explicitly.
  • Safely casts non-negative max_gas to uint64 after validation.

This is consistent, avoids silent “zero gas” behavior, and matches the documented semantics. Only very minor nit (optional): you could log the actual defaultBlockGasLimit value in the error paths for easier observability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 281937f and 3c06b58.

📒 Files selected for processing (1)
  • app/evm_mempool.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (4)
  • GitHub Check: Analyze
  • GitHub Check: tests
  • GitHub Check: golangci-lint
  • GitHub Check: test-e2e
🔇 Additional comments (2)
app/evm_mempool.go (2)

20-27: Default gas limit and config construction look reasonable.

Using a single defaultBlockGasLimit and feeding BlockGasLimit: GetBlockGasLimit(appOpts, logger) into EVMMempoolConfig gives a clear, centralized control point for the limit. No functional issues spotted here.


22-45: EVM mempool wiring and ABCI handlers look correct and cohesive.

The setup cleanly:

  • Instantiates the experimental EVM mempool once.
  • Sets the global mempool only if none exists.
  • Registers it as the app mempool, CheckTx handler, and PrepareProposal handler with the Ethereum signer adapter.

This centralizes EVM mempool initialization and keeps the app wiring straightforward.

@codecov

codecov Bot commented Dec 3, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
app/evm_mempool.go 0.00% 15 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
app/evm_mempool.go (1)

58-58: Fix function name in comment.

The comment says "getBlockGasLimit" but the actual function is "fetchBlockGasLimit".

Apply this diff to fix the typo:

-// getBlockGasLimit reads the genesis json file using AppGenesisFromFile
+// fetchBlockGasLimit reads the genesis json file using AppGenesisFromFile
 // to extract the consensus block gas limit before InitChain is called.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3c06b58 and 782dc6a.

📒 Files selected for processing (2)
  • app/evm_mempool.go (1 hunks)
  • tests/integration/failing-tests.md (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (4)
  • GitHub Check: tests
  • GitHub Check: test-e2e
  • GitHub Check: Analyze
  • GitHub Check: golangci-lint
🔇 Additional comments (5)
tests/integration/failing-tests.md (1)

29-29: LGTM! Improved test status documentation.

The updated description provides clearer, more specific information about the mempool test failures, which is helpful for tracking progress.

app/evm_mempool.go (4)

1-20: LGTM! Clean imports and reasonable default.

The package structure and imports are appropriate. The default block gas limit of 100 million gas is a reasonable fallback value for EVM chains.


22-45: LGTM! Proper mempool initialization.

The method correctly sets up the EVM mempool with all necessary components:

  • Configuration with AnteHandler and block gas limit
  • Global mempool registration with appropriate panic on error (correct for initialization)
  • CheckTx and PrepareProposal handlers with Ethereum signer adapter

47-56: LGTM! Clean wrapper with default fallback.

The wrapper correctly applies the default block gas limit when fetchBlockGasLimit returns 0 (which happens on all error paths). This provides a safe and consistent fallback behavior.


60-108: LGTM! Previous critical issues are now resolved.

The implementation correctly handles all edge cases:

  • Consistent error handling: all error paths return 0, which triggers the default block gas limit
  • Unlimited gas (-1) properly mapped to math.MaxUint64 with appropriate warning
  • Invalid values (< -1) properly rejected
  • Safe integer cast with justified security comment
  • Appropriate logging levels throughout

The previous critical and major issues flagged in earlier reviews have been properly addressed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
app/evm_mempool.go (2)

20-45: EVMMempool wiring looks solid; consider surfacing final gas limit for observability.

The SetupEVMMempool path (AnteHandler wiring, global mempool registration, CheckTx, and PrepareProposal) looks consistent and self-contained. As a minor improvement, consider logging the final resolved BlockGasLimit once here (in addition to the genesis debug log) so operators can see exactly what limit the mempool is using at startup, especially when the default fallback is applied.


59-72: Clarify helper comment and logs vs sentinel behavior.

Two small nits here:

  • The comment above fetchBlockGasLimit still refers to getBlockGasLimit, which can be confusing when scanning the file.
  • The error logs say “using default block gas limit” but the function actually returns 0 as a sentinel, with the actual default applied only in getBlockGasLimit; if this helper is ever reused directly, those messages could mislead. Consider either returning defaultBlockGasLimit here or adjusting the log text (e.g., “returning 0; caller will fall back to default block gas limit”) to reflect the real behavior.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 782dc6a and 83a0989.

📒 Files selected for processing (1)
  • app/evm_mempool.go (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). (4)
  • GitHub Check: test-e2e
  • GitHub Check: tests
  • GitHub Check: golangci-lint
  • GitHub Check: Analyze
🔇 Additional comments (1)
app/evm_mempool.go (1)

47-57: Fallback wrapper around genesis read is clear and consistent.

getBlockGasLimit cleanly centralizes the “0 → defaultBlockGasLimit” behavior, so callers don’t need to understand the sentinel value from fetchBlockGasLimit. This looks good and keeps the error-path semantics consistent.

Comment thread app/evm_mempool.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
app/evm_mempool.go (2)

14-17: Clarify appOpts usage vs. block gas limit configuration.

SetupEVMMempool accepts appOpts but doesn’t use it, and EVMMempoolConfig is only populated with AnteHandler. Given the PR description about taking the block gas limit from genesis, it’s a bit hard to see from this function where that value is actually injected into the EVM mempool now.

If the block gas limit is configured elsewhere (e.g., inside EVMKeeper or another helper that this function indirectly uses), it might be worth adding a brief comment here indicating that appOpts is intentionally unused and that block gas wiring happens in <component>. If instead the intent was to drive mempool config from appOpts (e.g., via a BlockGasLimit field on EVMMempoolConfig), consider either wiring it here or removing appOpts from the signature to avoid confusion.

If you intend to keep appOpts for future configuration, you could also document that with a short comment, or wire it through to wherever the genesis block gas limit is currently read, so the PR behavior matches its description.


23-27: Consider logging when the global EVMMempool is already set.

Right now, if GetGlobalEVMMempool() is non-nil, SetupEVMMempool silently skips SetGlobalEVMMempool but still replaces app.EVMMempool. In multi-app or multi-test-process scenarios this can make it tricky to see that the global and per-app mempools differ.

Consider adding an else branch with a debug/warn log explaining that the global EVM mempool was already initialized and won’t be replaced, so operators and test writers can more easily diagnose any surprising behavior.

Example sketch:

	if evmmempool.GetGlobalEVMMempool() == nil {
		if err := evmmempool.SetGlobalEVMMempool(evmMempool); err != nil {
			panic(err)
		}
+	} else {
+		logger.Debug("global EVM mempool already initialized; skipping SetGlobalEVMMempool")
	}

Please double-check SetGlobalEVMMempool’s semantics in your github.com/cosmos/evm version to ensure that logging (without attempting to reset the global) is the right behavior for repeated initializations.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83a0989 and 3847246.

📒 Files selected for processing (1)
  • app/evm_mempool.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (5)
  • GitHub Check: tests
  • GitHub Check: test-e2e
  • GitHub Check: Analyze
  • GitHub Check: liveness-test
  • GitHub Check: golangci-lint
🔇 Additional comments (1)
app/evm_mempool.go (1)

15-21: EVMMempool wiring and ABCI handlers look consistent.

The sequence of creating EVMMempoolConfig, instantiating NewExperimentalEVMMempool, setting it as the app’s mempool, wiring NewCheckTxHandler, and registering NewDefaultProposalHandler with the Ethereum signer adapter is coherent and matches the expected Cosmos/EVM integration pattern. Assuming the evmmempool APIs for your pinned version (v0.4.2) haven’t changed, this setup looks correct.

To be safe, please re-run your build/tests against the exact github.com/cosmos/evm version in go.mod to confirm the NewExperimentalEVMMempool, NewCheckTxHandler, and NewEthSignerExtractionAdapter signatures still match.

Also applies to: 28-30, 32-34

@Thaleszh Thaleszh changed the title EVM Mempool use block gas limit from genesis Use custom EVM Mempool broadcast TX Dec 10, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/evm_mempool.go (1)

46-46: Track the TODO for removing temporary workaround.

The comment indicates this function is a temporary workaround until the EVM module provides a fix.

Would you like me to create a tracking issue for removing this workaround once the upstream EVM fix is available?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77c8715 and 5299805.

📒 Files selected for processing (1)
  • app/evm_mempool.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (5)
  • GitHub Check: tests
  • GitHub Check: Analyze
  • GitHub Check: test-e2e
  • GitHub Check: golangci-lint
  • GitHub Check: liveness-test
🔇 Additional comments (2)
app/evm_mempool.go (2)

19-19: Remove unused appOpts parameter or implement legitimate gas configuration.

The appOpts parameter is declared but never used in SetupEVMMempool. Either remove it from the function signature if it's not needed, or implement a valid use case. Note that block gas limit validation appears to be handled via ante decorators (e.g., evmante.CheckBlockGasLimit in x/feeabstraction/ante/evm/mono_decorator.go) rather than through mempool configuration.

Likely an incorrect or invalid review comment.


25-25: Remove this review comment—the concern is incorrect.

app.clientCtx is uninitialized during SetupEVMMempool, but the callback that uses it (broadcastEVMTransactions) is only invoked during block proposal/execution, which occurs after server startup completes and RegisterTendermintService has set the client context. No guard or fix is needed.

Comment thread app/evm_mempool.go Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
app/evm_mempool.go (1)

48-71: broadcastEVMTransactions implementation is sound; optional improvements only.

  • For cosmos/evm v0.4.x, MsgEthereumTx.FromEthereumTx(tx *ethtypes.Transaction) does not return an error, so calling it without error handling is correct and the earlier review concern about a missing error check does not apply. (pkg.go.dev)
  • The error handling for SetMsgs, tx encoding, BroadcastTxSync, and non‑zero response codes is clear and should make mempool broadcast failures easy to diagnose.
  • If you ever want more resilience, you could log and continue on per‑tx failures instead of aborting the whole batch on the first error, but that’s a design choice and not required for this bugfix.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5299805 and d1c98ad.

📒 Files selected for processing (2)
  • CHANGELOG.md (1 hunks)
  • app/evm_mempool.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.md
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (4)
  • GitHub Check: tests
  • GitHub Check: test-e2e
  • GitHub Check: golangci-lint
  • GitHub Check: Analyze
🔇 Additional comments (1)
app/evm_mempool.go (1)

18-42: EVMMempool wiring looks correct and matches Cosmos EVM integration pattern.

Configuring EVMMempoolConfig with AnteHandler, BlockGasLimit: 100_000_000, and a custom BroadCastTxFn, then wiring NewExperimentalEVMMempool, SetMempool, NewCheckTxHandler, and NewDefaultProposalHandler aligns with the v0.4.x mempool integration guide and should be safe for production use. (docs.cosmos.network)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
app/evm_mempool.go (1)

50-51: Add error handling for FromEthereumTx call.

The return value from msg.FromEthereumTx(ethTx) is ignored. If this method returns an error (e.g., due to invalid transaction data or signature issues), the msg could be in an invalid state, causing silent failures in subsequent operations like SetMsgs, encoding, or broadcasting.

Apply this diff to add error handling:

 	for _, ethTx := range ethTxs {
 		msg := &evmtypes.MsgEthereumTx{}
-		msg.FromEthereumTx(ethTx)
+		if err := msg.FromEthereumTx(ethTx); err != nil {
+			return fmt.Errorf("failed to convert Ethereum tx %s: %w", ethTx.Hash().Hex(), err)
+		}
🧹 Nitpick comments (1)
app/evm_mempool.go (1)

47-47: TODO indicates temporary workaround—consider tracking.

The comment suggests this function should be removed once the EVM module provides a fix. Consider creating a tracking issue to ensure this technical debt is addressed when the upstream fix is available.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d1c98ad and 4813d10.

📒 Files selected for processing (1)
  • app/evm_mempool.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (5)
  • GitHub Check: tests
  • GitHub Check: Analyze
  • GitHub Check: golangci-lint
  • GitHub Check: test-e2e
  • GitHub Check: liveness-test
🔇 Additional comments (4)
app/evm_mempool.go (4)

1-16: LGTM: Imports are clean and appropriate.

All imports are necessary and properly organized for the EVM mempool setup and transaction broadcasting functionality.


29-34: LGTM: Appropriate global mempool initialization with fail-fast behavior.

The defensive nil check before setting the global mempool and the panic on error are appropriate for application initialization. This ensures the app fails fast if mempool setup is incorrect.


53-69: LGTM: Comprehensive error handling for transaction building and broadcasting.

The error handling for transaction building (lines 54-56), encoding (lines 58-61), and broadcasting (lines 63-69) is thorough and includes helpful context in error messages. The check for non-zero response codes is particularly good practice.


26-26: Remove the concern about clientCtx initialization in SetupEVMMempool.

The clientCtx is passed to NewExperimentalEVMMempool during app construction (when it's still zero-valued), but it's only actually used at runtime in broadcastEVMTransactions. By that time, RegisterTendermintService will have already initialized app.clientCtx via SetClientCtx. This initialization pattern is safe.

Comment thread app/evm_mempool.go
@jhelison jhelison force-pushed the fix/mempool-block-gas-from-flag branch from 4813d10 to f21712f Compare December 10, 2025 23:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
app/evm_mempool.go (2)

48-74: Solid broadcast flow; consider minor efficiency and diagnostics tweaks.

The conversion → build → encode → BroadcastTxSync pipeline and error handling look good. Two optional nits:

  • Compute the Ethereum signer once outside the loop to avoid redundant work.
  • Include the tx hash in all error messages (build/encode) to ease debugging when processing batches.

For example:

-func (app *KiichainApp) broadcastEVMTransactions(ethTxs []*ethtypes.Transaction) error {
-	for _, ethTx := range ethTxs {
-		msg := &evmtypes.MsgEthereumTx{}
-		ethSigner := ethtypes.LatestSigner(evmtypes.GetEthChainConfig())
+func (app *KiichainApp) broadcastEVMTransactions(ethTxs []*ethtypes.Transaction) error {
+	ethSigner := ethtypes.LatestSigner(evmtypes.GetEthChainConfig())
+	for _, ethTx := range ethTxs {
+		msg := &evmtypes.MsgEthereumTx{}
@@
-		cosmosTx, err := msg.BuildTx(app.clientCtx.TxConfig.NewTxBuilder(), "akii")
+		cosmosTx, err := msg.BuildTx(app.clientCtx.TxConfig.NewTxBuilder(), "akii")
 		if err != nil {
-			return fmt.Errorf("failed to build cosmos tx: %w", err)
+			return fmt.Errorf("failed to build cosmos tx for %s: %w", ethTx.Hash().Hex(), err)
 		}
@@
-		txBytes, err := app.clientCtx.TxConfig.TxEncoder()(cosmosTx)
+		txBytes, err := app.clientCtx.TxConfig.TxEncoder()(cosmosTx)
 		if err != nil {
-			return fmt.Errorf("failed to encode transaction: %w", err)
+			return fmt.Errorf("failed to encode transaction %s: %w", ethTx.Hash().Hex(), err)
 		}

These are non-blocking improvements; current behavior is fine functionally.

If you want to double-check behavior, you can add a small test that feeds multiple ethTxs and asserts that failures are surfaced with the expected hash context.


19-42: Use blank identifier for unused appOpts parameter.

The appOpts parameter is not used in this function. While Go allows unused function parameters (they don't cause compilation errors), it's good practice to mark intentionally unused parameters with the blank identifier _ to improve code clarity and satisfy linters. Apply this change if you don't plan to use appOpts for configuration in the near future:

-func (app *KiichainApp) SetupEVMMempool(appOpts servertypes.AppOptions, logger log.Logger) {
+func (app *KiichainApp) SetupEVMMempool(_ servertypes.AppOptions, logger log.Logger) {
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4813d10 and f21712f.

📒 Files selected for processing (1)
  • app/evm_mempool.go (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
app/evm_mempool.go (1)
app/app.go (1)
  • KiichainApp (94-114)
⏰ 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). (4)
  • GitHub Check: golangci-lint
  • GitHub Check: test-e2e
  • GitHub Check: tests
  • GitHub Check: Analyze

@Thaleszh Thaleszh changed the title Use custom EVM Mempool broadcast TX Disable EVM mempool Dec 11, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
tests/e2e/e2e_test.go (1)

166-167: Clarify and track the disabled mempool EVM test

The inline comment is easy to overlook. It would help future maintainers if this explicitly reads as a TODO and points to the underlying bug/PR so it’s obvious when and how to re‑enable.

For example:

-	// Disabled until mempool bug is fixed
-	// s.testMempoolEVM(jsonRPC)
+	// TODO: Re-enable once the EVM mempool bug is fixed (see PR #175).
+	// s.testMempoolEVM(jsonRPC)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c7b0a1 and 99aa8dd.

📒 Files selected for processing (1)
  • tests/e2e/e2e_test.go (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). (4)
  • GitHub Check: tests
  • GitHub Check: golangci-lint
  • GitHub Check: test-e2e
  • GitHub Check: Analyze

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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)
tests/e2e/e2e_evm_test.go (1)

106-152: Prefer a skipping test over fully commented-out code

Instead of commenting out the entire testMempoolEVM function, consider keeping the test and immediately calling s.T().Skip("disabled while EVM mempool is off due to bug, see PR #175"). That way:

  • The test remains visible in go test output as “skipped” rather than silently disappearing.
  • The code continues to compile against evolving APIs, reducing bit-rot and easing future re‑enablement.

Example:

-// Disabled until EVM mempool is enabled again
-// // testMempoolEVM Tests EVM's mempool
-// func (s *IntegrationTestSuite) testMempoolEVM(jsonRPC string) {
-// 	...
-// }
+// testMempoolEVM Tests EVM's mempool (currently disabled until EVM mempool is enabled again).
+func (s *IntegrationTestSuite) testMempoolEVM(jsonRPC string) {
+	s.T().Skip("disabled while EVM mempool is off due to bug, see PR #175")
+	// TODO: restore original mempool test logic when EVM mempool is re-enabled.
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99aa8dd and e41e15f.

📒 Files selected for processing (1)
  • tests/e2e/e2e_evm_test.go (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). (4)
  • GitHub Check: tests
  • GitHub Check: test-e2e
  • GitHub Check: golangci-lint
  • GitHub Check: Analyze

@Thaleszh Thaleszh merged commit 79bdc96 into main Dec 11, 2025
8 of 9 checks passed
@Thaleszh Thaleszh deleted the fix/mempool-block-gas-from-flag branch December 11, 2025 22:08
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