Skip to content

Fix miner forced-tx deadlock#14453

Open
isagi-y22 wants to merge 1 commit intofoundry-rs:masterfrom
isagi-y22:unblock
Open

Fix miner forced-tx deadlock#14453
isagi-y22 wants to merge 1 commit intofoundry-rs:masterfrom
isagi-y22:unblock

Conversation

@isagi-y22
Copy link
Copy Markdown

Motivation

Fixes a deadlock in anvil --fork-transaction-hash (see #13630).
Miner::poll previously waited on ready!() before consuming force_transactions, so replay transactions could remain unconsumed and same-sender nonce-dependent transactions could stay queued forever.

Solution

Miner::poll now consumes force_transactions before readiness blocking, so replay transactions are emitted on the first poll and nonce dependencies can progress. Forced inclusion is still one-time, then normal mining mode polling continues.

Added regression test:

  • poll_consumes_forced_transactions_before_mode_is_ready
    • verifies forced txs are returned even when mode is Poll::Pending
    • verifies forced txs are consumed exactly once

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant