Skip to content

Conversation

fusmanii
Copy link
Contributor

@fusmanii fusmanii commented Sep 2, 2025

We want to ensure that the new implementation is working as expected by toggling pauseDeposits function post upgrade

Signed-off-by: Faisal Usmani <[email protected]>
@fusmanii fusmanii force-pushed the faisal/try-upgradeTo branch from 462340a to 4b60fdd Compare September 2, 2025 17:45
@fusmanii fusmanii added the wip label Sep 2, 2025
@fusmanii fusmanii force-pushed the faisal/try-upgradeTo branch from 2e4e5ce to acb0084 Compare September 3, 2025 14:16
@fusmanii fusmanii changed the title WIP - feat: Try upgradeTo for testing WIP - feat: Added upgradeToAndCall to Spoke Pool Upgrade task Sep 3, 2025
@fusmanii fusmanii changed the title WIP - feat: Added upgradeToAndCall to Spoke Pool Upgrade task feat: Added upgradeToAndCall to Spoke Pool Upgrade task Sep 3, 2025
@fusmanii fusmanii marked this pull request as ready for review September 3, 2025 14:33
@fusmanii fusmanii removed the wip label Sep 3, 2025
nicholaspai
nicholaspai previously approved these changes Sep 3, 2025
Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Co-authored-by: nicholaspai <[email protected]>
Signed-off-by: Faisal Usmani <[email protected]>
@fusmanii fusmanii force-pushed the faisal/try-upgradeTo branch from 0d5917e to 3520c92 Compare September 3, 2025 14:38
@fusmanii fusmanii requested a review from nicholaspai September 3, 2025 14:39
@@ -17,13 +18,75 @@ task("upgrade-spokepool", "Generate calldata to upgrade a SpokePool deployment")
}

// @dev Any spoke pool's interface can be used here since they all should have the same upgradeTo function signature.
const abi = ["function upgradeTo(address newImplementation) external"];
const abi = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooc, can we draw on the ABI via typechain?

I'm generally pretty wary of using typechain, but given that the ABI is local to this repo it feels like we should be able to source it from somewhere dynamically, rather than have to redefine it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pxrl good point, I was able to get the abi directly from the artifact instead

@@ -3,8 +3,9 @@ import { HardhatRuntimeEnvironment } from "hardhat/types";

task("upgrade-spokepool", "Generate calldata to upgrade a SpokePool deployment")
.addParam("implementation", "New SpokePool implementation address")
.addOptionalParam("upgradeOnly", "Upgrade only, do not pause/unpause deposits")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think there's a scenario where we wouldn't want the atomic pause/unpause?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On EVM chains we are absolutely sure there is no difference from the L1 EVM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just kept it in case someone is looking for the old upgrade only behaviour. @pxrl do you think its better (and safer) to only have atomic pause/unpause option?

Comment on lines +71 to +83
/**
* We perform this seemingly unnecessary pause/unpause sequence because we want to ensure that the
* upgrade is successful and the new implementation gets forwarded calls by the proxy contract as expected
*
* Since the upgrade and call happens atomically, the upgrade will revert if the new implementation
* is not functioning correctly.
*/
const data = spokePool.interface.encodeFunctionData("multicall", [
[
spokePool.interface.encodeFunctionData("pauseDeposits", [true]),
spokePool.interface.encodeFunctionData("pauseDeposits", [false]),
],
]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice; I like this!

Signed-off-by: Faisal Usmani <[email protected]>
@fusmanii fusmanii requested a review from pxrl September 8, 2025 12:58
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 this pull request may close these issues.

3 participants