Skip to content

bug(anvil): forge script deployment hangs awaiting receipt finalization #10630

Open
@jistro

Description

@jistro

Component

Anvil

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

1.1.0-stable

What version of Foundryup are you on?

1.1.0

What command(s) is the bug in?

forge script

Operating System

Linux

Describe the bug

Description:

When attempting to deploy a contract using the forge script command, the deployment appears successful, but the process gets stuck waiting for the transaction receipt to finalize.

Steps to Reproduce:

  1. Run the following command:
    forge script script/Deploy.s.sol:DeployScript \
    		--rpc-url http://0.0.0.0:8545 \
    		--private-key $(DEFAULT_ANVIL_KEY) \
    		--broadcast \
    		-vvvv

Expected Behavior:

The forge script command should complete and finalize the transaction receipt promptly after a successful deployment.

Actual Behavior:

The command outputs a success message for the deployment hash, but then continuously waits for pending transactions and receipts. The console shows repeated eth_getTransactionReceipt and eth_blockNumber calls without finalization.

Relevant Logs:

##### anvil-hardhat
✅  [Success] Hash: 0xc95c3e3da8a734676fcd432fd94c15ed7c85699ed13248ef78caf9957eeeecf3
Block: 1
Paid: 0.000228795000228795 ETH (228795 gas * 1.000000001 gwei)

⠐ Sequence #1 on anvil-hardhat | Waiting for pending transactions
    ⡀ [Pending] 0x8d873c972851a1b30850f50c741926056cbab91c314c3cb9aa33308b9edc86ac
    ⠉ [00:00:54] [#############################################################################] 2/2 txes (0.0s)
    ⠉ [00:00:54] [##################################>----------------------------------] 1/2 receipts (12014.5s)
eth_sendRawTransaction

    Transaction: 0xc95c3e3da8a734676fcd432fd94c15ed7c85699ed13248ef78caf9957eeeecf3
    Gas used: 228795

    Block Number: 1
    Block Hash: 0x796ffd2f555df1df3d2b34d0a1a11394fdb24467cd8c00a81c32d14ab43d4bff
    Block Time: "Sun, 25 May 2025 20:48:47 +0000"

eth_sendRawTransaction

    Block Number: 2
    Block Hash: 0x7aa9a39591aa5fbadb005f4e4c44f3902bba62e2afede7f4316d37244287d31a
    Block Time: "Sun, 25 May 2025 20:48:47 +0000"

eth_getTransactionReceipt
eth_getTransactionReceipt
eth_getTransactionReceipt
eth_blockNumber
eth_getBlockByNumber
eth_getTransactionReceipt
eth_getTransactionReceipt
eth_blockNumber
eth_getTransactionReceipt
eth_blockNumber
eth_getTransactionReceipt
eth_blockNumber
eth_getTransactionReceipt
eth_blockNumber
eth_getTransactionReceipt
eth_blockNumber

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions