Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
8d787a2
evmd refactor (base evm app)
vladjdk Nov 12, 2025
f54cf93
temporarily remove tests
vladjdk Nov 13, 2025
a53611a
update
vladjdk Nov 14, 2025
70486f9
Merge branch 'main' into cloudgray/evmd-refactor
cloudgray Nov 19, 2025
279449c
refactor: add mint module to basic app
cloudgray Nov 19, 2025
db537ef
refactor(evmd): modify basic keeper getters
cloudgray Nov 19, 2025
eed864f
refactor: modify testing app interfaces
cloudgray Nov 19, 2025
93adab3
test: inject evmd to slashing precompile test
cloudgray Nov 19, 2025
1e59de6
test: inject evmd to distr precompile test
cloudgray Nov 19, 2025
c791c54
test: fix distr precompile test setup
cloudgray Nov 19, 2025
f9f7bf4
test: fix address codec
cloudgray Nov 20, 2025
4b5dd3c
test: fix distr precompile test setup
cloudgray Nov 20, 2025
86f2f4c
chore: remove unnecessary app wrapping for distribution precompile
cloudgray Nov 20, 2025
2e0a109
refactor: inject new evmd to bank precompile tests
cloudgray Nov 20, 2025
44cf2d4
chore: fix comment
cloudgray Nov 20, 2025
2efedee
WIP: fix precisebank test
cloudgray Nov 20, 2025
9663503
Merge branch 'main' into cloudgray/evmd-refactor
cloudgray Nov 21, 2025
15b2ff3
WIP: fix precisebank test
cloudgray Nov 21, 2025
7a41a3c
chore(app): disable block-stm
cloudgray Nov 24, 2025
e946656
fix(ante): fix incorrect denom usage in ante handler
cloudgray Nov 24, 2025
3229dad
WIP: fix ibc tests
cloudgray Nov 24, 2025
3a14106
WIP: fix ibc app for test
cloudgray Nov 25, 2025
16c134c
WIP: fix ibc app for test
cloudgray Nov 25, 2025
5d29ef2
fix ibc app for tes
cloudgray Nov 25, 2025
63b23c6
WIP: fix ibc app for ics20 precompile test
cloudgray Nov 25, 2025
1a2ef83
test: fix coin decimals as 18 for ibc tests
cloudgray Nov 26, 2025
42a67a2
test: add ibc tests
cloudgray Nov 26, 2025
dfbec16
chore(app): remove temp method
cloudgray Nov 26, 2025
b812165
WIP: add ics20 recursive precompile calls test
cloudgray Nov 26, 2025
d20bb0d
fix ibc test setup
cloudgray Nov 27, 2025
c3a47bd
chore(app): implement GetConsensusParamsKeeper method
cloudgray Nov 27, 2025
a666f04
refactor test file locations
cloudgray Nov 27, 2025
67240e2
chore: refactor test app config
cloudgray Nov 27, 2025
7965dab
remove test case with wevmos contract
cloudgray Nov 27, 2025
c8582d8
fix x/vm test
cloudgray Nov 27, 2025
9e50c09
fix precisebank test
cloudgray Nov 27, 2025
ca50502
add erc20 precompile test
cloudgray Nov 27, 2025
8ff28ac
fix staking precompile test
cloudgray Nov 27, 2025
7b43a84
rollback incorrect fix of vm test
cloudgray Nov 27, 2025
7414f1c
fix ante handler test
cloudgray Nov 27, 2025
94304ef
chore: refactor test app for ibc test
cloudgray Nov 27, 2025
1d7ab4d
chore: fix solidity test
cloudgray Dec 1, 2025
e92d454
WIP: cleanup code
cloudgray Dec 1, 2025
cd99a34
test: add ics20 precompile test
cloudgray Dec 1, 2025
d31e2db
chore: fix codeql warning
cloudgray Dec 1, 2025
0a49661
test: fix test helper
cloudgray Dec 1, 2025
2e46a33
WIP: cleanup code
cloudgray Dec 1, 2025
57abb55
chore: cleanup
cloudgray Dec 1, 2025
caf1632
Merge branch 'main' into cloudgray/evmd-refactor
cloudgray Dec 1, 2025
8038cab
chore: update CHANGELOG.md
cloudgray Dec 1, 2025
758fbc1
chore: add comments
cloudgray Dec 1, 2025
369d3ca
chore: cleanup
cloudgray Dec 1, 2025
504147f
chore: remove map iteration from app.go
cloudgray Dec 1, 2025
ef740dd
chore: remove map iteration from app.go
cloudgray Dec 1, 2025
f8587d2
Merge branch 'main' into cloudgray/evmd-refactor
aljo242 Dec 1, 2025
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [\#811](https://github.com/cosmos/evm/pull/811) Use sdk's DefaultBondDenom for default evm denom in genesis.
- [\#823](https://github.com/cosmos/evm/pull/823) Remove authz dependency from test suite and EvmApp interface
- [\#829](https://github.com/cosmos/evm/pull/829) Seperate test app interface
- [\#845](https://github.com/cosmos/evm/pull/845) Modify tests to inject minimum app

### FEATURES

Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ test-race: run-tests

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

test-unit-cover: ARGS=-timeout=15m -coverprofile=coverage.txt -covermode=atomic
test-unit-cover: TEST_PACKAGES=$(PACKAGES_UNIT)
test-unit-cover: run-tests
@echo "🔍 Running evm (root) coverage..."
@go test -race -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage.txt ./...
@go test -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage.txt ./...
@echo "🔍 Running evmd coverage..."
@cd evmd && go test -race -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage_evmd.txt ./...
@cd evmd && go test -tags=test $(COMMON_COVER_ARGS) -coverpkg=$(COVERPKG_ALL) -coverprofile=coverage_evmd.txt ./...
@echo "🔀 Merging evmd coverage into root coverage..."
@tail -n +2 evmd/coverage_evmd.txt >> coverage.txt && rm evmd/coverage_evmd.txt
@echo "🧹 Filtering ignored files from coverage.txt..."
Expand All @@ -174,15 +174,15 @@ test: test-unit

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

run-tests:
ifneq (,$(shell which tparse 2>/dev/null))
go test -count=1 -race -tags=test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse
go test -count=1 -tags=test -mod=readonly -json $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES) | tparse
else
go test -count=1 -race -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES)
go test -count=1 -tags=test -mod=readonly $(ARGS) $(EXTRA_ARGS) $(TEST_PACKAGES)
endif

# Use the old Apple linker to workaround broken xcode - https://github.com/golang/go/issues/65169
Expand All @@ -191,11 +191,11 @@ ifeq ($(OS_FAMILY),Darwin)
endif

test-fuzz:
go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzMintCoins ./x/precisebank/keeper
go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzBurnCoins ./x/precisebank/keeper
go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzSendCoins ./x/precisebank/keeper
go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_NonZeroRemainder ./x/precisebank/types
go test -race -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_ZeroRemainder ./x/precisebank/types
go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzMintCoins ./x/precisebank/keeper
go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzBurnCoins ./x/precisebank/keeper
go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzSendCoins ./x/precisebank/keeper
go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_NonZeroRemainder ./x/precisebank/types
go test -tags=test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzGenesisStateValidate_ZeroRemainder ./x/precisebank/types

test-scripts:
@echo "Running scripts tests"
Expand All @@ -208,7 +208,7 @@ test-solidity:
.PHONY: run-tests test test-all $(TEST_TARGETS)

benchmark:
@go test -race -tags=test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION)
@go test -tags=test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION)

.PHONY: benchmark

Expand Down
2 changes: 2 additions & 0 deletions encoding/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
"github.com/cosmos/cosmos-sdk/x/auth/tx"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
)

// Config specifies the concrete encoding types to use for a given app.
Expand Down Expand Up @@ -49,6 +50,7 @@ func MakeConfig(evmChainID uint64) Config {
enccodec.RegisterLegacyAminoCodec(cdc)
enccodec.RegisterInterfaces(interfaceRegistry)
eip712.SetEncodingConfig(cdc, interfaceRegistry, evmChainID)
vestingtypes.RegisterInterfaces(interfaceRegistry)

// This is needed for the EIP712 txs because currently is using
// the deprecated method legacytx.StdSignBytes
Expand Down
1 change: 1 addition & 0 deletions evmd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts/node-data
15 changes: 15 additions & 0 deletions evmd/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM golang:1.25-alpine AS builder

RUN apk add --no-cache curl build-base git bash file linux-headers eudev-dev

WORKDIR /src

COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN LEDGER_ENABLED=false make build

FROM alpine:3.21
COPY --from=builder /src/build/evmd /bin/evmd
ENTRYPOINT ["evmd"]
159 changes: 159 additions & 0 deletions evmd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
APPNAME := evm
BUILDDIR ?= $(CURDIR)/build
DOCKER := $(shell which docker)

# don't override user values
ifeq (,$(VERSION))
VERSION := $(shell git describe --exact-match 2>/dev/null)
# if VERSION is empty, then populate it with branch's name and raw commit hash
ifeq (,$(VERSION))
VERSION := $(BRANCH)-$(COMMIT)
endif
endif

help: ## List Commands
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: help

check-all: ## Convenience to make sure everything is all good
# @$(MAKE) proto-all # Uncomment if we add custom modules
@$(MAKE) build
@$(MAKE) test-unit
@$(MAKE) lint
@$(MAKE) e2e-contracts
@$(MAKE) test-e2e

.PHONY: all

################################################################################
## Build ##
################################################################################

# forces Go to use its pure Go implementation of the DNS resolver
build_tags = netgo
build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))

whitespace :=
empty = $(whitespace) $(whitespace)
comma := ,
build_tags_comma_sep := $(subst $(empty),$(comma),$(build_tags))

# process linker flags

# TODO: Figure out if '-s -w' is still needed
# flags '-s -w' resolves an issue with xcode 16 and signing of go binaries
# ref: https://github.com/golang/go/issues/63997
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=$(APPNAME) \
-X github.com/cosmos/cosmos-sdk/version.AppName=$(APPNAME) \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-s -w

ifeq ($(LINK_STATICALLY),true)
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static"
endif
ldflags += $(LDFLAGS)
ldflags := $(strip $(ldflags))

BUILD_FLAGS := -tags "$(build_tags_comma_sep)" -ldflags '$(ldflags)' -trimpath

clean: ## Clean build artifacts
rm -rf $(BUILDDIR)/ artifacts/

build: go.sum ## Build chain binary
@echo "Building chain binary"
go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/evmd ./cmd/evmd



.PHONY: build clean

################################################################################
## Test ##
################################################################################

test-unit: ## Run unit tests
@echo Running unit tests...
@go test -mod=readonly -v -timeout 30m ./...

test-race: ## Run unit tests with race condition reporting
@echo Running unit tests with race condition reporting...
@go test -mod=readonly -v -race -timeout 30m ./...

test-e2e: ## Run e2e tests
@echo Running e2e tests...
@cd e2e && go test -parallel 8 -mod=readonly -v -count=1 -timeout 30m .

.PHONY: test-unit test-race

################################################################################
## Install ##
################################################################################

install: ## Install dependencies
@echo "--> ensure dependencies have not been modified"
@go mod verify
@echo "--> installing $(APPNAME)d"
@go install $(BUILD_FLAGS) -mod=readonly ./cmd/$(APPNAME)d

.PHONY: install

################################################################################
## Protobuf ##
################################################################################

protoVer=0.17.1
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

proto-all: proto-format proto-lint proto-gen ## Generate Protobuf files

proto-gen: ## Generate Protobuf files
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh
@go mod tidy

proto-format: ## Format Protobuf files
@echo "Formatting Protobuf files"
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-lint: ## Lint Protobuf files
@$(protoImage) buf lint --error-format=json

.PHONY: proto-all proto-gen proto-format proto-lint

################################################################################
## Linting ##
################################################################################

golangci_lint_cmd=golangci-lint

lint: ## Run linter
@echo "--> Running linter"
@$(golangci_lint_cmd) run ./... --timeout 15m -c .golangci.yml
@cd e2e && $(golangci_lint_cmd) run ./... --timeout 15m -c ../.golangci.yml

lint-fix: ## Run linter and fix issues
@echo "--> Running linter and fixing issues"
@$(golangci_lint_cmd) run ./... --fix --timeout 15m -c .golangci.yml
@cd e2e && $(golangci_lint_cmd) run ./... --fix --timeout 15m -c ../.golangci.yml

.PHONY: lint lint-fix

################################################################################
## E2E Contract Artifacts ##
################################################################################

SOLC_IMAGE ?= ethereum/solc:0.8.28
E2E_CONTRACTS_DIR ?= e2e/contracts

e2e-contracts: ## Regenerate e2e embedded contract artifacts (ABI/BIN)
@echo "--> Regenerating e2e contract artifacts with $(SOLC_IMAGE)"
@docker run --rm -v $(CURDIR)/$(E2E_CONTRACTS_DIR):/contracts $(SOLC_IMAGE) --abi --bin -o /contracts --overwrite /contracts/Counter.sol /contracts/Reverter.sol

.PHONY: e2e-contracts
Loading
Loading