Skip to content

Fix lint issues and clean up simulation gas accounting#3455

Merged
masih merged 3 commits into
mainfrom
masih/sim-engine-cleanup
May 18, 2026
Merged

Fix lint issues and clean up simulation gas accounting#3455
masih merged 3 commits into
mainfrom
masih/sim-engine-cleanup

Conversation

@masih

@masih masih commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Align simulation ante wiring with upstream and add a dedicated simulation VM Pass wasmkeeper.DefaultGasMeterSetter() to NewLimitSimulationGasDecorator in app/ante.go to match the reference wiring at sei-wasmd/app/ante.go.

Add a dedicated simulationWasmVM on Keeper alongside the existing rpcWasmVM, plus an IsSimulation flag on sdk.Context that BaseApp.runTx sets for runTxModeSimulate. Keeper.getWasmer returns the dedicated VM for simulate-mode contexts, mirroring the existing tracing wiring.

Adds unit tests for the ante wiring, the context flag, and the engine selection.

masih added 2 commits May 18, 2026 13:01
Align simulation ante wiring with upstream and add a dedicated
simulation VM Pass wasmkeeper.DefaultGasMeterSetter() to
NewLimitSimulationGasDecorator in app/ante.go to match the reference
wiring at sei-wasmd/app/ante.go.

Add a dedicated simulationWasmVM on Keeper alongside the existing
rpcWasmVM, plus an IsSimulation flag on sdk.Context that BaseApp.runTx
sets for runTxModeSimulate. Keeper.getWasmer returns the dedicated VM
for simulate-mode contexts, mirroring the existing tracing wiring.

Adds unit tests for the ante wiring, the context flag, and the engine
selection.
@masih masih marked this pull request as ready for review May 18, 2026 12:03
@github-actions

github-actions Bot commented May 18, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 18, 2026, 2:17 PM

@masih masih requested review from codchen and sei-will May 18, 2026 12:03
@cursor

cursor Bot commented May 18, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how simulation mode is flagged and how the wasm keeper selects its execution engine, which can affect gas accounting and simulation behavior across the stack. Impact should be limited to runTxModeSimulate, but it touches BaseApp/sdk.Context and wasm VM initialization paths.

Overview
Aligns simulation ante wiring by switching NewLimitSimulationGasDecorator to use wasmkeeper.DefaultGasMeterSetter(), and adds a unit test to ensure the simulation gas limit and Cosmos gas multiplier are applied as expected.

Introduces an IsSimulation flag on sdk.Context (set by BaseApp.runTx during runTxModeSimulate) and updates the wasm keeper to instantiate and route simulation contexts to a dedicated simulationWasmVM, with tests covering the new context flag and engine selection.

Includes a small lint/security-scan suppression for safe uint64int64 conversion in fee checking.

Reviewed by Cursor Bugbot for commit a88e401. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.30%. Comparing base (b671648) to head (a88e401).

Files with missing lines Patch % Lines
sei-wasmd/x/wasm/keeper/keeper.go 66.66% 1 Missing and 1 partial ⚠️
app/ante/cosmos_checktx.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3455   +/-   ##
=======================================
  Coverage   59.29%   59.30%           
=======================================
  Files        2126     2126           
  Lines      175702   175714   +12     
=======================================
+ Hits       104183   104200   +17     
+ Misses      62448    62440    -8     
- Partials     9071     9074    +3     
Flag Coverage Δ
sei-chain-pr 70.23% <80.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/ante.go 64.51% <100.00%> (ø)
sei-cosmos/baseapp/baseapp.go 75.29% <100.00%> (+0.09%) ⬆️
sei-cosmos/types/context.go 90.53% <100.00%> (+0.18%) ⬆️
app/ante/cosmos_checktx.go 37.56% <0.00%> (-0.55%) ⬇️
sei-wasmd/x/wasm/keeper/keeper.go 85.93% <66.66%> (-0.17%) ⬇️

... and 32 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.

@masih masih enabled auto-merge May 18, 2026 14:15
@masih masih added this pull request to the merge queue May 18, 2026
Merged via the queue into main with commit adf03c1 May 18, 2026
41 checks passed
@masih masih deleted the masih/sim-engine-cleanup branch May 18, 2026 14:50
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.

3 participants