foundry: `forge script` stuck in pending status indefinitely
Component
Forge
Have you ensured that all of these are up to date?
- Foundry
- Foundryup
What version of Foundry are you on?
0.2.0 (9d74675 2024-10-31T00:21:25.844296000Z)
What command(s) is the bug in?
forge script
Operating System
macOS (Apple Silicon)
Describe the bug
when trying to deploy contracts with forge script, they become stuck indefinitely, causing the script to never complete (e.g., many hours without resolving). for example, when deploying to an anvil node, the logs will sit here forever:
⠈ Sequence #1 on 4362550583360910 | Waiting for pending transactions
⠠ [Pending] 0xdf7627fa2d61515e7cf89eb175ee925da67c85826663f9fed4f131e8d61c6eaa
⢀ [Pending] 0xa1dd30eea38df6bdb9790c4e9fa58a93eeeb5882ee9a0c16894ba8f7cb162895
⢀ [Pending] 0x4ea3c8c6b7099fb9c3cb70a5b3947d0f742d6dace434d06275189fe4ba99232a
⠠ [Pending] 0xb0a6c74a5f666ed040886381704734851ef3a1a2693abb9004cf9587267c58d1
similarly, when deploying to filecoin calibration, the same thing happens—i.e., it’s a bug irrespective of the target chain:
⠂ Sequence #1 on filecoin-calibration-testnet | Waiting for pending transactions
⠂ [Pending] 0xa3adcc8b1aa574ace5dca128673541010b5609172a7be8e11f082e0903ea2cc4
⠐ [Pending] 0xaf1db23686e1326428726420696df9cda381d2e2b3539b4b959ce20786f267a1
you can see that all of the txs in the snippet above have settled (e.g., here), but the script never exited.
this bug appeared starting in nightly-b1e93654348a0f31effa34790adae18865b14aa8 and still exits in the latest nightly-9d74675bae8bfbd83428ff1343cbe2ae206c3383. if I downgrade to nightly-2044faec64f99a21f0e5f0094458a973612d0712, the bug no longer happens, and everything works as expected.
this was tested on both apple silicon and remote linux machines; nightly-2044faec64f99a21f0e5f0094458a973612d0712 works, but anything thereafter fails.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (4 by maintainers)
confirming that https://github.com/alloy-rs/alloy/pull/1608 fixes it, can keep this open until we migrate to alloy version including the fix
looks like we’re ending up in an infinite loop here https://github.com/foundry-rs/foundry/blob/97be9b9a2e128633b17589cd58bfde4b4d544e23/crates/script/src/receipts.rs#L42-L57
I just tried building from the latest on
masterand deploying contracts to filecoin…no luck, unfortunately.Likely unrelated but we did just land a fix in
masterfor a deadlock introduced incd71da404(common shell) that occured when nestingsh_println!@grandizzy the “indefinite pending” issue exists on both linux/apple. to clarify:
forge scriptdeploying to the “latest” dockerized anvil setup on an apple machine. i haven’t done this on linux.forge scriptpointing to filecoin calibration. i.e., our remote infra uses linux machines to deploy contracts to filecoin calibration, not anvil.put differently, myself and 3 others from my team are seeing the same issue on our apple machines, plus, our remote linux infra. these only resolve if we rollback to
2044faec6.fwiw, i force grabbing the image on my macos via
docker pull --platform linux/x86_64 ..., and i haven’t ran into issues (even if it’s not recommended).