Skip to content

fix(test): fix flaky Special_Tx_Is_Executed_Before_Normal_Txs nonce collision#11033

Merged
newmanifold merged 1 commit into
masterfrom
fix/xdc-flaky-special-tx-test
Apr 4, 2026
Merged

fix(test): fix flaky Special_Tx_Is_Executed_Before_Normal_Txs nonce collision#11033
newmanifold merged 1 commit into
masterfrom
fix/xdc-flaky-special-tx-test

Conversation

@newmanifold
Copy link
Copy Markdown
Contributor

@newmanifold newmanifold commented Apr 3, 2026

Changes

  • Fix flaky Special_Tx_Is_Executed_Before_Normal_Txs test in Nethermind.Xdc.Test (~10% failure rate)
  • CreateTransferTxFrom used hardcoded nonce 0. When the randomly-selected sender account was also the masternode that sent a signing tx in an earlier block, nonce 0 was already consumed and the TxPool silently rejected the transfer tx as OldNonce

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Last failure from master: https://github.com/NethermindEth/nethermind/actions/runs/23953520456/job/69866442815

Parent issue: #10966

CreateTransferTxFrom used hardcoded nonce 0. When the randomly selected
sender account was also the masternode that had sent a signing tx in an
earlier block (consuming nonce 0), the TxPool silently rejected the
transfer tx as OldNonce. The block then contained only the signing tx,
failing the receipts.Length > 1 assertion.

Query GetLatestPendingNonce before building the transaction, matching
the pattern used by SignTransactionManager and every other test in the
same file.
@newmanifold newmanifold marked this pull request as draft April 3, 2026 22:08
@newmanifold newmanifold marked this pull request as ready for review April 3, 2026 22:18
@newmanifold newmanifold merged commit 568a061 into master Apr 4, 2026
431 checks passed
@newmanifold newmanifold deleted the fix/xdc-flaky-special-tx-test branch April 4, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants