Since commit 845d3d49e (July 2023), MinGasPrice validation (250000000 wei /
0.25 Gwei) has been enforced for all non-special transactions in validateTx().
Later, commit 141cb75c (Dec 2025) refactored this validation logic into the
standalone ValidateTransactionWithState() function for code reusability.
However, the transaction pool test suite was never updated to comply with the
MinGasPrice requirement and continued using extremely low gas prices (1-6 wei),
causing test failures when run independently.
The root cause of this issue was that testQueueTimeLimiting() set the global
variable 'common.MinGasPrice = big.NewInt(0)' without restoring it. This global
variable modification created severe testing problems:
1. Intermittent, non-deterministic failures: The same test would randomly pass
or fail without any code changes, depending on whether testQueueTimeLimiting
had executed and set MinGasPrice=0 before other tests checked it
2. Race conditions in concurrent execution: Since tests use t.Parallel(), multiple
tests could simultaneously access the shared global MinGasPrice variable,
creating unpredictable timing-dependent behavior
3. Test order dependency: When running 'make test', if testQueueTimeLimiting
executed early and set MinGasPrice=0, other tests with low gas prices would
pass. Running the same tests individually or in a different order would fail
with 'under min gas price' errors
4. Global state pollution: The MinGasPrice modification affected ALL concurrently
running tests in the suite, violating test isolation principles and making
debugging extremely difficult
5. Masked real validation issues: The global override hid the fact that test
transactions violated MinGasPrice requirements that would be enforced in
production, reducing test effectiveness
6. No cleanup mechanism: The changed value was never restored, permanently
affecting subsequent tests and creating cascading failures
This intermittent behavior made CI/CD pipelines unreliable - tests could pass
locally but fail in CI, or pass on retry without changes, wasting developer time
investigating 'phantom' failures.
This commit systematically updates all affected test cases to use gas prices
that satisfy the MinGasPrice requirement:
- Replace transaction() helper calls with pricedTransaction() using gas prices
>= 250000000 wei (MinGasPrice)
- Update dynamicFeeTx() calls to use gasFeeCap and gasTipCap >= 250000000 wei
- Scale account balances proportionally to cover the higher transaction costs
- Maintain test logic and relative price relationships between transactions
Tests fixed (36 total):
- TestStateChangeDuringReset
- TestInvalidTransactions
- TestChainFork
- TestDoubleNonce
- TestMissingNonce
- TestNonceRecovery
- TestPostponing
- TestGapFilling
- TestQueueAccountLimiting
- TestQueueGlobalLimiting
- TestQueueGlobalLimitingNoLocals
- TestQueueTimeLimiting
- TestQueueTimeLimitingNoLocals
- TestPendingLimiting
- TestPendingGlobalLimiting
- TestAllowedTxSize
- TestCapClearsFromAll
- TestPendingMinimumAllowance
- TestRepricing
- TestRepricingDynamicFee
- TestRepricingKeepsLocals
- TestPoolUnderpricing
- TestPoolStableUnderpricing
- TestUnderpricingDynamicFee
- TestDualHeapEviction
- TestDeduplication
- TestReplacement
- TestReplacementDynamicFee
- TestJournaling
- TestJournalingNoLocals
- TestStatusCheck
- TestDropping
- TestQueue
- TestQueue2
- TestNegativeValue
- TestSlotCount
All tests now pass consistently when run with: go test ./core/txpool -count=1