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

Remix IDE freezes when a contract call error occurs #5327

Closed
0xcodefive opened this issue Oct 24, 2024 · 12 comments · Fixed by #5337
Closed

Remix IDE freezes when a contract call error occurs #5327

0xcodefive opened this issue Oct 24, 2024 · 12 comments · Fixed by #5337
Assignees

Comments

@0xcodefive
Copy link

0xcodefive commented Oct 24, 2024

Describe the bug
When I try to call a contract function that returns an error, Remix IDE execution freezes (from https://remix.ethereum.org/). It doesn't matter what the error is, even with the banal incorrect Owner during the call. Previously, during such a call, a pop-up message with the error out of gas popped up. And the returned error was written to the ide console if, for example, revert contains its description.

Log output to the ide console:

transact to ERC721_Update.setNewCaller pending ... 

Log output to the browser console:

web3_request_manager.ts:432 Uncaught (in promise) ContractExecutionError: Error happened while trying to execute a function inside a smart contract
    at Web3RequestManager._isReverted (web3_request_manager.ts:432:48)
    at Web3RequestManager._processJsonRpcResponse (web3_request_manager.ts:373:23)
    at rejectWithError (web3_request_manager.ts:233:12)

After that, the ide freezes for 42 blocks (if I'm not confused). At the same time, any other calls are queued, but nothing happens.

Desktop

  • Windows 10 and Windows 11
  • Google Chrome Version 130.0.6723.70 (Official build), (64 bit) and Version 130.0.6723.59 (Official build), (64 bit)
  • Remix IDE v0.56.0
  • Metamask Version 12.4.1, Version 12.4.2, Version 12.5.0

Important note
There is no such problem in desktop version 0.55.0-dev for Windows

@Aniket-Engg
Copy link
Collaborator

Aniket-Engg commented Oct 25, 2024

@0xcodefive Do you face this error while using remix desktop application?

Also can you share steps to reproduce?

@0xcodefive
Copy link
Author

0xcodefive commented Oct 25, 2024

@Aniket-Engg

Do you face this error while using remix desktop application?

No. I believe the problem is related to the latest version. Since remix desktop version is 0.55.0, and the browser version is 0.56.0

Also can you share steps to reproduce?

The error can be repeated even if you cancel the transaction from the wallet. I will describe one of the examples that is easy to repeat.

  1. Connect any interface, such as ERC 20 to any ERC 20 contract
  2. You can call approve transaction to any address, you can use your own with a amount of 0 coins
  3. Cancel the transaction in the wallet

As a result, an error will appear in the browser console, and other calls will not take place in the ide.

Absolutely any call that fails causes the ide to freeze. To be more precise, the interface itself is working, all buttons are available all input fields are available. When the blockchain is changed, the wallet balance is updated. However, the connection between the ide and the blockchain is lost. Any call does not go through the blockchain. Apparently, protection against a repeat transaction is triggered until the previous one is completed. But there is an outlier from the execution cycle, as a result of which the ide believes that the transaction has not completed yet.

@0xcodefive
Copy link
Author

This error is not observed in Firefox 115.16.1esr

@0xcodefive
Copy link
Author

0xcodefive commented Oct 25, 2024

@Aniket-Engg
An easy way to repeat the error:

  1. Connect Metamask
  2. In default_workspace, select the _Storage.sol contract
  3. Click deploy and cancel the transaction in Metamask

After that, no other transactions that require confirmation in the Metamask will be performed until the timeout timer is triggered:

creation of Storage errored: Error occurred: The connected Ethereum Node did not respond within 750 seconds, please make sure your transaction was properly sent and you are connected to a healthy Node. Be aware that transaction might still be pending or mined!
	Transaction Hash: not available.

Console log:

Uncaught (in promise) Error: MetaMask Tx Signature: User denied transaction signature.
    at _callee3$ (3456.0.56.0.1729697541829.js:1:613683)
    at tryCatch (main.0.56.0.1729697541829.js:1:3663661)
    at Generator.invoke [as _invoke] (main.0.56.0.1729697541829.js:1:3667612)
    at Generator.next (main.0.56.0.1729697541829.js:1:3664800)
    at asyncGeneratorStep (main.0.56.0.1729697541829.js:1:1669631)
    at _next (main.0.56.0.1729697541829.js:1:1669942)

@0xcodefive
Copy link
Author

@Aniket-Engg It seems that the error has been found, please fix it as soon as possible: #5337

@yann300
Copy link
Contributor

yann300 commented Oct 28, 2024

hello @0xcodefive this is the deploy preview for the fix https://deploy-preview-5337--remixproject.netlify.app/
could you try reproducing your issue with a test contract there?

@yann300
Copy link
Contributor

yann300 commented Oct 28, 2024

or can you post the contract code of _Storage.sol ? is this a normal Storage.sol?

@0xcodefive
Copy link
Author

Hello @yann300
Unfortunately, the error persists. After canceling the contract deployment, the Metamask error is not returned to the UI. And all further transactions do not go through. That is, they are sent to the wallet only after the timeout period:

Welcome to Remix 0.57.0-dev 

Your files are stored in indexedDB, 59.38 KB / 1.12 TB used

You can use this terminal to: 
Check transactions details and start debugging.
Execute JavaScript scripts:
 - Input a script directly in the command line interface 
 - Select a Javascript file in the file explorer and then run `remix.execute()` or `remix.exeCurrent()`  in the command line interface 
 - Right click on a JavaScript file in the file explorer and then click `Run` 
The following libraries are accessible:
[web3.js](https://web3js.readthedocs.io/en/1.0/)
[ethers.js](https://docs.ethers.io/) 
sol-gpt <your Solidity question here>  
Type the library name to see available commands.
creation of Storage pending...
creation of Storage pending...
creation of Storage errored: Error occurred: Transaction started at 43512217 but was not mined within 50 blocks. Please make sure your transaction was properly sent and there no pervious pending transaction for the same account. However, be aware that it might still be mined!
	Transaction Hash: not available.

Transaction started at 43512217 but was not mined within 50 blocks. Please make sure your transaction was properly sent and there no pervious pending transaction for the same account. However, be aware that it might still be mined!
	Transaction Hash: not available

If the transaction failed for not having enough gas, try increasing the gas limit gently.

Error on browser console

inpage.js:1 MetaMask - RPC Error: MetaMask Tx Signature: User denied transaction signature. {code: 4001, message: 'MetaMask Tx Signature: User denied transaction signature.'}
...
Uncaught (in promise) Error: MetaMask Tx Signature: User denied transaction signature.
    at _callee3$ (run-tab.tsx:209:21)
    at tryCatch (runtime.js:63:16)
    at Generator.invoke [as _invoke] (runtime.js:293:1)
    at Generator.next (runtime.js:118:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:25:1)

As far as I understand, any error is not returned from the provider to the UI Remix

_Storage.sol:

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.8.2 <0.9.0;

/**
 * @title Storage
 * @dev Store & retrieve value in a variable
 * @custom:dev-run-script ./scripts/deploy_with_ethers.ts
 */
contract Storage {

    uint256 number;

    /**
     * @dev Store value in variable
     * @param num value to store
     */
    function store(uint256 num) public {
        number = num;
    }

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

@yann300
Copy link
Contributor

yann300 commented Oct 28, 2024

you don't have any issue with the Remix VM right?

@0xcodefive
Copy link
Author

0xcodefive commented Oct 28, 2024

No. Moreover, the error is not repeated in version 0.55.0-dev. I have checked on three different PC, they all catch the error in Windows and Chrome

@0xcodefive
Copy link
Author

Thank you

@0xcodefive
Copy link
Author

Now a pop-up message appears. However, the error is not displayed in the console.

Please try to deploy this contract for testing

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.8.2 <0.9.0;

contract Test {
    error O_o(uint256);
    constructor() {
        revert O_o(block.timestamp);
    }
}

from console UI

creation of Test errored: [object Object]

from browser console

data: 
	cause: null
	code: 3
	data: "0x7402013100000000000000000000000000000000000000000000000000000000671fb853"
	message: 	"execution reverted"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@yann300 @Aniket-Engg @0xcodefive and others