perf(prewarm): execute warm transactions with real fee and nonce semantics - #12413
Conversation
…ntics Warm transactions routed to the system processor, whose BuyGas, PayFees and IncrementNonce are no-ops: same-sender warm sequences ran with undebited balances and unbumped nonces, so deploy chains computed wrong CREATE addresses and warmed the wrong storage. The regular processor under SkipValidation already debits, bumps and skips only the fail checks, and its Warmup guards keep the shared transaction unmutated — route warmup there and keep the system processor for system transactions.
|
Claude finished @svlachakis's task in 4m 37s —— View job Review: perf(prewarm): execute warm transactions with real fee and nonce semantics
VerdictThe change is correct, minimal, and consensus-safe. The routing predicate goes from Why it's safe:
Why it's a real fix: FindingsLow — regression test guards the routing, not the described scenario. Low / informational — mempool-prewarm coverage for underpriced/underfunded txs. On the real path, No Critical, High, or Medium issues. Consensus execution is untouched. |
…rm senders best-effort A warm sender funded earlier in the block by another sender's transaction has no parent-state balance; per-sender warm groups cannot see that funding, so BuyGas/PayValue charge what exists instead of failing and losing the sender's warming. The old contract tests asserted the no-op semantics this PR removes; they now assert the real-semantics warm scope.
EXPB Benchmark ComparisonRun: View workflow run superblocksScenario: Client Processing (SSE)
K6 TTFB
realblocksScenario: Client Processing (SSE)
K6 TTFB
fusakaScenario: Client Processing (SSE)
K6 TTFB
|
EVM Opcode Benchmark DiffAggregated runs: base=3, pr=3 No significant regressions or improvements detected. |
# Conflicts: # src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs
|
Claude finished @svlachakis's task in 2m 31s —— View job Review: perf(prewarm): execute warm transactions with real fee and nonce semantics
VerdictThe change is correct, minimal, and consensus-safe. I concur with the earlier review and @benaadams's approval, and add a few edge-case observations below. Nothing blocks merge. Routing ( Consensus-safe: Real fix confirmed: FindingsLow — the "no scenario warms less than before" claim has narrow exceptions. On the real path Low — best-effort branch can leave the warm-scope sender balance above reality. When No Critical, High, or Medium issues. Consensus execution is untouched; the warm path stays entirely within the prewarmer's throwaway scope. |
Changes
ExecutionOptions.Warmup | SkipValidationrouted warm transactions toSystemTransactionProcessor, whoseBuyGas/PayFees/IncrementNonceare no-ops. Consequence: same-sender warm sequences executed with undebited balances and unbumped nonces, so deploy chains computed wrong CREATE addresses and warmed the wrong storage — a systematic prewarmer-coverage hole on exactly the heavy blocks.SkipValidationalready debits gas and value and bumps the nonce (skipping only the fail checks), and whose existingWarmupguards keep the shared transaction object unmutated. Onlyopts == SkipValidation(and true system txs) still take the system processor;ITransactionProcessor.Warmupis the single caller of the warmup combination.BuyGas/PayValueunderWarmupcharge what exists instead of failing, so such senders keep warming their execution path — no scenario warms less than before this PR.Warmup_does_not_modify_sender_nonce/Warmup_does_not_deduct_sender_balanceasserted the no-op semantics this PR removes; they now assert the real-semantics warm scope (bumped nonce, debited balance), alongside new tests for the exact debit, the unmutated shared transaction, and the underfunded-sender path.All effects stay inside the prewarmer's throwaway scope; consensus execution is untouched.
Testing
TransactionProcessorWarmupTests: exact value+gas debit, nonce bump, shared transaction unmutated, underfunded sender still executes.TransactionProcessorTests.Nethermind.Evm.Test4887/4887;Nethermind.Blockchain.Test1552/1552;Nethermind.Consensus.Test110/110;dotnet formatclean.Types of changes