Skip to content

Supernova TxPool: Integration Tests 28 Nov#7493

Merged
AdoAdoAdo merged 9 commits into
feat/supernova-async-execfrom
integration-tests-mempool-28-nov
Dec 8, 2025
Merged

Supernova TxPool: Integration Tests 28 Nov#7493
AdoAdoAdo merged 9 commits into
feat/supernova-async-execfrom
integration-tests-mempool-28-nov

Conversation

@danielradu10
Copy link
Copy Markdown
Contributor

@danielradu10 danielradu10 commented Nov 28, 2025

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:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@danielradu10 danielradu10 self-assigned this Nov 28, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.61%. Comparing base (8db71dc) to head (671067d).
⚠️ Report is 45 commits behind head on feat/supernova-async-exec.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@andreibancioiu andreibancioiu left a comment

Choose a reason for hiding this comment

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

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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is tx.RelayerAddr set above?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it wasn't. fixed now

nonceTracker := newNoncesTracker()

// create two transactions.
// both transactions have alice as sender and relayer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do both have Alice as sender and relayer? Please double check. Sorry if I didn't see correctly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

Signature: []byte("signature"),
}

txpool.AddTx(&txcache.WrappedTransaction{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please see:

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

require.ErrorContains(t, err, "root hash mismatch")
}

func Test_SelectionWithAliceRelayerAndSenderOnSameTxs(t *testing.T) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please double check if name of test matches the test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

TxHash: []byte("txHash1"),
Fee: big.NewInt(int64(tx.GasLimit * tx.GasPrice)),
TransferredValue: tx.Value,
FeePayer: tx.SndAddr,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

FeePayer: tx.SndAddr,
})

// the second transaction has bob as sender and alice as relayer.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe set tx.RelayerAddr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed now

@mariusmihaic mariusmihaic self-requested a review December 3, 2025 12:02
TxHash: []byte("txHash1"),
})

// the second transaction has alice as sender and as relayer.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

https://github.com/multiversx/mx-chain-go/blob/integration-tests-mempool-28-nov/txcache/wrappedTransaction.go#L45

@AdoAdoAdo AdoAdoAdo merged commit 7008307 into feat/supernova-async-exec Dec 8, 2025
11 checks passed
@AdoAdoAdo AdoAdoAdo deleted the integration-tests-mempool-28-nov branch December 8, 2025 11:58
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.

4 participants