Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
1391fb3
feat(erc20factory): erc20factory precompile
GuillemGarciaDev Aug 5, 2025
78ea7fd
Merge branch 'main' of https://github.com/xrplevm/evm
GuillemGarciaDev Aug 5, 2025
15daee6
Merge branch 'main' into feat/erc20-factory-precompile
GuillemGarciaDev Aug 5, 2025
3c5808f
refactor(erc20factory): integration tests
GuillemGarciaDev Aug 5, 2025
08670ca
fix(precisebank): remove already declared methods
GuillemGarciaDev Aug 5, 2025
dd8fdfb
Merge branch 'main' into feat/erc20-factory-precompile
GuillemGarciaDev Aug 19, 2025
0625e33
fix: update branch with main changes
GuillemGarciaDev Aug 19, 2025
417987b
fix(precompiles/erc20factory): add BalanceHandler to erc20factory pre…
GuillemGarciaDev Aug 19, 2025
144922a
revert auto-fix for markdown linting (#483)
Cordtus Aug 19, 2025
47b43b4
add comments (#489)
almk-dev Aug 19, 2025
1d8b9e1
feat: remove allow-unprotected-txs(non eip-155) from x/vm params (#415)
dudong2 Aug 19, 2025
a9cb401
add erc20 migration guide (#485)
Cordtus Aug 19, 2025
dda0fb1
add thanks
Aug 19, 2025
aa9a834
chore: replace GlobalEVMMempool by passing to JSONRPC on initiate (#467)
mmsqe Aug 19, 2025
f164197
Problem: eip-2935 is not implemented (#407)
yihuang Aug 20, 2025
8903f9d
refactor: decouple keeper using interface on precompile (#477)
yoosah Aug 20, 2025
7451d9b
set-up (#491)
Aug 20, 2025
befde4f
feat: Delete EVM instance in AnteHandler (#352)
heijiLee Aug 20, 2025
3991c2c
tests: add revert error e2e tests for contract and precompile calls (…
cloudgray Aug 20, 2025
1f22f19
Problem: IsStorageEmpty is not implemented (#490)
yihuang Aug 21, 2025
2cf6593
feat: allow PostTxProcessing to run on failures and persist data (#479)
facundomedica Aug 21, 2025
642c8e9
fix: notify new block for mempool in time to avoid insufficient funds…
mmsqe Aug 21, 2025
4d93f2d
feature: Add eth_createAccessList method and implementation (#346)
almk-dev Aug 21, 2025
03083a8
fix: duplicate case switch to avoid empty execution block (#492)
almk-dev Aug 21, 2025
48e3c83
test: v0.4.1 -> main upgrade test (#498)
technicallyty Aug 22, 2025
e01cc50
(chore):Simplify Mempool Config (#496)
vladjdk Aug 22, 2025
2d3df2b
ci: workflow fails when feat, fix, or refactor PRs do not have change…
technicallyty Aug 22, 2025
750d77d
chore: cleanup deprecated BalanceChangeEntry (#506)
mmsqe Aug 25, 2025
bcc17d4
refactor: replace TestEncodingConfig with production Config (#513)
zchn Aug 26, 2025
68436ec
fix: allow value with slashes when query token_pairs (#509)
mmsqe Aug 27, 2025
0032812
fix: allow mempool interrupt while it is still ongoing (#495)
almk-dev Aug 27, 2025
83ae83d
docs: update contrib guide (#539)
technicallyty Aug 27, 2025
3e37931
add pr title job (#541)
technicallyty Aug 28, 2025
5ffe3cc
chore: check if mempool is not nil before accepting nonce gap error t…
mmsqe Aug 29, 2025
2fff19e
fix(evmd): remove pebble replace directive (#574)
Pitasi Aug 29, 2025
af53a0f
docs(migration): boilerplate v0.5.0 migration docs with mempool migra…
vladjdk Aug 29, 2025
2a0eb3a
perf: optimize gas estimation (#538)
vladjdk Aug 29, 2025
4be8aba
feat: AddPrecompileFn on stateObject not needed (#511)
yihuang Aug 29, 2025
ec57b96
fix: CometBlockResultByNumber when height is 0 (#416)
Pitasi Aug 29, 2025
1fcfa49
feat: add block time in derived logs (#502)
yihuang Sep 2, 2025
bd607f7
feat: avoid unnecessary block notifications when the event bus is alr…
mmsqe Sep 2, 2025
fedc27f
feat: don't emit EVM logs into cosmos-sdk events (#576)
mmsqe Sep 3, 2025
2a9e687
fix: use zero constructor to avoid nil pointer panic when BaseFee is …
almk-dev Sep 3, 2025
f03d2a4
test(mempool): add integration test (#512)
cloudgray Sep 4, 2025
a5ba4a4
fix: remove `tokenType` parameter
GuillemGarciaDev Sep 5, 2025
1ac06bd
Merge remote-tracking branch 'upstream/main' into feat/erc20-factory-…
GuillemGarciaDev Sep 5, 2025
67950ad
feat: add block max_gas and min_tip ingestion to app.go mempool confi…
almk-dev Sep 7, 2025
baed74a
fix(tests/solidity): fix erc20factory calculate address test
GuillemGarciaDev Sep 9, 2025
0afdc34
chore: bump to ibc-go v10.3.0 (#592)
gjermundgaraba Sep 10, 2025
8156e38
fix(crypto): invalid type of PubKey.Address() method (#600)
cloudgray Sep 15, 2025
1518fe3
docs: add d2 tool to repo and mempool arch diagram (#597)
almk-dev Sep 15, 2025
dd7b4c7
test: add nested precompile reversion test case (#535)
vladjdk Sep 15, 2025
5ff2ec7
perf: reduce number of query context calls (#598)
vladjdk Sep 15, 2025
1b60425
chore: add erc20 factory precompile feature to CHANGELOG.md
GuillemGarciaDev Sep 16, 2025
d6b0d30
test: mock bank keeper is outdated (#606)
mmsqe Sep 16, 2025
c43c940
feat: emit geth metrics on cosmos SDK metrics server (#588)
technicallyty Sep 16, 2025
1301ec3
Merge branch 'main' into feat/erc20-factory-precompile
GuillemGarciaDev Sep 17, 2025
eb3eb81
fix(mempool): checkTxHandler to handle invalid sequence tx (#591)
cloudgray Sep 17, 2025
8147291
perf: cache precompile abis (#631)
vladjdk Sep 17, 2025
28bc48b
feat: fill block hash and timestamp in tx response (#584)
mmsqe Sep 17, 2025
4ea6cd9
fix: align tx not found in get_transaction_receipt (#533)
mmsqe Sep 17, 2025
45d6283
chore: cleanup unnecessary fix-revert-gas-refund-height (#624)
mmsqe Sep 17, 2025
b63a681
feat: separate geth metrics server (#633)
technicallyty Sep 18, 2025
19b82ce
refactor: move default precompiles out of evmd config (#635)
vladjdk Sep 18, 2025
e07bfc1
refactor: make erc20keeper optional in x/vm (#609)
gjermundgaraba Sep 18, 2025
bb6162e
test(systemtests): add appside mempool e2e test (#580)
cloudgray Sep 18, 2025
f764802
Merge remote-tracking branch 'upstream/main' into feat/erc20-factory-…
GuillemGarciaDev Sep 19, 2025
df9de91
Merge remote-tracking branch 'origin/feat/erc20-factory-precompile' i…
GuillemGarciaDev Sep 19, 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
19 changes: 0 additions & 19 deletions .github/workflows/changelog.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review, edited ]
paths: [ "**/*.go" ]
name: Changelog Reminder
jobs:
remind:
name: Changelog Reminder
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.draft }}
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check PR title for semantic commit type
run: |
# Get the PR title
PR_TITLE="${{ github.event.pull_request.title }}"
echo "PR Title: $PR_TITLE"

# Check if PR title starts with feat, refactor, or fix
if echo "$PR_TITLE" | grep -qE "^(feat|refactor|fix)(\(.+\))?!?:"; then
echo "✅ PR title has relevant semantic commit type (feat, refactor, or fix)"
echo "has_relevant_pr_title=true" >> $GITHUB_ENV
else
echo "ℹ️ PR title doesn't have relevant semantic commit type. Skipping changelog check."
echo "has_relevant_pr_title=false" >> $GITHUB_ENV
fi

- name: Check if CHANGELOG.md was modified
if: env.has_relevant_pr_title == 'true'
run: |
# Get the list of changed files in this PR
CHANGED_FILES=$(git diff --name-only origin/${{ github.base_ref }}...HEAD)

# Check if CHANGELOG.md (case insensitive) is in the changed files
if echo "$CHANGED_FILES" | grep -qi "changelog\.md"; then
echo "✅ CHANGELOG.md has been modified in this PR"
echo "changelog_modified=true" >> $GITHUB_ENV
else
echo "❌ CHANGELOG.md has not been modified in this PR"
echo "changelog_modified=false" >> $GITHUB_ENV
fi

- name: Fail if changelog not updated
if: env.has_relevant_pr_title == 'true' && env.changelog_modified == 'false'
run: |
echo "::error::CHANGELOG.md must be updated for PRs with feat, refactor, or fix commits"
exit 1
43 changes: 7 additions & 36 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,14 @@ jobs:
make lint-go

markdown-lint:
name: markdownlint (cli2, minimal, non-blocking)
name: markdownlint (cli2, minimal)
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write # allows auto-fix pushes on same-repo PRs; forks stay read-only
contents: read # read-only permissions
steps:
# Same-repo PRs: checkout the head branch so fixes can be pushed back
- name: Checkout PR head (same-repo)
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}

# Fork PRs, merge queue, and any other case: default checkout (safe merge ref)
- name: Checkout (default)
if: github.event_name == 'merge_group' || github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
# Standard checkout for all cases
- name: Checkout
uses: actions/checkout@v4

# Only run if markdown or configs changed
Expand All @@ -85,32 +76,12 @@ jobs:
with:
node-version: "20"

# Lint (non-blocking): auto-fix on same-repo PRs, never fail the job
- name: markdownlint (check or fix)
# Lint: check only, fail on errors
- name: markdownlint (check only)
id: md_lint
if: env.GIT_DIFF
continue-on-error: true
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: "**/*.md"
config: .markdownlint.yml
fix: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}

# If fixes applied, commit & push (same-repo PRs only, not merge queue)
- name: Push auto-fixes (same-repo PRs only)
if: env.GIT_DIFF && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
run: |
if [[ -n $(git status -s) ]]; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "Auto-fix markdown lint issues"
git push
fi

# Warn if any issues remain after auto-fix (or on forks)
- name: Report remaining markdown issues (non-blocking)
if: env.GIT_DIFF && steps.md_lint.outcome == 'failure'
run: |
echo "::warning::Markdown lint issues remain after the check/fix step. For local fixes, run:"
echo " npx markdownlint-cli2 --config .markdownlint.yml --fix '**/*.md'"
fix: false
15 changes: 15 additions & 0 deletions .github/workflows/pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: PR Conventional Commit Validation

on:
pull_request:
types: [opened, synchronize, reopened, edited]

jobs:
validate-pr-title:
runs-on: ubuntu-latest
steps:
- name: PR Conventional Commit Validation
uses: ytanikin/pr-conventional-commits@1.4.0
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert","style","build"]'
add_label: 'false'
3 changes: 3 additions & 0 deletions .github/workflows/system-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
with:
version: stable
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: technote-space/get-diff-action@v6.1.2
with:
PATTERNS: |
Expand Down
52 changes: 51 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,56 @@

## UNRELEASED

## v0.4.0
### DEPENDENCIES

### BUG FIXES

- [\#471](https://github.com/cosmos/evm/pull/471) Notify new block for mempool in time
- [\#492](https://github.com/cosmos/evm/pull/492) Duplicate case switch to avoid empty execution block
- [\#509](https://github.com/cosmos/evm/pull/509) Allow value with slashes when query token_pairs
- [\#495](https://github.com/cosmos/evm/pull/495) Allow immediate SIGINT interrupt when mempool is not empty
- [\#416](https://github.com/cosmos/evm/pull/416) Fix regression in CometBlockResultByNumber when height is 0 to use the latest block. This fixes eth_getFilterLogs RPC.
- [\#545](https://github.com/cosmos/evm/pull/545) Check if mempool is not nil before accepting nonce gap error tx.
- [\#585](https://github.com/cosmos/evm/pull/585) Use zero constructor to avoid nil pointer panic when BaseFee is 0d
- [\#591](https://github.com/cosmos/evm/pull/591) CheckTxHandler should handle "invalid nonce" tx

### IMPROVEMENTS

- [\#538](https://github.com/cosmos/evm/pull/538) Optimize `eth_estimateGas` gRPC path: short-circuit plain transfers, add optimistic gas bound based on `MaxUsedGas`.
- [\#513](https://github.com/cosmos/evm/pull/513) Replace `TestEncodingConfig` with production `EncodingConfig` in encoding package to remove test dependencies from production code.
- [\#467](https://github.com/cosmos/evm/pull/467) Replace GlobalEVMMempool by passing to JSONRPC on initiate.
- [\#352](https://github.com/cosmos/evm/pull/352) Remove the creation of a Geth EVM instance, stateDB during the AnteHandler balance check.
- [\#496](https://github.com/cosmos/evm/pull/496) Simplify mempool instantiation by using configs instead of objects.
- [\#512](https://github.com/cosmos/evm/pull/512) Add integration test for appside mempool.
- [\#568](https://github.com/cosmos/evm/pull/568) Avoid unnecessary block notifications when the event bus is already set up.
- [\#511](https://github.com/cosmos/evm/pull/511) Minor code cleanup for `AddPrecompileFn`.
- [\#576](https://github.com/cosmos/evm/pull/576) Parse logs from the txResult.Data and avoid emitting EVM events to cosmos-sdk events.
- [\#584](https://github.com/cosmos/evm/pull/584) Fill block hash and timestamp for json rpc.
- [\#582](https://github.com/cosmos/evm/pull/582) Add block max-gas (from genesis.json) and new min-tip (from app.toml/flags) ingestion into mempool config
- [\#580](https://github.com/cosmos/evm/pull/580) add appside mempool e2e test
- [\#598](https://github.com/cosmos/evm/pull/598) Reduce number of times CreateQueryContext in mempool.
- [\#606](https://github.com/cosmos/evm/pull/606) Regenerate mock file for bank keeper related test.
- [\#609](https://github.com/cosmos/evm/pull/609) Make `erc20Keeper` optional in the EVM keeper
- [\#624](https://github.com/cosmos/evm/pull/624) Cleanup unnecessary `fix-revert-gas-refund-height`.
- [\#635](https://github.com/cosmos/evm/pull/635) Move DefaultStaticPrecompiles to /evm and allow projects to set it by default alongside the keeper.


### FEATURES

- [\#346](https://github.com/cosmos/evm/pull/346) Add eth_createAccessList method and implementation
- [\#405](https://github.com/cosmos/evm/pull/405) Add erc20 factory precompile.
- [\#502](https://github.com/cosmos/evm/pull/502) Add block time in derived logs.
- [\#588](https://github.com/cosmos/evm/pull/588) go-ethereum metrics are now available in Cosmos SDK's telemetry server at host:port/geth/metrics (default localhost:1317/geth/metrics).


### STATE BREAKING

### API-BREAKING

- [\#477](https://github.com/cosmos/evm/pull/477) Refactor precompile constructors to accept keeper interfaces instead of concrete implementations, breaking the existing `NewPrecompile` function signatures.
- [\#594](https://github.com/cosmos/evm/pull/594) Remove all usage of x/params

## v0.4.1

### DEPENDENCIES

Expand Down Expand Up @@ -45,6 +94,7 @@
- [\#398](https://github.com/cosmos/evm/pull/398) Post-audit security fixes (batch 4)
- [\#442](https://github.com/cosmos/evm/pull/442) Prevent nil pointer by checking error in gov precompile FromResponse.
- [\#387](https://github.com/cosmos/evm/pull/387) (Experimental) EVM-compatible appside mempool
- [\#476](https://github.com/cosmos/evm/pull/476) Add revert error e2e tests for contract and precompile calls

### FEATURES

Expand Down
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ We appreciate community contributions! To ensure a smooth process, please follow
- All commits must be [signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits).
- Unsigned commits will be rejected.

3. **Documentation Contributions**
3. **Conventional Commit PR Titles**
- PR titles should use the [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/#summary) format.

4. **Documentation Contributions**
- We only accept documentation PRs that make **substantial or impactful changes**.
- Minor typo or style-only fixes in documentation will not be accepted.

Expand Down
80 changes: 78 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,90 @@ 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
ulimit -n 1300
test-system: build-v04 build
mkdir -p ./tests/systemtests/binaries/
cp $(BUILDDIR)/evmd ./tests/systemtests/binaries/
$(MAKE) -C tests/systemtests test

build-v04:
mkdir -p ./tests/systemtests/binaries/v0.4
git checkout v0.4.1
make build
cp $(BUILDDIR)/evmd ./tests/systemtests/binaries/v0.4
git checkout -

mocks:
@echo "--> generating mocks"
@go get github.com/vektra/mockery/v2
@go generate ./...
@make format-go

###############################################################################
### D2 Diagrams ###
###############################################################################

D2_THEME=300
D2_DARK_THEME=200
D2_LAYOUT=tala

D2_ENV_VARS=D2_THEME=$(D2_THEME) \
D2_DARK_THEME=$(D2_DARK_THEME) \
D2_LAYOUT=$(D2_LAYOUT)

.PHONY: d2check d2watch d2gen d2gen-all

d2check:
@echo "🔍 checking if d2 is installed..."
@which d2 > /dev/null 2>&1 || { \
echo "🔴 d2 is not installed, see installation docs: https://d2lang.com/tour/install/"; \
exit 1; \
}
@echo "🟢 d2 is installed"
@echo "🔍 checking if $(D2_LAYOUT) layout is installed..."
@d2 layout | grep $(D2_LAYOUT) > /dev/null 2>&1 || { \
echo "🔴 $(D2_LAYOUT) layout is not installed, see docs: https://d2lang.com/tour/layouts/"; \
exit 1; \
}
@echo "🟢 $(D2_LAYOUT) layout is installed"

d2watch: d2check
@if [ -z "$(FILE)" ]; then \
echo "🔴 missing required parameter FILE, the correct usage is: make d2watch FILE=path/to/file.d2"; \
exit 1; \
fi
@if [ ! -f "$(FILE)" ]; then \
echo "🔴 file $(FILE) does not exist"; \
exit 1; \
fi
@echo "🔄 watching $(FILE) for changes..."
@dir=$$(dirname "$(FILE)"); \
basename=$$(basename "$(FILE)" .d2); \
svgfile="$$dir/$$basename.svg"; \
printf "📊 generating $$svgfile from $(FILE)... "; \
$(D2_ENV_VARS) d2 --watch "$(FILE)" "$$svgfile"

d2gen: d2check
@if [ -z "$(FILE)" ]; then \
echo "🔴 missing required parameter FILE, the correct usage is: make d2gen FILE=path/to/file.d2"; \
exit 1; \
fi
@if [ ! -f "$(FILE)" ]; then \
echo "🔴 file $(FILE) does not exist"; \
exit 1; \
fi
@dir=$$(dirname "$(FILE)"); \
basename=$$(basename "$(FILE)" .d2); \
svgfile="$$dir/$$basename.svg"; \
printf "📊 generating $$svgfile from $(FILE)... "; \
$(D2_ENV_VARS) d2 "$(FILE)" "$$svgfile" > /dev/null 2>&1 && echo "done ✅" || echo "failed ❌";

d2gen-all: d2check
@echo "🟢 generating svg files for all d2 diagrams..."
@find . -name "*.d2" -type f | while read d2file; do \
dir=$$(dirname "$$d2file"); \
basename=$$(basename "$$d2file" .d2); \
svgfile="$$dir/$$basename.svg"; \
printf "📊 generating $$svgfile from $$d2file... "; \
$(D2_ENV_VARS) d2 "$$d2file" "$$svgfile" > /dev/null 2>&1 && echo "done ✅" || echo "failed ❌"; \
done
@echo "✅ svg files generated for all d2 diagrams"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,8 @@ We welcome open source contributions and discussions! For more on contributing,
Cosmos EVM is open-source under the Apache 2.0 license, an extension of the license of the original codebase (https://github.com/evmos/OS)
created by Tharsis and the evmOS team - who conducted the foundational work for EVM compatibility and
interoperability in Cosmos.

### Key Contributors

We at ICL want to thank our key contributors at [B-Harvest](https://bharvest.io/) and
[Mantra](https://www.mantrachain.io/) for contributing to and helping us drive the development of Cosmos EVM.
20 changes: 1 addition & 19 deletions ante/evm/05_signature_verification.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ func NewEthSigVerificationDecorator(ek anteinterfaces.EVMKeeper) EthSigVerificat
// Failure in RecheckTx will prevent tx to be included into block, especially when CheckTx succeed, in which case user
// won't see the error message.
func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) {
evmParams := esvd.evmKeeper.GetParams(ctx)
ethCfg := evmtypes.GetEthChainConfig()
blockNum := big.NewInt(ctx.BlockHeight())
signer := ethtypes.MakeSigner(ethCfg, blockNum, uint64(ctx.BlockTime().Unix())) //#nosec G115 -- int overflow is not a concern here
allowUnprotectedTxs := evmParams.GetAllowUnprotectedTxs()

msgs := tx.GetMsgs()
if msgs == nil {
Expand All @@ -49,7 +47,7 @@ func (esvd EthSigVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, s
return ctx, errorsmod.Wrapf(errortypes.ErrUnknownRequest, "invalid message type %T, expected %T", msg, (*evmtypes.MsgEthereumTx)(nil))
}

err := SignatureVerification(msgEthTx, msgEthTx.AsTransaction(), signer, allowUnprotectedTxs)
err := SignatureVerification(msgEthTx, msgEthTx.AsTransaction(), signer)
if err != nil {
return ctx, err
}
Expand All @@ -66,23 +64,7 @@ func SignatureVerification(
msg *evmtypes.MsgEthereumTx,
ethTx *ethtypes.Transaction,
signer ethtypes.Signer,
allowUnprotectedTxs bool,
) error {
ethCfg := evmtypes.GetEthChainConfig()

if !allowUnprotectedTxs {
if !ethTx.Protected() {
return errorsmod.Wrapf(
errortypes.ErrNotSupported,
"rejected unprotected ethereum transaction; please sign your transaction according to EIP-155 to protect it against replay-attacks")
}
if ethTx.ChainId().Uint64() != ethCfg.ChainID.Uint64() {
return errorsmod.Wrapf(
errortypes.ErrInvalidChainID,
"rejected ethereum transaction with incorrect chain-id; expected %d, got %d", ethCfg.ChainID, ethTx.ChainId())
}
}

if err := msg.VerifySender(signer); err != nil {
return errorsmod.Wrapf(errortypes.ErrorInvalidSigner, "signature verification failed: %s", err.Error())
}
Expand Down
Loading
Loading