Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Transaction dropped from memory pool" when transaction is successful on-chain #3880

Closed
2 tasks done
0xkinley opened this issue Dec 12, 2022 · 14 comments
Closed
2 tasks done
Labels
C-forge Command: forge Cmd-forge-script Command: forge script T-bug Type: bug

Comments

@0xkinley
Copy link

0xkinley commented Dec 12, 2022

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

What command(s) is the bug in?

forge script forge-scripts/deploy_contracts.sol \ --rpc-url $RPC \ --private-key $PRIVATE_KEY \ --broadcast

Operating System

macOS (Apple Silicon)

Describe the bug

while running the command the error received is :
Transaction dropped from the mempool: 0xaa6d6cf356d14eaed26585cdacc143087a7b2271cb03b1a845554ad91a7ea88b
Transaction dropped from the mempool: 0x9711633969b6cc81a9983c44db9c09e4d2aae2c2e68b31af20e849a76c74aedb

But when checked on https://testnet.snowtrace.io/ these transaction hash show successful transaction.

And after the script is updated to "forge script forge-scripts/deploy_contracts.sol
--rpc-url $RPC
--private-key $PRIVATE_KEY
--broadcast --resume" to resume the transaction the error received is (code: -32000, message: nonce too low: address 0xC470686e8cb845246DCDF5BCcAf509883A4859AE current nonce (7) > tx nonce (6), data: None)

@0xkinley 0xkinley added the T-bug Type: bug label Dec 12, 2022
@rkrasiuk rkrasiuk added C-forge Command: forge Cmd-forge-script Command: forge script labels Dec 22, 2022
@simon-something
Copy link

Same behaviour,
Ubuntu 22.04

foundryup: installed - forge 0.2.0 (8c4294c 2022-12-22T00:03:55.083004205Z)
foundryup: installed - cast 0.2.0 (8c4294c 2022-12-22T00:03:55.083004205Z)
foundryup: installed - anvil 0.1.0 (8c4294c 2022-12-22T00:04:20.109568457Z)

I'm deploying 5 contracts, only the last 2 or 3 tx are incorrectly flagged as dropped (and have no receipt in the broadcast json)

@aliceho if needed, for me, this consistently happened with Infura -> changing rpc provider (Ankr) fixed it!

@emo-eth
Copy link
Contributor

emo-eth commented Dec 26, 2022

Also running into this on Optimism and Optimism Goerli on latest foundry. For N transactions I need to run the script N times. Wonder if it's due to fast block times?

@kontrol-apa
Copy link

kontrol-apa commented Jan 2, 2023

I am having the same issue on fuji testnet, exactly as described by @aliceho. I havent tried it with a different rpc provider since i am not aware of any easily accessible, free rpc provider for Fuji. I have tried it with a QuickNode Fuji RPC url but this also didnt help me.

I have also tried with --slow, and the issue still persists.

Sending only 1 tx per forge script ... run seems to sometimes remedy this but it really is cumbersome to deploy multiple contracts this way.

It seems like the dropped tx always goes thru (in N transactions the very first one seems to always go thru) but my main problem is the verification. It directly fails in a dropped tx scenario and manually verifying (even with forge verify-contract) is quite tedious work.

@joshieDo
Copy link
Collaborator

joshieDo commented Jan 3, 2023

fixed by #4010

@Rizary
Copy link

Rizary commented Feb 16, 2023

@joshieDo I still got the error. Here's the error says:

Transactions saved to: /home/rizary/smart-contract/broadcast/Deploy.s.sol/80001/run-latest.json

Error: 
Transaction dropped from the mempool: 0xc6a1f6cec634ad525bd75c916224fb594621113235b5c276c6f8dc5977b1a1e3

here's my Deploy.s.sol script

pragma solidity ^0.8.15;

import "forge-std/Script.sol";
import "../src/1.0/FractionalizedNFT.sol";
import "../src/1.0/FractionToken.sol";
import "../src/1.0/SoonanTsoorNFT.sol";
import "../src/1.0/StakingFractionNFT.sol";

contract Deploy is Script {
    address public fractionalizedNFT;
    address public fractionToken;
    address public soonanTsoorNFT;
    address public stakingFractionNFT;
    address public USDCAddress;

    constructor() Script() {
    }

    function run() external {
        USDCAddress = vm.envAddress("USDC_ADDRESS");
        vm.startBroadcast();
        // deploy SoonanTsoorNFT contract
        SoonanTsoorNFT soonanTsoorNFTContract = new SoonanTsoorNFT(USDCAddress);
        soonanTsoorNFT = address(soonanTsoorNFTContract);
        
        FractionToken fractionTokenContract = new FractionToken();
        fractionToken = address(fractionTokenContract);

        // deploy FractionalizedNFT contract
        FractionalizedNFT fractionalizedNFTContract = new FractionalizedNFT(fractionToken, soonanTsoorNFT, USDCAddress);
        fractionalizedNFT = address(fractionalizedNFTContract);

        // deploy StakingFractionNFT contract
        StakingFractionNFT stakingFractionNFTContract = new StakingFractionNFT();
        stakingFractionNFT = address(stakingFractionNFTContract);
        
        vm.stopBroadcast();
    }
}

yrong added a commit to Snowfork/snowbridge that referenced this issue Feb 21, 2023
yrong added a commit to Snowfork/snowbridge that referenced this issue Feb 24, 2023
…nix hook (#777)

* Refactor: move to initialize hook & some cleanup

* Fix husky

* Update foundry libs with submodule

* env for goerli

* Fix for production deployment

* Suppress error temporarily when init BeefyClient for
foundry-rs/foundry#3880

* More refactor for comments

* For goerli e2e setup

* Fix: for both local&goerli setup

* More fixes

* Fix for comments

* Cleanup

* Improve e2e scripts

* Fix for comments
@RafaBlockDev
Copy link

This sucks, it is not helping

@yohanelly95
Copy link

Still facing this on forge 0.2.0 (e5318c3 2024-03-21T00:17:26.798143000Z) on the moonbase alpha chain (does not seem chain related though)

@skyline9981
Copy link

Still facing this on forge 0.2.0 (e5318c3 2024-03-21T00:17:26.798143000Z) on the zircuit testnet.

@gzliudan
Copy link

I also encounter this error, my version is forge 0.2.0 (440ec52 2024-04-11T00:18:58.806922049Z).

1712877751761

@Eoous
Copy link

Eoous commented May 9, 2024

same error

@TomOthentic
Copy link

TomOthentic commented Jun 6, 2024

Same issue with forge 0.2.0 on Holesky
image
actually all succesfull https://holesky.etherscan.io/tx/0xb398f6e842e545bdfba4f2133310abe8d1243bd10270d4475da0b1458d883e98

@kartojal
Copy link

getting also this lately in Holesky or Sepolia testnets, foundry outputs the error but is actually confirmed on-chain

@intoverflow
Copy link

I have observed this issue as well. Some notes:

  • I have not encountered this when using Alchemy for RPC.
  • I have consistently encountered this when using Fireblocks for RPC.
  • In my use case, I'm lucky: I can use Fireblocks to send the Tx, then switch to Alchemy to confirm it. This is a peculiar feature of Fireblocks' integration utility (fireblocks-json-rpc), which allows you to specify a non-Fireblocks RPC provider for non-send-tx operations.

I'd wager that some upstream library (used by some RPC providers, but not all) is formatting the response in a way that forge is unable to recognize as success. But that's a shot in the dark; unfortunately I'm unable to dig any deeper at this time.

@Eoous
Copy link

Eoous commented Jul 11, 2024

@intoverflow It depends on RPC providers.

In my case, i encountered the error when foundry received NullResponse by get_receipt from RPC. NullResponse is not valid response so that foundry would throw this.

For more, check codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge Cmd-forge-script Command: forge script T-bug Type: bug
Projects
None yet
Development

No branches or pull requests