You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(config): Expose mempool configuration flags and move mempool app configuration to helper (#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 cbbaa44.
* 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]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@
25
25
26
26
### IMPROVEMENTS
27
27
28
+
-[\#698](https://github.com/cosmos/evm/pull/698) Expose mempool configuration flags and move mempool configuration in app.go to helper
28
29
-[\#538](https://github.com/cosmos/evm/pull/538) Optimize `eth_estimateGas` gRPC path: short-circuit plain transfers, add optimistic gas bound based on `MaxUsedGas`.
29
30
-[\#513](https://github.com/cosmos/evm/pull/513) Replace `TestEncodingConfig` with production `EncodingConfig` in encoding package to remove test dependencies from production code.
30
31
-[\#467](https://github.com/cosmos/evm/pull/467) Replace GlobalEVMMempool by passing to JSONRPC on initiate.
PR [#698](https://github.com/cosmos/evm/pull/698) adds new configuration options for the EVM mempool that can be set via `app.toml` or CLI flags. These options allow fine-tuning of the EVM legacy pool behavior.
141
+
142
+
##### Configuration via `app.toml`
143
+
144
+
The following mempool configuration options are now available in `app.toml` under the `[evm.mempool]` section:
145
+
146
+
```toml
147
+
[evm.mempool]
148
+
# PriceLimit is the minimum gas price to enforce for acceptance into the pool (in wei)
149
+
price-limit = 1
150
+
151
+
# PriceBump is the minimum price bump percentage to replace an already existing transaction (nonce)
152
+
price-bump = 10
153
+
154
+
# AccountSlots is the number of executable transaction slots guaranteed per account
155
+
account-slots = 16
156
+
157
+
# GlobalSlots is the maximum number of executable transaction slots for all accounts
158
+
global-slots = 5120
159
+
160
+
# AccountQueue is the maximum number of non-executable transaction slots permitted per account
161
+
account-queue = 64
162
+
163
+
# GlobalQueue is the maximum number of non-executable transaction slots for all accounts
164
+
global-queue = 1024
165
+
166
+
# Lifetime is the maximum amount of time non-executable transaction are queued
167
+
lifetime = "3h0m0s"
168
+
```
169
+
170
+
##### Configuration via CLI Flags
171
+
172
+
These options can also be set via CLI flags:
173
+
174
+
-`--evm.mempool.price-limit` (default: 1)
175
+
-`--evm.mempool.price-bump` (default: 10)
176
+
-`--evm.mempool.account-slots` (default: 16)
177
+
-`--evm.mempool.global-slots` (default: 5120)
178
+
-`--evm.mempool.account-queue` (default: 64)
179
+
-`--evm.mempool.global-queue` (default: 1024)
180
+
-`--evm.mempool.lifetime` (default: 3h0m0s)
181
+
182
+
##### Cosmos Mempool Max Transactions
183
+
184
+
A new flag `--mempool.max-txs` allows limiting the maximum number of transactions in the Cosmos mempool. Set to 0 or -1 for unbounded (default: 0).
185
+
186
+
##### Simplified Mempool Setup
187
+
188
+
The mempool configuration can now be handled by a helper function. If you prefer to use the configuration from `app.toml` and CLI flags, you can refactor your mempool setup:
panic(fmt.Sprintf("failed to configure EVM mempool: %s", err.Error()))
206
+
}
207
+
```
208
+
209
+
The helper function reads configuration from `appOpts` and applies defaults where needed. Note that `NewExperimentalEVMMempool` now takes an additional `cosmosPoolMaxTx` parameter.
210
+
138
211
### Default Precompiles
139
212
140
213
Default precompiles have been moved to `/evm/precompiles/types/defaults.go` and the function name was
@@ -175,6 +248,18 @@ and moves them to state or genesis.
175
248
It is critical to remove any use of EvmAppOptions as calling the configurator will panic the chain
176
249
at runtime during startup.
177
250
251
+
#### EVM Chain ID
252
+
253
+
The EVM chain ID is now retrieved directly from `appOpts` instead of being passed as a parameter. In `app.go`, the chain ID is obtained using:
0 commit comments