Skip to content
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6e76883
test(mempool): setup e2e test suite for mempool testing
cloudgray Aug 28, 2025
8b68d43
WIP
cloudgray Aug 28, 2025
7ae8b16
test(mempool): refactor test
cloudgray Sep 1, 2025
6700051
test(mempool): refactor system test suite
cloudgray Sep 2, 2025
3681758
test(systemtest): refactor mempool test
cloudgray Sep 2, 2025
b41028a
Merge branch 'main' into teest/appside-mempool-e2e
cloudgray Sep 2, 2025
d8368f1
Merge branch 'main' into teest/appside-mempool-e2e
cloudgray Sep 3, 2025
87ec45e
test(systemtests): add cosmosClient
cloudgray Sep 3, 2025
51cb60f
test(systemtests): refactor mempool test
cloudgray Sep 3, 2025
2d41eeb
test(systemtests): refactor mempool test
cloudgray Sep 4, 2025
a4d24e2
test(systemtests): refactor mempool test
cloudgray Sep 4, 2025
f552c38
test(systemtests): add txpool content verification to mempool tests
cloudgray Sep 4, 2025
173541c
test(systemtests): fix mempool test suite
cloudgray Sep 5, 2025
adc5533
test(systemtests): fix mempool test suite
cloudgray Sep 5, 2025
6a3b03e
test(systemtests): fix mempool tests
cloudgray Sep 8, 2025
6d8d240
test(systemtests): fix mempool test suite
cloudgray Sep 8, 2025
14ef6a9
test(systemtests): fix mempool test suite
cloudgray Sep 8, 2025
9fbe143
test(systemtests): fix mempool test suite
cloudgray Sep 8, 2025
48de3af
test(systemtests): add mempool test cases
cloudgray Sep 8, 2025
e33650a
test(systemtests): add comments
cloudgray Sep 9, 2025
a4fe745
test(systemtests): chore: enable replacement tests
cloudgray Sep 9, 2025
25e65d4
chore: modify names of test cases
cloudgray Sep 9, 2025
8f5d4a4
test(systemtests): enhance helper functions
cloudgray Sep 9, 2025
06fc10a
test(systemtests): fix mempool test
cloudgray Sep 9, 2025
ac74377
chore(systemtests): change test name and add readme.md
cloudgray Sep 9, 2025
230e422
Merge branch 'main' into teest/appside-mempool-e2e
cloudgray Sep 9, 2025
de46b7f
chore: update CHANGELOG.md
cloudgray Sep 9, 2025
bf6db75
fix(proto): restore removed data field during merge
cloudgray Sep 9, 2025
2ecece2
test(systemtests): refactor
cloudgray Sep 9, 2025
58d1e7d
test(systemtests): fix map iteration
cloudgray Sep 9, 2025
e6085fd
chore(systemtests): fix build tag
cloudgray Sep 9, 2025
1c55fb9
test(systemtests): add test case for mempool
cloudgray Sep 9, 2025
a55ad3d
test(systemtests): fix map iteration
cloudgray Sep 9, 2025
d139dd7
test(systemtests): refactor and add test case for --minimum-gas-price…
cloudgray Sep 10, 2025
ffbb84d
test(systemtests): enhance validation
cloudgray Sep 10, 2025
57a8d10
Merge branch 'main' into teest/appside-mempool-e2e
aljo242 Sep 10, 2025
d089213
fix: restore removed changes from merge
cloudgray Sep 11, 2025
f4fe8af
fix: restore removed changes from merge
cloudgray Sep 11, 2025
88d36bc
fix: restore removed changes from merge
cloudgray Sep 11, 2025
95c6dfd
fix: restore removed changes from merge
cloudgray Sep 11, 2025
e566f7a
chore(systemtests): rename test suite hooks
cloudgray Sep 15, 2025
58e97d8
fix(systemtests): fix test cases
cloudgray Sep 15, 2025
5d2b2fd
Merge branch 'main' into teest/appside-mempool-e2e
cloudgray Sep 17, 2025
14a4cf8
chore: modify mempool e2e test README.md
cloudgray Sep 17, 2025
23d361d
test(systemtests): enhance post check of mempool test
cloudgray Sep 17, 2025
11c6152
chore: apply codeQL feedback
cloudgray Sep 17, 2025
c08dee6
Merge branch 'main' into teest/appside-mempool-e2e
vladjdk Sep 17, 2025
1ad3a2e
Merge branch 'main' into teest/appside-mempool-e2e
cloudgray Sep 18, 2025
7ee7940
chore: update tests/systemtests/go.sum
cloudgray Sep 18, 2025
cacee64
chore: go mod tidy
cloudgray Sep 18, 2025
217732e
fix(rpc): SendRawTransaction doesn't return error when tx.nonce is lo…
cloudgray Sep 18, 2025
d00de60
chore(systemtests): remove unused fields of RPCTransaction type
cloudgray Sep 18, 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 @@ -28,6 +28,7 @@
- [\#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.
- [\#624](https://github.com/cosmos/evm/pull/624) Cleanup unnecessary `fix-revert-gas-refund-height`.
Expand Down
51 changes: 51 additions & 0 deletions tests/systemtests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Getting started with a new system test

## Overview

The systemtests suite is an end-to-end test suite that runs the evmd process and sends RPC requests from separate Ethereum/Cosmos clients. The systemtests for cosmos/evm use the `cosmossdk.io/systemtests` package by default. For more details, please refer to https://github.com/cosmos/cosmos-sdk/tree/main/tests/systemtests.

## Preparation

Build a new binary from current branch and copy it to the `tests/systemtests/binaries` folder by running system tests.

```shell
make test-system
```

Or via manual steps

```shell
make build
mkdir -= ./tests/systemtests/binaries
cp ./build/evmd ./tests/systemtests/binaries
cp ./build/evmd ./tests/systemtests/binaries/v0.4
```

## Run Individual test

### Run test cases for txs ordering

```shell
go test -p 1 -parallel 1 -mod=readonly -tags='system_test' -v ./... \
--run TestTxsOrdering --verbose --binary evmd --block-time 5s --chain-id local-4221
```

### Run test cases for txs replacement

```shell
go test -p 1 -parallel 1 -mod=readonly -tags='system_test' -v ./... \
--run TestTxsReplacement --verbose --binary evmd --block-time 5s --chain-id local-4221
```

### Run test exceptions

```shell
go test -p 1 -parallel 1 -mod=readonly -tags='system_test' -v ./... \
--run TestExceptions --verbose --binary evmd --block-time 5s --chain-id local-4221
```

## Run Entire test

```shell
make test
```
75 changes: 75 additions & 0 deletions tests/systemtests/clients/config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package clients

import (
"fmt"
"math/big"
)

/**
# ---------------- dev mnemonics source ----------------
# dev0 address 0xC6Fe5D33615a1C52c08018c47E8Bc53646A0E101 | cosmos1cml96vmptgw99syqrrz8az79xer2pcgp84pdun
# dev0's private key: 0x88cbead91aee890d27bf06e003ade3d4e952427e88f88d31d61d3ef5e5d54305 # gitleaks:allow

# dev1 address 0x963EBDf2e1f8DB8707D05FC75bfeFFBa1B5BaC17 | cosmos1jcltmuhplrdcwp7stlr4hlhlhgd4htqh3a79sq
# dev1's private key: 0x741de4f8988ea941d3ff0287911ca4074e62b7d45c991a51186455366f10b544 # gitleaks:allow

# dev2 address 0x40a0cb1C63e026A81B55EE1308586E21eec1eFa9 | cosmos1gzsvk8rruqn2sx64acfsskrwy8hvrmafqkaze8
# dev2's private key: 0x3b7955d25189c99a7468192fcbc6429205c158834053ebe3f78f4512ab432db9 # gitleaks:allow

# dev3 address 0x498B5AeC5D439b733dC2F58AB489783A23FB26dA | cosmos1fx944mzagwdhx0wz7k9tfztc8g3lkfk6rrgv6l
# dev3's private key: 0x8a36c69d940a92fcea94b36d0f2928c7a0ee19a90073eda769693298dfa9603b # gitleaks:allow
*/

const (
ChainID = "local-4221"
EVMChainID = "262144"

Acc0PrivKey = "88cbead91aee890d27bf06e003ade3d4e952427e88f88d31d61d3ef5e5d54305"
Acc1PrivKey = "741de4f8988ea941d3ff0287911ca4074e62b7d45c991a51186455366f10b544"
Acc2PrivKey = "3b7955d25189c99a7468192fcbc6429205c158834053ebe3f78f4512ab432db9"
Acc3PrivKey = "8a36c69d940a92fcea94b36d0f2928c7a0ee19a90073eda769693298dfa9603b"

JsonRPCUrl0 = "http://127.0.0.1:8545"
JsonRPCUrl1 = "http://127.0.0.1:8555"
JsonRPCUrl2 = "http://127.0.0.1:8565"
JsonRPCUrl3 = "http://127.0.0.1:8575"

NodeRPCUrl0 = "http://127.0.0.1:26657"
NodeRPCUrl1 = "http://127.0.0.1:26658"
NodeRPCUrl2 = "http://127.0.0.1:26659"
NodeRPCUrl3 = "http://127.0.0.1:26660"
)

type Config struct {
ChainID string
EVMChainID *big.Int
PrivKeys []string
JsonRPCUrls []string
NodeRPCUrls []string
}

// NewConfig creates a new Config instance.
func NewConfig() (*Config, error) {
// evm chainID
evmChainID, ok := new(big.Int).SetString(EVMChainID, 10)
if !ok {
return nil, fmt.Errorf("error whilte setting chain id")
}

// private keys of test accounts
privKeys := []string{Acc0PrivKey, Acc1PrivKey, Acc2PrivKey, Acc3PrivKey}

// jsonrpc urls of testnet nodes
jsonRPCUrls := []string{JsonRPCUrl0, JsonRPCUrl1, JsonRPCUrl2, JsonRPCUrl3}

// rpc urls of test nodes
nodeRPCUrls := []string{NodeRPCUrl0, NodeRPCUrl1, NodeRPCUrl2, NodeRPCUrl3}

return &Config{
ChainID: ChainID,
EVMChainID: evmChainID,
PrivKeys: privKeys,
JsonRPCUrls: jsonRPCUrls,
NodeRPCUrls: nodeRPCUrls,
}, nil
}
Loading
Loading