Supernova TxPool: Integration Tests 28 Nov#7493
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/supernova-async-exec #7493 +/- ##
=============================================================
- Coverage 77.61% 77.61% -0.01%
=============================================================
Files 872 872
Lines 119577 119576 -1
=============================================================
- Hits 92807 92803 -4
- Misses 20694 20697 +3
Partials 6076 6076 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
I think the tests cannot exactly match https://multiversxlabs.atlassian.net/browse/MX-16969, since that involves transactions shuffling (processing components) etc. Though, they are very useful, generally speaking.
| TxHash: []byte("txHash2"), | ||
| Fee: big.NewInt(int64(tx.GasLimit * tx.GasPrice)), | ||
| TransferredValue: tx.Value, | ||
| FeePayer: tx.RelayerAddr, |
There was a problem hiding this comment.
Is tx.RelayerAddr set above?
There was a problem hiding this comment.
it wasn't. fixed now
| nonceTracker := newNoncesTracker() | ||
|
|
||
| // create two transactions. | ||
| // both transactions have alice as sender and relayer |
There was a problem hiding this comment.
Do both have Alice as sender and relayer? Please double check. Sorry if I didn't see correctly.
| Signature: []byte("signature"), | ||
| } | ||
|
|
||
| txpool.AddTx(&txcache.WrappedTransaction{ |
There was a problem hiding this comment.
Please see:
- https://github.com/multiversx/mx-chain-go/blob/integration-tests-mempool-28-nov/txcache/txCache.go#L73
- https://github.com/multiversx/mx-chain-go/blob/integration-tests-mempool-28-nov/txcache/wrappedTransaction.go#L45
Maybe we should have the usual flow, closer to reality? Or not possible in this case? That is, allow AddTx to set (compute) the payer?
| require.ErrorContains(t, err, "root hash mismatch") | ||
| } | ||
|
|
||
| func Test_SelectionWithAliceRelayerAndSenderOnSameTxs(t *testing.T) { |
There was a problem hiding this comment.
Please double check if name of test matches the test.
| TxHash: []byte("txHash1"), | ||
| Fee: big.NewInt(int64(tx.GasLimit * tx.GasPrice)), | ||
| TransferredValue: tx.Value, | ||
| FeePayer: tx.SndAddr, |
There was a problem hiding this comment.
Same comment as above.
| FeePayer: tx.SndAddr, | ||
| }) | ||
|
|
||
| // the second transaction has bob as sender and alice as relayer. |
There was a problem hiding this comment.
Maybe set tx.RelayerAddr?
| TxHash: []byte("txHash1"), | ||
| }) | ||
|
|
||
| // the second transaction has alice as sender and as relayer. |
There was a problem hiding this comment.
How is this tx exactly relayed? I don't see any relayer field being set, this is the exact same tx as before, only with value 0
There was a problem hiding this comment.
inside the AddTx from TxCache the precomputeFields is called. if the relayer field is not set, the FeePayer field is set with the address of the sender.
Reasoning behind the pull request
Added more integration tests regarding the scenario when a specific sender hasn't enough amount to pay for the fee of two transactions.
This issue is still not solved:
https://multiversxlabs.atlassian.net/browse/MX-16969
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?