Skip to content

Conversation

@almk-dev
Copy link
Member

@almk-dev almk-dev commented Oct 9, 2025

Description

  • Moves out the mempool configurations into a separate helper in evmd/mempool.go
  • Expose mempool configuration flags and sets them in the evmd app.go mempool configuration helper

Closes: APPS-9
Closes: STACK-1519


Author Checklist

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

consolidates these constants into one file in /config
the test was using a duplicate eips multiplier value instead of the global one moved to config
app options is removed from new app creation.

however, we're getting a recovered panic on *restarting* the chain due to prepareproposal running before preblocker:

+0x120\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).PrepareProposal.func1()\n\tgithub.com/cosmos/[email protected]/baseapp/abci.go:433 +0x38\npanic({0x1061c8160?, 0x10912faa0?})\n\truntime/panic.go:783 +0x120\ngithub.com/cosmos/evm/x/vm/types.GetEVMCoinDecimals(...)\n\tgithub.com/cosmos/[email protected]/x/vm/types/denom_config.go:61\ngithub.com/cosmos/evm/x/vm/types.ConvertAmountTo18DecimalsLegacy(...)\n\tgithub.com/cosmos/[email protected]/x/vm/types/scaling.go:17\ngithub.com/cosmos/evm/x/vm/wrappers.FeeMarketWrapper.GetBaseFee({{_, _}}, {{0x10698a810, 0x109225540}, {0x1069b51c0, 0x14001f4c200}, {{0x0, 0x0}, {0x16dc0f689, 0x4}, ...}, ...})\n\tgithub.com/cosmos/[email protected]/x/vm/wrappers/feemarket.go:38 +0x68\ngithub.com/cosmos/evm/x/vm/keeper.Keeper.GetBaseFee({{0x1069b4890, 0x14001eddeb0}, {0x10695e0b0, 0x14003560450}, {0x10695e240, 0x14003560490}, 0x140035637a0, {0x1400189d3e0, 0x14, 0x20}, ...}, ...)\n\tgithub.com/cosmos/[email protected]/x/vm/keeper/keeper.go:355 +0xe4\ngithub.com/cosmos/evm/mempool.(*ExperimentalEVMMempool).getIterators(0x14003cbd180, {0x10698a848?, 0x14002c39c08?}, {0x109225540, 0x0, 0x0})\n\tgithub.com/cosmos/[email protected]/mempool/mempool.go:439 +0x20c\ngithub.com/cosmos/evm/mempool.(*ExperimentalEVMMempool).SelectBy(0x14003cbd180, {0x10698a848?, 0x14002c39c08?}, {0x109225540?, 0x14000085ce8?, 0x104cce034?}, 0x140044cd540)\n\tgithub.com/cosmos/[email protected]/mempool/mempool.go:370 +0xe0\ngithub.com/cosmos/cosmos-sdk/types/mempool.SelectBy({0x10698a848?, 0x14002c39c08?}, {0x10698b108?, 0x14003cbd180?}, {0x109225540?, 0x0?, 0x0?}, 0x140044cd540)\n\tgithub.com/cosmos/[email protected]/types/mempool/mempool.go:58 +0xa0\ngithub.com/cosmos/evm/evmd.NewExampleApp.(*DefaultProposalHandler).PrepareProposalHandler.func3({{0x10698a810, 0x109225540}, {0x1069b51c0, 0x14001f4c200}, {{0x0, 0x0}, {0x16dc0f689, 0x4}, 0xd, {0x3507e5b0, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/[email protected]/baseapp/abci_utils.go:294 +0x250\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).PrepareProposal(0x14002d32488, 0x140015f42c0)\n\tgithub.com/cosmos/[email protected]/baseapp/abci.go:439
the mempool needed the global variable, but that wasn't set, so we set it in the vm keeper storage and use it from there in the mempool

everything else still uses the global variable, but we now have a foundation to move it over to the state storage
we were getting the 6 decimal balance when we were operating in 18-balance territory. now that we have a separation in the ibc tests, we should check balances accordingly
@almk-dev almk-dev requested a review from vladjdk October 9, 2025 19:17
@almk-dev almk-dev force-pushed the abdul/refactor-mempool-config branch from dc8fcf1 to 2bc131d Compare October 10, 2025 14:20
Copy link
Member

@vladjdk vladjdk left a comment

Choose a reason for hiding this comment

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

LGTM. Left a couple questions

@vladjdk vladjdk enabled auto-merge October 14, 2025 01:44
@cloudgray cloudgray closed this Oct 14, 2025
auto-merge was automatically disabled October 14, 2025 01:53

Pull request was closed

@cloudgray cloudgray deleted the abdul/refactor-mempool-config branch October 14, 2025 01:53
@vladjdk vladjdk restored the abdul/refactor-mempool-config branch October 14, 2025 02:32
@vladjdk vladjdk reopened this Oct 14, 2025
@vladjdk vladjdk enabled auto-merge October 14, 2025 02:32
@vladjdk vladjdk added this pull request to the merge queue Oct 14, 2025
Merged via the queue into main with commit 04ce2e1 Oct 14, 2025
39 checks passed
@vladjdk vladjdk deleted the abdul/refactor-mempool-config branch October 14, 2025 02:51
zsystm pushed a commit to zsystm/evm that referenced this pull request Nov 2, 2025
… app configuration to helper (cosmos#698)

* move tests to remove circular dependency

* remove ante2

* wip: move all config files out of evmd

* wip: add todos

* reset config to fix test

* fix evmd tests by adding resets to the evmappoptions

* remove testutil/config constants

consolidates these constants into one file in /config

* fix eips test

the test was using a duplicate eips multiplier value instead of the global one moved to config

* remove all configs except for genesis from testutil/config and consolidate into /config

* changelogchangelogchangelogchangelogchangelog

* lints

* wip: removing app options (tests failing)

app options is removed from new app creation.

however, we're getting a recovered panic on *restarting* the chain due to prepareproposal running before preblocker:

+0x120\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).PrepareProposal.func1()\n\tgithub.com/cosmos/[email protected]/baseapp/abci.go:433 +0x38\npanic({0x1061c8160?, 0x10912faa0?})\n\truntime/panic.go:783 +0x120\ngithub.com/cosmos/evm/x/vm/types.GetEVMCoinDecimals(...)\n\tgithub.com/cosmos/[email protected]/x/vm/types/denom_config.go:61\ngithub.com/cosmos/evm/x/vm/types.ConvertAmountTo18DecimalsLegacy(...)\n\tgithub.com/cosmos/[email protected]/x/vm/types/scaling.go:17\ngithub.com/cosmos/evm/x/vm/wrappers.FeeMarketWrapper.GetBaseFee({{_, _}}, {{0x10698a810, 0x109225540}, {0x1069b51c0, 0x14001f4c200}, {{0x0, 0x0}, {0x16dc0f689, 0x4}, ...}, ...})\n\tgithub.com/cosmos/[email protected]/x/vm/wrappers/feemarket.go:38 +0x68\ngithub.com/cosmos/evm/x/vm/keeper.Keeper.GetBaseFee({{0x1069b4890, 0x14001eddeb0}, {0x10695e0b0, 0x14003560450}, {0x10695e240, 0x14003560490}, 0x140035637a0, {0x1400189d3e0, 0x14, 0x20}, ...}, ...)\n\tgithub.com/cosmos/[email protected]/x/vm/keeper/keeper.go:355 +0xe4\ngithub.com/cosmos/evm/mempool.(*ExperimentalEVMMempool).getIterators(0x14003cbd180, {0x10698a848?, 0x14002c39c08?}, {0x109225540, 0x0, 0x0})\n\tgithub.com/cosmos/[email protected]/mempool/mempool.go:439 +0x20c\ngithub.com/cosmos/evm/mempool.(*ExperimentalEVMMempool).SelectBy(0x14003cbd180, {0x10698a848?, 0x14002c39c08?}, {0x109225540?, 0x14000085ce8?, 0x104cce034?}, 0x140044cd540)\n\tgithub.com/cosmos/[email protected]/mempool/mempool.go:370 +0xe0\ngithub.com/cosmos/cosmos-sdk/types/mempool.SelectBy({0x10698a848?, 0x14002c39c08?}, {0x10698b108?, 0x14003cbd180?}, {0x109225540?, 0x0?, 0x0?}, 0x140044cd540)\n\tgithub.com/cosmos/[email protected]/types/mempool/mempool.go:58 +0xa0\ngithub.com/cosmos/evm/evmd.NewExampleApp.(*DefaultProposalHandler).PrepareProposalHandler.func3({{0x10698a810, 0x109225540}, {0x1069b51c0, 0x14001f4c200}, {{0x0, 0x0}, {0x16dc0f689, 0x4}, 0xd, {0x3507e5b0, ...}, ...}, ...}, ...)\n\tgithub.com/cosmos/[email protected]/baseapp/abci_utils.go:294 +0x250\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).PrepareProposal(0x14002d32488, 0x140015f42c0)\n\tgithub.com/cosmos/[email protected]/baseapp/abci.go:439

* begin storing coin info in the vm keeper storage

the mempool needed the global variable, but that wasn't set, so we set it in the vm keeper storage and use it from there in the mempool

everything else still uses the global variable, but we now have a foundation to move it over to the state storage

* remove debugging artifact

* artifact removal 2

* fix unit tests

* wip: fix ibc testing

* delete all evmappoptions from tests

* fix ibc precompile integration test balance getters

we were getting the 6 decimal balance when we were operating in 18-balance territory. now that we have a separation in the ibc tests, we should check balances accordingly

* fix all evmd tests

* fix precisebank keeper test

* fix smore tests

* lol

* add upgrade handler

* lints

* changelog

* Fix imports, add upgrade for non-18-decimal chains, and add migration guide

* fix system test

* Update docs/migrations/v0.4.0_to_v0.5.0_UNRELEASED.md

Co-authored-by: Abdul Malek <[email protected]>

* fix monodecorator test

* Remove test* denoms and replace with default*

* extract var

* match vars

* remove chain config from configurator

* undo uint8 change

* comment fixes

* Auto stash before merge of "vlad/remove-app-options" and "origin/main"

* set chain config in vm integ tests

* lint

* fix error on test

* fix denoms for ibc chain

* add mempool config helper

* Revert "fix denoms for ibc chain"

This reverts commit 6911bde435645c9a8476518a3dd1f1cb1f0b88b6.

* add mempool config helper

* use app options chain id instead of passing param

* lints

* revert make race

* add changelog

* expore legacy fields

* use default config

* add mempool config helper

* add changelog

* expore legacy fields

* use default config

* fix tests

* clean up config creator

* get rid of obvious comments

* fix lint

* add bindings

* unbounded txs

* add max txs flag binding

* set to int

* add mempool config to docs

* max-txs param in eip tests

---------

Co-authored-by: Vlad <[email protected]>
Co-authored-by: Alex | Cosmos Labs <[email protected]>
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.

5 participants