Skip to content

Conversation

cloudgray
Copy link
Contributor

@cloudgray cloudgray commented Sep 2, 2025

Description

Summary

This PR implements comprehensive end-to-end testing for appside mempool functionality, adding robust test infrastructure and extensive test cases to verify mempool behavior across different transaction types and node configurations.

Closes #581

System Tests Directory Structure

  • clients/ - Multi-client support infrastructure
    • Ethereum client integration for EVM transaction handling
    • Cosmos client integration for native Cosmos transaction support
  • mempool/ - Dedicated mempool test suite implementation
    • Comprehensive test cases using structured test suite pattern
    • Deterministic testing with nonce and baseFee tracking

Test Mechanism

2.1 Persistent Node Architecture

  • Single node startup for multiple test cases execution
  • evmd nodes remain running throughout entire test suite
  • Test suite maintains deterministic state by tracking:
    • Account nonces across all test cases
    • BaseFee progression for optimal gas pricing

2.2 Common Verification Framework

  • Action-based test structure: Each test case broken into smaller
    verification steps
  • Inter-test validation: Between every test case, suite performs:
    • Verification that expected pending transactions are actually pending
      (or committed)
    • Confirmation that expected queued transactions are properly queued
      on target nodes only
  • Final state verification: After all actions complete, suite waits for
    pending transactions to commit

Test Coverage Checklist

  • Multi-node transaction broadcasting - All test cases execute with transactions broadcast across multiple nodes
  • Ethereum-only transaction scenarios:
    • Queued transactions remain unbroadcast until promotion conditions met
    • Pending transactions broadcast immediately (including queue-to-pending promotions)
    • Same account transactions sent to different nodes handled correctly
  • Cosmos-only transaction scenarios - Native Cosmos transaction mempool behavior
  • Mixed transaction scenarios - Ethereum + Cosmos transactions broadcasted together
  • Transaction type mixing - LegacyFeeTx and DynamicFeeTx combined scenarios

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Copy link
Member

@vladjdk vladjdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, lovely test setup! I think this will make it significantly easier to write E2E tests in the future, which is something I applaud you for doing.

I left a few comments, mostly regarding the separation of Pending and Committed as end-states, as transactions get gossiped differently in the consensus phase (commit) vs. the mempool phase (unconfirmed).

@vladjdk vladjdk self-assigned this Sep 12, 2025
@vladjdk
Copy link
Member

vladjdk commented Sep 17, 2025

Merged #591 and #601. Let's fix the type import and disable bypassing. Rest lgtm!

Copy link
Member

@vladjdk vladjdk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving—merge after fixing the imports and disabling bypasses. Great work!

@vladjdk vladjdk enabled auto-merge September 18, 2025 21:30
@vladjdk vladjdk added this pull request to the merge queue Sep 18, 2025
Merged via the queue into cosmos:main with commit bb6162e Sep 18, 2025
20 checks passed
Eric-Warehime added a commit that referenced this pull request Sep 19, 2025
* test(mempool): setup e2e test suite for mempool testing

* WIP

* test(mempool): refactor test

* test(mempool): refactor system test suite

* test(systemtest): refactor mempool test

* test(systemtests): add cosmosClient

* test(systemtests): refactor mempool test

* test(systemtests): refactor mempool test

* test(systemtests): refactor mempool test

* test(systemtests): add txpool content verification to mempool tests

* test(systemtests): fix mempool test suite

* test(systemtests): fix mempool test suite

* test(systemtests): fix mempool tests

* test(systemtests): fix mempool test suite

* test(systemtests): fix mempool test suite

* test(systemtests): fix mempool test suite

* test(systemtests): add mempool test cases

* test(systemtests): add comments

* test(systemtests): chore: enable replacement tests

* chore: modify names of test cases

* test(systemtests): enhance helper functions

* test(systemtests): fix mempool test

* chore(systemtests): change test name and add readme.md

* chore: update CHANGELOG.md

* fix(proto): restore removed data field during merge

* test(systemtests): refactor

* test(systemtests): fix map iteration

* chore(systemtests): fix build tag

* test(systemtests): add test case for mempool

* test(systemtests): fix map iteration

* test(systemtests): refactor and add test case for --minimum-gas-prices=0stake

* test(systemtests): enhance validation

* fix: restore removed changes from merge

* fix: restore removed changes from merge

* fix: restore removed changes from merge

* fix: restore removed changes from merge

* chore(systemtests): rename test suite hooks

* fix(systemtests): fix test cases

* chore: modify mempool e2e test README.md

* test(systemtests): enhance post check of mempool test

* chore: apply codeQL feedback

* chore: update tests/systemtests/go.sum

* chore: go mod tidy

* fix(rpc): SendRawTransaction doesn't return error when tx.nonce is lower than pending nonce

* chore(systemtests): remove unused fields of RPCTransaction type

---------

Co-authored-by: Alex | Interchain Labs <alex@cosmoslabs.io>
Co-authored-by: Vlad J <vladjdk@gmail.com>
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.

Test: e2e test for appside mempool is needed

3 participants