Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ permissions: read-all
jobs:
analyze:
name: Analyze
runs-on: depot-ubuntu-24.04-8
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jsonrpc-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main' }}

jsonrpc-compatibility-test:
runs-on: depot-ubuntu-22.04-8
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/setup-go@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ permissions: read-all
jobs:
golangci:
name: Run golangci-lint
runs-on: depot-ubuntu-24.04-8
timeout-minutes: 15
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/setup-go@v5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"

test-unit-cover:
runs-on: depot-ubuntu-24.04-16
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
if: env.GIT_DIFF

test-fuzz:
runs-on: depot-ubuntu-24.04-4
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
Expand Down
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# CHANGELOG

## v0.6.0

Follow the [migration document](docs/migrations/v0.5.x_to_v0.6.0.md) for upgrade instructions.

### BREAKING CHANGES
- Removed IBC Transfer wrapper. Users are now required to use the precompile to transfer ERC20 tokens.
- Added StateDB as a parameter to internal EVM calls.

### DEPENDENCIES

### IMPROVEMENTS

### FEATURES

### BUG FIXES

- Re-apply the `validateApprovalEventDoesNotExist` guard (F-2026-18822) on the ERC20 -> coin
direction. v0.6.0 lifts that body out of `x/erc20/keeper/msg_server.go` into the new shared
`x/erc20/keeper/convert.go` (`ConvertERC20IntoCoinsForNativeToken`, also reached from the ICS20
precompile) and drops the call on the way, while still promising it in the doc comment. The guard
is restored in the position it held before the move, and the `delayed malicious contract` case in
`TestConvertERC20IntoCoinsForNativeToken` expects a rejection again.
- Report the block base fee (instead of `0`) as the `gasPrice` of derived EVM transactions in
`eth_getTransactionByHash` / `eth_getBlockByNumber`, and as their receipt `effectiveGasPrice`.
Derived txs carry zero fee caps, so consumers that model burn as `base_fee * gas_used` — such as
Blockscout's block-reward formula — read blocks whose only content is derived txs as burning more
than they collected, and render a negative block reward.

## v0.5.1

### DEPENDENCIES
Expand Down Expand Up @@ -100,6 +128,8 @@
- [\#730](https://github.com/cosmos/evm/pull/730) Fix panic if evm mempool not used.
- [\#733](https://github.com/cosmos/evm/pull/733) Avoid rejecting tx with unsupported extension option for ExtensionOptionDynamicFeeTx.
- [\#736](https://github.com/cosmos/evm/pull/736) Add InitEvmCoinInfo upgrade to avoid panic when denom is not registered.
- Add `stateDB` and `callFromPrecompile` parameters to internal EVM messages.
- Fixed an issue with events missing from final transaction result.

### IMPROVEMENTS

Expand Down
55 changes: 26 additions & 29 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,24 +132,24 @@ PACKAGES_UNIT := $(shell go list ./... | grep -v '/tests/e2e$$' | grep -v '/simu
PACKAGES_EVMD := $(shell cd evmd && go list ./... | grep -v '/simulation')
COVERPKG_EVM := $(shell go list ./... | grep -v '/tests/e2e$$' | grep -v '/simulation' | paste -sd, -)
COVERPKG_ALL := $(COVERPKG_EVM)
COMMON_COVER_ARGS := -timeout=15m -covermode=atomic
COMMON_COVER_ARGS := -timeout=30m -covermode=atomic

TEST_PACKAGES := ./...
TEST_TARGETS := test-unit test-evmd test-unit-cover test-race

test-unit: ARGS=-timeout=15m
test-unit: ARGS=-timeout=30m
test-unit: TEST_PACKAGES=$(PACKAGES_UNIT)
test-unit: run-tests

test-race: ARGS=-race
test-race: TEST_PACKAGES=$(PACKAGES_UNIT)
test-race: run-tests

test-evmd: ARGS=-timeout=15m
test-evmd: ARGS=-timeout=30m
test-evmd:
@cd evmd && go test -race -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(PACKAGES_EVMD)

test-unit-cover: ARGS=-timeout=15m -coverprofile=coverage.txt -covermode=atomic
test-unit-cover: ARGS=-timeout=30m -coverprofile=coverage.txt -covermode=atomic
test-unit-cover: TEST_PACKAGES=$(PACKAGES_UNIT)
test-unit-cover: run-tests
@echo "🔍 Running evm (root) coverage..."
Expand All @@ -167,9 +167,9 @@ test: test-unit

test-all:
@echo "🔍 Running evm module tests..."
@go test -race -tags=test -mod=readonly -timeout=15m $(PACKAGES_NOSIMULATION)
@go test -race -tags=test -mod=readonly -timeout=30m $(PACKAGES_NOSIMULATION)
@echo "🔍 Running evmd module tests..."
@cd evmd && go test -race -tags=test -mod=readonly -timeout=15m $(PACKAGES_EVMD)
@cd evmd && go test -race -tags=test -mod=readonly -timeout=30m $(PACKAGES_EVMD)

run-tests:
ifneq (,$(shell which tparse 2>/dev/null))
Expand Down Expand Up @@ -216,7 +216,7 @@ lint: lint-go lint-python lint-contracts
lint-go:
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run --timeout=15m
@$(golangci_lint_cmd) run --timeout=30m

lint-python:
find . -name "*.py" -type f -not -path "*/node_modules/*" | xargs pylint
Expand All @@ -227,7 +227,7 @@ lint-contracts:

lint-fix:
@go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run --timeout=15m --fix
@$(golangci_lint_cmd) run --timeout=30m --fix

lint-fix-contracts:
solhint --fix contracts/**/*.sol
Expand Down Expand Up @@ -378,33 +378,30 @@ test-rpc-compat-stop:

.PHONY: localnet-start localnet-stop localnet-build-env localnet-build-nodes test-rpc-compat test-rpc-compat-stop

test-system: build-v04 build
test-system: build-v05 build
mkdir -p ./tests/systemtests/binaries/
cp $(BUILDDIR)/evmd ./tests/systemtests/binaries/
cd tests/systemtests/Counter && forge build
$(MAKE) -C tests/systemtests test

# V04_REF is the fork's v0.4.0 release state (last commit before the v0.5.0
# upgrade work began). This fork has no upstream-style v0.4.x git tag, so the
# legacy binary for the v0.4.0-to-v0.5.0 upgrade test is built from this commit.
V04_REF ?= b5053b7e
V04_WORKTREE ?= $(BUILDDIR)/v04-src
build-v04:
mkdir -p ./tests/systemtests/binaries/v0.4
# V05_REF is the fork's v0.5.x release state (the last commit before the v0.6.0
# upgrade work began) — the "from" version for the v0.5.0-to-v0.6.0 upgrade
# system test. A commit hash is used (not the upstream `v0.5.1` tag) because that
# tag lives in cosmos/evm, not in this fork, so it is unavailable in CI even with
# fetch-tags. Mirrors V04_REF.
V05_REF ?= 96231e7a
V05_WORKTREE ?= $(BUILDDIR)/v05-src
build-v05:
mkdir -p ./tests/systemtests/binaries/v0.5
# Build the legacy binary in a throwaway worktree so the main checkout is
# never disturbed (the old recipe ran `git checkout $(V04_REF)` on the
# working tree, which breaks as soon as the build dirties go.mod).
rm -rf $(V04_WORKTREE)
git worktree add --force --detach $(V04_WORKTREE) $(V04_REF)
# The v0.4.0 ref predates later fixes and will not build as-is:
# - evmd/cmd/evmd/config/config.go has a duplicate map key (compile error),
# fixed via the patch below;
# - evmd/go.mod is out of sync with the root module graph (root requires a
# newer ibc-go than evmd pins), reconciled with GOFLAGS=-mod=mod.
cd $(V04_WORKTREE) && git apply $(CURDIR)/tests/systemtests/patches/v04-build-fixes.patch
cd $(V04_WORKTREE)/evmd && CGO_ENABLED="1" GOFLAGS=-mod=mod \
go build -o $(CURDIR)/tests/systemtests/binaries/v0.4/evmd ./cmd/evmd
git worktree remove --force $(V04_WORKTREE)
# never disturbed (a `git checkout $(V05_REF)` on the working tree breaks as
# soon as the build dirties go.mod). Mirrors the isolated v0.4 legacy build
# introduced in the audit/CI fixes.
rm -rf $(V05_WORKTREE)
git worktree add --force --detach $(V05_WORKTREE) $(V05_REF)
cd $(V05_WORKTREE)/evmd && CGO_ENABLED="1" GOFLAGS=-mod=mod \
go build -o $(CURDIR)/tests/systemtests/binaries/v0.5/evmd ./cmd/evmd
git worktree remove --force $(V05_WORKTREE)

mocks:
@echo "--> generating mocks"
Expand Down
4 changes: 2 additions & 2 deletions ante/cosmos/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
)

var evmCodec codec.ProtoCodecMarshaler
var evmCodec codec.Codec

func init() {
registry := codectypes.NewInterfaceRegistry()
Expand Down Expand Up @@ -177,7 +177,7 @@ func VerifySignature(
return errorsmod.Wrap(errortypes.ErrNoSignatures, "tx doesn't contain any msgs to verify signature")
}

txBytes := legacytx.StdSignBytes(
txBytes := legacytx.StdSignBytes( //nolint:staticcheck // checking legacy type
signerData.ChainID,
signerData.AccountNumber,
signerData.Sequence,
Expand Down
2 changes: 1 addition & 1 deletion ante/evm/fee_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func FeeChecker(
}

feeCoins := feeTx.GetFee()
feeAmtDec := sdkmath.LegacyNewDecFromInt(feeCoins.AmountOfNoDenomValidation(denom))
feeAmtDec := sdkmath.LegacyNewDecFromInt(feeCoins.AmountOfNoDenomValidation(denom)) //nolint:staticcheck // checking legacy type

feeCap := feeAmtDec.QuoInt(gas)
if feeCap.LT(baseFee) {
Expand Down
10 changes: 10 additions & 0 deletions contracts/contract_creation_tester.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package contracts

import (
contractutils "github.com/cosmos/evm/contracts/utils"
evmtypes "github.com/cosmos/evm/x/vm/types"
)

func LoadContractCreationTester() (evmtypes.CompiledContract, error) {
return contractutils.LoadContractFromJSONFile("solidity/ContractCreationTester.json")
}
10 changes: 10 additions & 0 deletions contracts/erc20_with_native_transfers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package contracts

import (
contractutils "github.com/cosmos/evm/contracts/utils"
evmtypes "github.com/cosmos/evm/x/vm/types"
)

func LoadERC20WithNativeTransfers() (evmtypes.CompiledContract, error) {
return contractutils.LoadContractFromJSONFile("solidity/ERC20WithNativeTransfers.json")
}
10 changes: 10 additions & 0 deletions contracts/ics20_sequential_precompile_calls.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package contracts

import (
contractutils "github.com/cosmos/evm/contracts/utils"
evmtypes "github.com/cosmos/evm/x/vm/types"
)

func LoadSequentialICS20Sender() (evmtypes.CompiledContract, error) {
return contractutils.LoadContractFromJSONFile("solidity/SequentialICS20Sender.json")
}
10 changes: 10 additions & 0 deletions contracts/ics20_transfer_tester.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package contracts

import (
contractutils "github.com/cosmos/evm/contracts/utils"
evmtypes "github.com/cosmos/evm/x/vm/types"
)

func LoadICS20TransferTester() (evmtypes.CompiledContract, error) {
return contractutils.LoadContractFromJSONFile("solidity/ICS20TransferTester.json")
}
10 changes: 10 additions & 0 deletions contracts/sequential_operations_tester.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package contracts

import (
contractutils "github.com/cosmos/evm/contracts/utils"
evmtypes "github.com/cosmos/evm/x/vm/types"
)

func LoadSequentialOperationsTester() (evmtypes.CompiledContract, error) {
return contractutils.LoadContractFromJSONFile("solidity/SequentialOperationsTester.json")
}
Loading
Loading