OpenZeppelin / defender-deploy-client-cli

MIT License
0 stars 4 forks source link

The software hangs indefinitely without any information about what's happening #11

Open Magicking opened 5 months ago

Magicking commented 5 months ago

Description of the issue

When trying to submit a proposal through the OZ Foundry upgrade plugin, forge hangs indefinitely trying to deploy a contract, after looking over what was being executed it seems, that it hangs with the defender-deploy-client-cli as shown in the screenshot below image

Code used for upgradeProposal

// solhint-disable-next-line no-console
contract Upgrade0000 is Script {
    function run() public {
        Options memory opts;
        // Set a Random salt
        opts.defender.salt = bytes32(uint256(0x12345678)); // abritrary salt
        ProposeUpgradeResponse memory response = Defender.proposeUpgrade(
            0xXXXX, "RegistryAccess.sol", opts
        );
        console.log("Proposal id", response.proposalId);
        console.log("Url", response.url);
    }
}

Setup

-> foundry.toml updated according to upgrades requirement -> .env updated with Defender Key, secret and network ("sepolia")

Command run

forge clean && forge script Upgrade0000 --rpc-url https://ethereum-sepolia.publicnode.com -vvv

Magicking commented 5 months ago

Trying to run that manually it shows this: image ...

ericglau commented 5 months ago

Thanks for reporting this.

If your deployment environment for that network is configured in Defender to deploy using a Relayer, it should deploy without hanging.

If your deployment environment is using an EOA or Safe to deploy, then see this note in the docs:

If using an EOA or Safe to deploy, you must submit the pending deployments in Defender while the script is running. The script waits for each deployment to complete before it continues.

As you observed, the Foundry plugin does not give any indication that it is waiting, and unfortunately I'm not aware of any way for it to print a message to indicate this. If we use console.log in Forge scripts to attempt to print a status message, the message is not visible to the user until after the script completes (which it won't in this scenario!). If you have any suggestions on how this could be improved, I'd be happy to consider.