-
Notifications
You must be signed in to change notification settings - Fork 94
test(systemtests): add appside mempool e2e test #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
mempool/mempool.go
Outdated
if m.HasEventBus() { | ||
if m.eventBus != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we make this change? seems out of scope for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, It seems that when I merge conflict from main branch, something wrong happens.
I'll rollback that changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed! (d089213)
There was a problem hiding this 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).
Queued map[string]map[string]*RPCTransaction `json:"queued"` | ||
} | ||
|
||
type RPCTransaction struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have this type here. Let's use that instead of copying.
PrivKey *ethsecp256k1.PrivKey | ||
} | ||
|
||
type TxPoolResult struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto, same file as the RPCTransaction.
cosmossdk.io/systemtests v1.3.0 | ||
github.com/ethereum/go-ethereum v1.15.5 | ||
github.com/cometbft/cometbft/v2 v2.0.0-rc1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using V2 and RCs here?
type TestSuite interface { | ||
// Test Lifecycle | ||
BeforeEach(t *testing.T) | ||
AfterEach(t *testing.T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AfterEach(t *testing.T) | |
AfterEachCase(t *testing.T) |
// Test Lifecycle | ||
BeforeEach(t *testing.T) | ||
AfterEach(t *testing.T) | ||
JustAfterEach(t *testing.T) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JustAfterEach(t *testing.T) | |
AfterEachAction(t *testing.T) |
func(s TestSuite) { | ||
tx1, err := s.SendCosmosTx(t, s.Node(0), "acc0", 0, s.BaseFeeX2(), big.NewInt(1)) | ||
require.NoError(t, err, "failed to send tx") | ||
_, err = s.SendEthTx(t, s.Node(1), "acc0", 0, s.BaseFee(), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
func(s TestSuite) { | ||
_, err := s.SendEthTx(t, s.Node(0), "acc0", 0, s.BaseFee(), nil) | ||
require.NoError(t, err, "failed to send tx") | ||
tx2, err := s.SendCosmosTx(t, s.Node(1), "acc0", 0, s.BaseFeeX2(), big.NewInt(1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
func(s TestSuite) { | ||
tx1, err := s.SendEthTx(t, s.Node(0), "acc0", 0, s.BaseFeeX2(), big.NewInt(1)) | ||
require.NoError(t, err, "failed to send tx") | ||
_, err = s.SendCosmosTx(t, s.Node(1), "acc0", 0, s.BaseFee(), nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
}, | ||
}, | ||
{ | ||
name: "legacy should always not tx replace dynamic fee tx", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: "legacy should always not tx replace dynamic fee tx", | |
name: "legacy should never replace dynamic fee tx", |
} | ||
|
||
// CheckPendingOrCommitted checks if the given tx is either pending or committed within the timeout duration | ||
func (s *SystemTestSuite) CheckPendingOrCommitted( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do CheckPending
and CheckCommitted
as two separate calls as they function differently in Comet.
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
Test Mechanism
2.1 Persistent Node Architecture
2.2 Common Verification Framework
verification steps
(or committed)
on target nodes only
pending transactions to commit
Test Coverage Checklist
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...
main
branch