Skip to content

chore(evm): upgrade pushchain/evm to v0.5.1 on audit-fixes (port of #265)#266

Merged
0xNilesh merged 2 commits into
audit-fixesfrom
audit-fixes-evm-0.5.1
Jun 17, 2026
Merged

chore(evm): upgrade pushchain/evm to v0.5.1 on audit-fixes (port of #265)#266
0xNilesh merged 2 commits into
audit-fixesfrom
audit-fixes-evm-0.5.1

Conversation

@0xNilesh

Copy link
Copy Markdown
Member

What

Ports PR #265 (cosmos/pushchain/evm v0.4 → v0.5.1) onto audit-fixes. Cherry-picked #265's net diff, then closed the additional v0.2.1 → v0.5.1 API gap that the cherry-pick didn't cover (audit-fixes was two minor evm versions behind main).

Design

  • Fresh genesis, no upgrade handler. Coin-info is established by adding bank denom metadata for upc to DefaultGenesis; v0.5's EVM InitGenesis auto-derives coin-info from it via LoadEvmCoinInfo (no migration needed on a fresh chain).
  • EVMChainID = 9000 (matches the localchain_9000-1 default chain id), denom upc / display pushchain.

Audit fixes preserved (where main diverged/dropped them)

  • F-2026-17025 isContractDeployed — kept; reimplemented via the renamed Account.HasCodeHash() (identical !IsEmptyCodeHash semantics). main had reverted this to the unsafe length-only check.
  • usigverifier — kept audit-fixes' single canonical address (0xEC..01); did not import main's dead NewPrecompileV2/0xCA backward-compat path.
  • expected_keepers.go GetBallot/GetAdmin and DerivedEVMCall — preserved.

v0.5 API adaptations

  • EVMKeeper.NewKeeper new signature (+keys map, ConsensusParamsKeeper, EVMChainID, authKeeperEVMWrapper)
  • MakeConfig(EVMChainID)
  • CallEVM gained gasCap *big.Int — updated interface, mock, and all call sites (pass nil)
  • PostTxProcessing(..., core.Message{}, ...) (was nilable)
  • statedb.Account.Balance*uint256.Int
  • erc20 NativePrecompiles moved to top-level genesis
  • evidence precompile removed (package gone in v0.5.1; main never had it)
  • ante unordered-tx wrapper; GetMempool/SetClientCtx/RegisterPendingTxListener server-interface methods
  • removed dead utils/precompile; Makefile test targets run with -tags=test

Testing

  • go build ./...
  • full root-module go vet -tags=test ✓ (all code + test files compile)
  • full unit suite ✓ (app, all x/ keepers+types, precompiles/usigverifier, app/ante, app/upgrades)
  • all 5 integration packages ✓ (uexecutor, utss, uvalidator, uregistry, upgrades) — exercise the coin-info-from-genesis path, CallEVM gasCap, and PostTxProcessing end-to-end

🤖 Generated with Claude Code

@0xNilesh 0xNilesh merged commit 7368efc into audit-fixes Jun 17, 2026
7 checks passed
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.

1 participant