ethereum / remix-project

Remix is a browser-based compiler and IDE that enables users to build Ethereum contracts with Solidity language and to debug transactions.
https://remix-ide.readthedocs.io
MIT License
2.36k stars 888 forks source link

every transaction executed twice in Remix VM - Mainnet fork (and Testnet forks) #3665

Open fish-filet opened 1 year ago

fish-filet commented 1 year ago

I ran some unit tests in Remix IDE using the Remix VM - Merge. It works without any issues. As I needed the ERC-1820 registry contract I switched to Remix VM - Mainnet fork for the unit tests. Some error indicated that the transactions triggered by the unit tests are executed twice on the Remix VM - Mainnet fork. So I created a very simple contract to check this issue:

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

contract CallCounter {

    uint256 callCounter = 0;

    function call() public {
        callCounter += 1;
    }

    /**
     * @dev Return value 
     * @return value of 'number'
     */
    function retrieve() public view returns (uint256){
        return callCounter;
    }
}

Deployed on the Remix VM - Mainnet fork, when triggering the call method with a transaction it always adds 2 to the callCounter instead of 1. This contract works perfectly fine on Remix VM - Merge or on a local Ganache blockchain. Is this a known bug in Remix IDE? When using the debugger I can always debug only the second execution of the transaction. Also there is no hash of two transactions. It seems like there is just one transaction sent.

To reproduce:

Remix IDE Versions: Remix Desktop 1.3.6 on Ubuntu 22.04 and current version deployed on https://remix.ethereum.org/ used in Firefox

ClockRide commented 1 year ago

Noticed the same issue today